Skip to content

Commit a9ebae0

Browse files
committed
- cosmetics for sorting
1 parent 58a2326 commit a9ebae0

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

class/Files/CreateTableFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getTableTables($mId, $sort = 'table_id ASC, table_name', $order
8484
* @param string $order
8585
* @return mixed
8686
*/
87-
public function getTableFields($mId, $tId, $sort = 'field_id ASC, field_name', $order = 'ASC')
87+
public function getTableFields($mId, $tId, $sort = 'field_order ASC, field_id', $order = 'ASC')
8888
{
8989
$criteria = new \CriteriaCompo();
9090
$criteria->add(new \Criteria('field_mid', $mId)); // $mId = module Id

class/Files/Sql/SqlFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function getDatabaseFields($moduleDirname, $tableMid, $tableId, $tableNa
186186
$row = [];
187187
//$type = '';
188188
$fieldTypeName = '';
189-
$fields = $this->getTableFields($tableMid, $tableId, 'field_id ASC, field_name');
189+
$fields = $this->getTableFields($tableMid, $tableId, 'field_order ASC, field_id');
190190
foreach (\array_keys($fields) as $f) {
191191
// Creation of database table
192192
$ret = $this->getHeadDatabaseTable($moduleDirname, $tableName, $fieldsNumb);

class/Files/Templates/User/Defstyle/PagesItem.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ public function write($module, $table, $tables, $filename)
8989
* @param $tableMid
9090
* @param $tableName
9191
* @param $tableSoleName
92-
* @param $tableRate
92+
* @param $tableRate
93+
* @param $tableBroken
9394
* @param $language
9495
* @return string
9596
*/
96-
private function getTemplatesUserPagesItemPanel($moduleDirname, $tableId, $tableMid, $tableName, $tableSoleName, $tableRate, $language)
97+
private function getTemplatesUserPagesItemPanel($moduleDirname, $tableId, $tableMid, $tableName, $tableSoleName, $tableRate, $tableBroken, $language)
9798
{
9899
$fields = $this->getTableFields($tableMid, $tableId);
99100
$ret = '';
@@ -187,8 +188,10 @@ private function getTemplatesUserPagesItemPanel($moduleDirname, $tableId, $table
187188
$lang = $this->sc->getSmartyConst('', '_DELETE');
188189
$contIf .= $this->hc->getHtmlAnchor($tableName . ".php?op=delete&{$fieldId}=" . $keyDouble, $lang, $lang, '', 'btn btn-danger right', '', "\t\t\t", "\n");
189190
$anchors .= $this->sc->getSmartyConditions('permEdit', '', '', $contIf, false, '', '', "\t\t");
190-
$lang = $this->sc->getSmartyConst($language, 'BROKEN');
191-
$anchors .= $this->hc->getHtmlAnchor($tableName . ".php?op=broken&{$fieldId}=" . $keyDouble, $lang, $lang, '', 'btn btn-warning right', '', "\t\t", "\n");
191+
if (1 == $tableBroken) {
192+
$lang = $this->sc->getSmartyConst($language, 'BROKEN');
193+
$anchors .= $this->hc->getHtmlAnchor($tableName . ".php?op=broken&{$fieldId}=" . $keyDouble, $lang, $lang, '', 'btn btn-warning right', '', "\t\t", "\n");
194+
}
192195
$retFoot .= $this->hc->getHtmlDiv($anchors, 'col-sm-12 right',"\t", "\n");
193196
$ret .= $this->hc->getHtmlDiv($retFoot, 'panel-foot');
194197
if ($tableRate) {
@@ -217,9 +220,10 @@ public function render()
217220
$tableName = $table->getVar('table_name');
218221
$tableSoleName = $table->getVar('table_solename');
219222
$tableRate = $table->getVar('table_rate');
223+
$tableBroken = $table->getVar('table_broken');
220224
$tableCategory[] = $table->getVar('table_category');
221225
if (\in_array(0, $tableCategory)) {
222-
$content .= $this->getTemplatesUserPagesItemPanel($moduleDirname, $tableId, $tableMid, $tableName, $tableSoleName, $tableRate, $language);
226+
$content .= $this->getTemplatesUserPagesItemPanel($moduleDirname, $tableId, $tableMid, $tableName, $tableSoleName, $tableRate, $tableBroken, $language);
223227
}
224228

225229
$this->create($moduleDirname, 'templates', $filename, $content, _AM_MODULEBUILDER_FILE_CREATED, _AM_MODULEBUILDER_FILE_NOTCREATED);

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- delete fields, tables, morefiles when deleting module (goffy)
1818
- fixed bug in creation of user header.php (goffy)
1919
- fixed bug in creation of user pages files (goffy)
20+
- cosmetics for sorting (goffy)
2021

2122
<h5>3.04 Alpha 1 [2020-06-12]</h5> Dev: XOOPS 2.5.11, PHP 7.4.5
2223
<hr>
4.49 KB
Loading

0 commit comments

Comments
 (0)