Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
166c94dc31
@ -14,6 +14,7 @@ phpMyAdmin - ChangeLog
|
||||
+ rfe #947 Show edit/delete also when there is calculated column
|
||||
+ rfe #1619 Show databases as list instead of as dropdown when no database is selected
|
||||
+ rfe Optional dark theme for the console
|
||||
+ rfe #354 PDF schema sort options
|
||||
|
||||
4.4.1.0 (not yet released)
|
||||
- bug #4813 MySQL 5.7.6 and the Users menu tab
|
||||
|
||||
@ -2373,6 +2373,13 @@ $cfg['Schema']['pdf_show_grid'] = false;
|
||||
*/
|
||||
$cfg['Schema']['pdf_with_doc'] = true;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @global string $cfg['Schema']['pdf_table_order']
|
||||
*/
|
||||
$cfg['Schema']['pdf_table_order'] = '';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@ -94,6 +94,18 @@ class SchemaPdf extends SchemaPlugin
|
||||
$leaf->setText(__('Data Dictionary'));
|
||||
$specificOptions->addProperty($leaf);
|
||||
|
||||
$leaf = new SelectPropertyItem();
|
||||
$leaf->setName("table_order");
|
||||
$leaf->setText(__('Order of the tables'));
|
||||
$leaf->setValues(
|
||||
array(
|
||||
'' => __('None'),
|
||||
'name_asc' => __('Name (Ascending)'),
|
||||
'name_desc' => __('Name (Descending)'),
|
||||
)
|
||||
);
|
||||
$specificOptions->addProperty($leaf);
|
||||
|
||||
// add the main group to the root group
|
||||
$exportSpecificOptions->addProperty($specificOptions);
|
||||
|
||||
|
||||
@ -428,6 +428,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private $_showGrid;
|
||||
private $_withDoc;
|
||||
private $_tableOrder;
|
||||
private $_tables = array();
|
||||
private $_ff = PMA_PDF_FONT;
|
||||
private $_xMax = 0;
|
||||
@ -461,6 +462,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$this->setTableDimension(isset($_REQUEST['pdf_show_table_dimension']));
|
||||
$this->setAllTablesSameWidth(isset($_REQUEST['pdf_all_tables_same_width']));
|
||||
$this->setWithDataDictionary(isset($_REQUEST['pdf_with_doc']));
|
||||
$this->setTableOrder($_REQUEST['pdf_table_order']);
|
||||
$this->setOrientation($_REQUEST['pdf_orientation']);
|
||||
$this->setPaper($_REQUEST['pdf_paper']);
|
||||
|
||||
@ -481,6 +483,11 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$pdf->setOffline($this->offline);
|
||||
|
||||
$alltables = $this->getTablesFromRequest();
|
||||
if ($this->getTableOrder() == 'name_asc') {
|
||||
sort($alltables);
|
||||
} else if ($this->getTableOrder() == 'name_desc') {
|
||||
rsort($alltables);
|
||||
}
|
||||
|
||||
if ($this->_withDoc) {
|
||||
$pdf->SetAutoPageBreak('auto', 15);
|
||||
@ -645,6 +652,30 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
return $this->_withDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the order of the table in data dictionary
|
||||
*
|
||||
* @param string $value table order
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function setTableOrder($value)
|
||||
{
|
||||
$this->_tableOrder = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the order of the table in data dictionary
|
||||
*
|
||||
* @return string table order
|
||||
*/
|
||||
public function getTableOrder()
|
||||
{
|
||||
return $this->_tableOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output Pdf Document for download
|
||||
*
|
||||
|
||||
@ -1,103 +0,0 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for multibytes string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
require_once 'test/libraries/string_test_abstract.php';
|
||||
|
||||
/**
|
||||
* tests for multibytes string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_StringMbTest extends PMA_StringTest
|
||||
{
|
||||
/**
|
||||
* Setup function for test cases
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
require_once 'libraries/string.lib.php';
|
||||
if (MULTIBYTES_STATUS === MULTIBYTES_OFF) {
|
||||
$this->markTestSkipped(
|
||||
"Multibyte functions don't exist, skipping test."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testStrlen
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerStrlen()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerStrlen(),
|
||||
array(array(13, "chaîne testée"))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testSubStr
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerSubstr()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerSubstr(),
|
||||
array(
|
||||
array("rçon", "garçon", 2, 4),
|
||||
array("de ", "garçon de café", 7, 3)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testSubstrCount
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerSubstrCount()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerSubstrCount(),
|
||||
array(
|
||||
array(2, "garçon de café", "a"),
|
||||
array(1, "garçon de café attristé", "ç"),
|
||||
array(2, "garçon de café attristé", "é"),
|
||||
array(1, "garçon de café attristé", "fé"),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//providerSubstrCountException
|
||||
|
||||
/**
|
||||
* Data provider for testStrpos
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerStrpos()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerStrpos(),
|
||||
array(
|
||||
array(16, "garçon de café attristé", "t"),
|
||||
array(13, "garçon de café attristé", "é"),
|
||||
array(22, "garçon de café attristé", "é", 15),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//providerStrpos
|
||||
//providerStrrchr
|
||||
//providerStrtolower
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for standard string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
require_once 'test/libraries/string_test_abstract.php';
|
||||
|
||||
/**
|
||||
* tests for string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_StringNativeTest extends PMA_StringTest
|
||||
{
|
||||
/**
|
||||
* Setup function for test cases
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
require_once 'libraries/string.lib.php';
|
||||
if (MULTIBYTES_STATUS === MULTIBYTES_ON) {
|
||||
$this->markTestSkipped(
|
||||
"Multibyte functions exist, can't test standard functions, skipping "
|
||||
. "test."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
99
test/libraries/string_test.php
Normal file
99
test/libraries/string_test.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
require_once 'test/libraries/string_test_abstract.php';
|
||||
|
||||
require_once 'libraries/string.lib.php';
|
||||
if (MULTIBYTES_STATUS === MULTIBYTES_OFF) {
|
||||
/**
|
||||
* tests for string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_StringNativeTest extends PMA_StringTest
|
||||
{
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* tests for multibytes string library
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_StringMbTest extends PMA_StringTest
|
||||
{
|
||||
/**
|
||||
* Data provider for testStrlen
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerStrlen()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerStrlen(),
|
||||
array(array(13, "chaîne testée"))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testSubStr
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerSubstr()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerSubstr(),
|
||||
array(
|
||||
array("rçon", "garçon", 2, 4),
|
||||
array("de ", "garçon de café", 7, 3)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testSubstrCount
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerSubstrCount()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerSubstrCount(),
|
||||
array(
|
||||
array(2, "garçon de café", "a"),
|
||||
array(1, "garçon de café attristé", "ç"),
|
||||
array(2, "garçon de café attristé", "é"),
|
||||
array(1, "garçon de café attristé", "fé"),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//providerSubstrCountException
|
||||
|
||||
/**
|
||||
* Data provider for testStrpos
|
||||
*
|
||||
* @return array Test data
|
||||
*/
|
||||
public function providerStrpos()
|
||||
{
|
||||
return array_merge(
|
||||
parent::providerStrpos(),
|
||||
array(
|
||||
array(16, "garçon de café attristé", "t"),
|
||||
array(13, "garçon de café attristé", "é"),
|
||||
array(22, "garçon de café attristé", "é", 15),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//providerStrpos
|
||||
//providerStrrchr
|
||||
//providerStrtolower
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 175 B |
Binary file not shown.
|
Before Width: | Height: | Size: 676 B |
Loading…
Reference in New Issue
Block a user