Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-09-30 02:39:21 +02:00
commit 37bdf8b813
8 changed files with 134 additions and 120 deletions

View File

@ -1329,21 +1329,16 @@ class Results
$displayParts['del_lnk']
);
// 1. Set $colspan and generate html with full/partial
// text button or link
list($colspan, $button_html)
= $this->_getFieldVisibilityParams(
$displayParts, $full_or_partial_text_link
);
$table_headers_html .= '<thead><tr>' . "\n";
$table_headers_html .= $button_html;
// 2. Displays the fields' name
// 2.0 If sorting links should be used, checks if the query is a "JOIN"
// 1. Displays the fields' name
// 1.0 If sorting links should be used, checks if the query is a "JOIN"
// statement (see 2.1.3)
// See if we have to highlight any header fields of a WHERE query.
// Uses SQL-Parser results.
$this->_setHighlightedColumnGlobalField($analyzed_sql_results);
// Get the headers for all of the columns
@ -1353,6 +1348,17 @@ class Results
$is_limited_display, $unsorted_sql_query
);
// 2. Set $colspan and generate html with full/partial
// text button or link
list($colspan, $button_html)
= $this->_getFieldVisibilityParams(
$displayParts, $full_or_partial_text_link
);
$table_headers_html .= $button_html;
// Display column at rightside - checkboxes or empty column
if (! $printview) {
$table_headers_html .= $this->_getColumnAtRightSide(
@ -1524,7 +1530,7 @@ class Results
$display_params = $this->__get('display_params');
// 1. Displays the full/partial text button (part 1)...
$button_html .= '<thead><tr>' . "\n";
// $button_html .= '<thead><tr>' . "\n";
$colspan = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE)
&& ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE))
@ -2770,7 +2776,25 @@ class Results
$del_url = $del_str = $edit_anchor_class
= $edit_str = $js_conf = $copy_url = $copy_str = $edit_url = null;
// 1.2 Defines the URLs for the modify/delete link(s)
// 1.2 Displays the rows' values
if (is_null($this->__get('mime_map'))) {
$this->_setMimeMap();
}
$table_body_html .= $this->_getRowValues(
$dt_result,
$row,
$row_no,
$col_order,
$map,
$grid_edit_class,
$col_visib,
$url_sql_query,
$analyzed_sql_results
); // end (1)
// 2 Defines the Action
// 2.1 Defines the URLs for the modify/delete link(s)
if (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE)
|| ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)
@ -2798,7 +2822,7 @@ class Results
$where_clause_html = htmlspecialchars($where_clause);
// 1.2.1 Modify link(s) - update row case
// 2.1.1 Modify link(s) - update row case
if ($displayParts['edit_lnk'] == self::UPDATE_ROW) {
list($edit_url, $copy_url, $edit_str, $copy_str,
@ -2808,9 +2832,9 @@ class Results
$clause_is_unique, $url_sql_query
);
} // end if (1.2.1)
} // end if (2.1.1)
// 1.2.2 Delete/Kill link(s)
// 2.1.2 Delete/Kill link(s)
list($del_url, $del_str, $js_conf)
= $this->_getDeleteAndKillLinks(
$where_clause, $clause_is_unique,
@ -2818,7 +2842,7 @@ class Results
$row
);
// 1.3 Displays the links at left if required
// 2.1.3 Displays the links at left if required
if (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT)
|| ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)
) {
@ -2839,24 +2863,10 @@ class Results
$edit_str, $copy_str, $del_str, $js_conf
);
} // end if (1.3)
} // end if (1)
} // end if (2.1.3)
} // end if (2)
// 2. Displays the rows' values
if (is_null($this->__get('mime_map'))) {
$this->_setMimeMap();
}
$table_body_html .= $this->_getRowValues(
$dt_result,
$row,
$row_no,
$col_order,
$map,
$grid_edit_class,
$col_visib,
$url_sql_query,
$analyzed_sql_results
);
// 3. Displays the modify/delete links on the right if required
if (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE)

View File

@ -6,15 +6,7 @@
printf(_ngettext('%s table', '%s tables', $num_tables),
PhpMyAdmin\Util::formatNumber($num_tables, 0)); ?>
</th>
<?php if ($server_slave_status): ?>
<th> <?= __('Replication'); ?> </th>
<?php endif; ?>
<?php
$sum_colspan = ($db_is_system_schema ? 4 : 7);
if ($GLOBALS['cfg']['NumFavoriteTables'] == 0) {
$sum_colspan--;
} ?>
<th colspan="<?= $sum_colspan; ?>" class="print_ignore" ><?= __('Sum'); ?></th>
<?php
$row_count_sum = PhpMyAdmin\Util::formatNumber($sum_entries, 0);
// If a table shows approximate rows count, display update-all-real-count anchor.
@ -71,6 +63,16 @@ $cell_text = ($approx_rows)
<th class="value tbl_overhead"><?= $overhead_formatted , ' ' , $overhead_unit; ?></th>
<?php endif; ?>
<?php if ($server_slave_status): ?>
<th> <?= __('Replication'); ?> </th>
<?php endif; ?>
<?php
$sum_colspan = ($db_is_system_schema ? 4 : 7);
if ($GLOBALS['cfg']['NumFavoriteTables'] == 0) {
$sum_colspan--;
} ?>
<th colspan="<?= $sum_colspan; ?>" class="print_ignore" ><?= __('Sum'); ?></th>
<?php if ($GLOBALS['cfg']['ShowDbStructureCharset']): ?>
<th>
<?= $db_charset; ?>

View File

@ -17,46 +17,7 @@
</td>
<?php endif; ?>
<?php
//Favorite table anchor.
?>
<?php if ($GLOBALS['cfg']['NumFavoriteTables'] > 0): ?>
<td class="center print_ignore">
<?= PhpMyAdmin\Template::get('database/structure/favorite_anchor')->render(
array(
'db' => $db,
'current_table' => $current_table,
'titles' => $titles,
'already_favorite' => $already_favorite
)
); ?>
</td>
<?php endif; ?>
<td class="center print_ignore">
<?= $browse_table; ?>
</td>
<td class="center print_ignore">
<a href="tbl_structure.php<?= $tbl_url_query; ?>">
<?= $titles['Structure']; ?>
</a>
</td>
<td class="center print_ignore">
<?= $search_table; ?>
</td>
<?php if (!$db_is_system_schema): ?>
<td class="insert_table center print_ignore">
<a href="tbl_change.php<?= $tbl_url_query; ?>"><?= $titles['Insert']; ?></a>
</td>
<td class="center print_ignore"><?= $empty_table; ?></td>
<td class="center print_ignore">
<a class="ajax drop_table_anchor <?= ($table_is_view || $current_table['ENGINE'] == null) ? ' view' : '' ?>"
href="sql.php<?= $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?= urlencode($drop_query); ?>&amp;message_to_show=<?= urlencode($drop_message); ?>" >
<?= $titles['Drop']; ?>
</a>
</td>
<?php endif; ?>
<?php if (isset($current_table['TABLE_ROWS']) &&
($current_table['ENGINE'] != null || $table_is_view)): ?>
@ -116,6 +77,47 @@
</td>
<?php endif; ?>
<?php
//Favorite table anchor.
?>
<?php if ($GLOBALS['cfg']['NumFavoriteTables'] > 0): ?>
<td class="center print_ignore">
<?= PhpMyAdmin\Template::get('database/structure/favorite_anchor')->render(
array(
'db' => $db,
'current_table' => $current_table,
'titles' => $titles,
'already_favorite' => $already_favorite
)
); ?>
</td>
<?php endif; ?>
<td class="center print_ignore">
<?= $browse_table; ?>
</td>
<td class="center print_ignore">
<a href="tbl_structure.php<?= $tbl_url_query; ?>">
<?= $titles['Structure']; ?>
</a>
</td>
<td class="center print_ignore">
<?= $search_table; ?>
</td>
<?php if (!$db_is_system_schema): ?>
<td class="insert_table center print_ignore">
<a href="tbl_change.php<?= $tbl_url_query; ?>"><?= $titles['Insert']; ?></a>
</td>
<td class="center print_ignore"><?= $empty_table; ?></td>
<td class="center print_ignore">
<a class="ajax drop_table_anchor <?= ($table_is_view || $current_table['ENGINE'] == null) ? ' view' : '' ?>"
href="sql.php<?= $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?= urlencode($drop_query); ?>&amp;message_to_show=<?= urlencode($drop_message); ?>" >
<?= $titles['Drop']; ?>
</a>
</td>
<?php endif; ?>
<?php if (!($GLOBALS['cfg']['ShowDbStructureCharset'] > 1)): ?>
<?php if (strlen($charset)): ?>
<td class="nowrap">

View File

@ -27,9 +27,6 @@ if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
<?php if ($replication): ?>
<th><?= __('Replication'); ?></th>
<?php endif; ?>
<th colspan="<?= $action_colspan; ?>" class="print_ignore">
<?= __('Action'); ?>
</th>
<!-- larger values are more interesting so default sort order is DESC-->
<th>
<?= PhpMyAdmin\Template::get('database/structure/sortable_header')->render(
@ -78,6 +75,9 @@ if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
)
); $cnt++; ?></th>
<?php endif; ?>
<th colspan="<?= $action_colspan; ?>" class="print_ignore">
<?= __('Action'); ?>
</th>
<?php if ($GLOBALS['cfg']['ShowDbStructureCharset']): ?>
<th><?= PhpMyAdmin\Template::get('database/structure/sortable_header')->render(

View File

@ -148,19 +148,19 @@ class PMA_SeleniumSqlQueryTest extends PMA_SeleniumBase
$this->waitForElement('byCssSelector', 'table.table_results');
$this->assertEquals(
3,
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
4,
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
4,
$this->getCellByTableClass('table_results', 1, 6)
$this->getCellByTableClass('table_results', 1, 2)
);
$this->assertEquals(
5,
$this->getCellByTableClass('table_results', 2, 6)
$this->getCellByTableClass('table_results', 2, 2)
);
// test inline edit button

View File

@ -72,17 +72,17 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"3",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
// case 2
@ -91,37 +91,37 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
"3",
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
// case 2
$this->byLinkText("datetimefield")->click();
$this->waitAjax();
$this->getCellByTableClass('table_results', 1, 5);
$this->getCellByTableClass('table_results', 1, 1);
$this->assertEquals(
"3",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
// case 4
@ -130,17 +130,17 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
"3",
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
}
@ -154,7 +154,7 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
public function testChangeRecords()
{
$ele = $this->byCssSelector(
"table.table_results tbody tr:nth-child(2) td:nth-child(2)"
"table.table_results tbody tr:nth-child(2) td:nth-child(5)"
);
$this->moveto($ele);
$this->click();
@ -195,12 +195,12 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"foobar",
$this->getCellByTableClass('table_results', 2, 6)
$this->getCellByTableClass('table_results', 2, 2)
);
$this->assertEquals(
"2009-01-02 00:00:00",
$this->getCellByTableClass('table_results', 2, 7)
$this->getCellByTableClass('table_results', 2, 3)
);
}
@ -214,7 +214,7 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
public function testChangeRecordsByDoubleClick()
{
$element = $this->byCssSelector(
"table.table_results tbody tr:nth-child(1) td:nth-child(6)"
"table.table_results tbody tr:nth-child(1) td:nth-child(2)"
);
$this->moveto($element);
@ -241,7 +241,7 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"abcde",
$this->getCellByTableClass('table_results', 1, 6)
$this->getCellByTableClass('table_results', 1, 2)
);
}
@ -255,7 +255,7 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
public function testCopyRecords()
{
$ele = $this->byCssSelector(
"table.table_results tbody tr:nth-child(3) td:nth-child(3)"
"table.table_results tbody tr:nth-child(3) td:nth-child(6)"
);
$this->moveto($ele);
$this->click();
@ -287,12 +287,12 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"ABCDEFG",
$this->getCellByTableClass('table_results', 4, 6)
$this->getCellByTableClass('table_results', 4, 2)
);
$this->assertEquals(
"2012-01-02 00:00:00",
$this->getCellByTableClass('table_results', 4, 7)
$this->getCellByTableClass('table_results', 4, 3)
);
}
@ -325,12 +325,12 @@ class PMA_SeleniumTableBrowseTest extends PMA_SeleniumBase
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"3",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
}

View File

@ -133,47 +133,47 @@ class PMA_SeleniumTableInsertTest extends PMA_SeleniumBase
$this->assertEquals(
"1",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
"abcd",
$this->getCellByTableClass('table_results', 1, 6)
$this->getCellByTableClass('table_results', 1, 2)
);
$this->assertEquals(
"2011-01-02 00:00:00",
$this->getCellByTableClass('table_results', 1, 7)
$this->getCellByTableClass('table_results', 1, 3)
);
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
"foo",
$this->getCellByTableClass('table_results', 2, 6)
$this->getCellByTableClass('table_results', 2, 2)
);
$this->assertEquals(
"2012-01-02 00:00:00",
$this->getCellByTableClass('table_results', 2, 7)
$this->getCellByTableClass('table_results', 2, 3)
);
$this->assertEquals(
"4",
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
$this->assertEquals(
"Abcd",
$this->getCellByTableClass('table_results', 3, 6)
$this->getCellByTableClass('table_results', 3, 2)
);
$this->assertEquals(
"2013-01-02 00:00:00",
$this->getCellByTableClass('table_results', 3, 7)
$this->getCellByTableClass('table_results', 3, 3)
);
}
}

View File

@ -97,7 +97,7 @@ class PMA_SeleniumTableOperationsTest extends PMA_SeleniumBase
$this->assertEquals(
"2",
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
}