Skip to content

Commit

Permalink
fixed bug in link / code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoffy committed Jan 7, 2023
1 parent bf02fb6 commit 4df9c8f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion class/DateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public static function getInstance()

/**
* @public function getForm
* @param bool $action
* @param int $mid
* @param int $tableid
* @param int $period
* @return \XoopsThemeForm
*/
public function getFormDate($mid = 0, $tableid = 0, $period = Constants::DATE_ONEYEAR)
Expand Down
2 changes: 1 addition & 1 deletion class/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function setId ($id) {

/**
* Render test data
* @return mixed
* @return float|int|string
*/
public function renderer() {
//reset ranges
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
1.0.2 [2022/08/29]
==============================================================
- added feature 'date' (Goffy)
- fixed bug in link (mambax7/goffy)

==============================================================
1.0.1 [2022/08/06]
Expand Down
10 changes: 5 additions & 5 deletions plugins/wgsimpleacc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
/**
* plugin to correct inconsistant data, created by generator
*
* @return bool
* @return void
*/
function wgfaker_plugin_wgsimpleacc ()
{
// correction 1: expenses should have only amount out
$sql = 'UPDATE `' . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . "` SET `tra_amountin` = '0' WHERE `" . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . '`.`tra_class` = 2;';
if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
if (!$GLOBALS['xoopsDB']->queryF($sql)) {
\trigger_error($GLOBALS['xoopsDB']->error());
}

// correction 2: incomes should have only amount in
$sql = 'UPDATE `' . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . "` SET `tra_amountout` = '0' WHERE `" . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . '`.`tra_class` = 3;';
if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
if (!$GLOBALS['xoopsDB']->queryF($sql)) {
\trigger_error($GLOBALS['xoopsDB']->error());
}

Expand All @@ -57,7 +57,7 @@ function wgfaker_plugin_wgsimpleacc ()
$counter = 0;
while (false !== ($traId = $GLOBALS['xoopsDB']->fetchRow($result))) {
$sql = 'UPDATE `' . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . "` SET `tra_date` = '" . $datesArr[$counter] . "', `tra_datecreated` = '" . $datesArr[$counter] . "' WHERE `" . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . '`.`tra_id` = ' . $traId[0] . ';';
if (!$resultUpdate = $GLOBALS['xoopsDB']->queryF($sql)) {
if (!$GLOBALS['xoopsDB']->queryF($sql)) {
\trigger_error($GLOBALS['xoopsDB']->error());
}
$counter++;
Expand All @@ -67,7 +67,7 @@ function wgfaker_plugin_wgsimpleacc ()
}
// incomes should be higher than expenses
$sql = 'UPDATE `' . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . "` SET `tra_amountin` = `tra_amountin` * 1.2 WHERE `" . $GLOBALS['xoopsDB']->prefix('wgsimpleacc_transactions') . '`.`tra_class` = 3;';
if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
if (!$GLOBALS['xoopsDB']->queryF($sql)) {
\trigger_error($GLOBALS['xoopsDB']->error());
}
}
2 changes: 1 addition & 1 deletion templates/admin/wgfaker_admin_table.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<td class='center'><{$table.datecreated_text}></td>
<td class='center'><{$table.submitter_text}></td>
<td class="center width5">
<a href="column.php?op=list&amp;mid=<{$table.mid}>&amp;tableid=<{$table.id}>" title="<{$smarty.const._AM_WGFAKER_LIST_FIELD}>"><img src="<{$wgfaker_icons_url_16}>fields.png" alt="<{$smarty.const._AM_WGFAKER_LIST_FIELD}> table" ></a>
<a href="field.php?op=list&amp;mid=<{$table.mid}>&amp;tableid=<{$table.id}>" title="<{$smarty.const._AM_WGFAKER_LIST_FIELD}>"><img src="<{$wgfaker_icons_url_16}>fields.png" alt="<{$smarty.const._AM_WGFAKER_LIST_FIELD}> table" ></a>
<a href="table.php?op=edit&amp;id=<{$table.id}>&amp;start=<{$start}>&amp;limit=<{$limit}>" title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._EDIT}> table" ></a>
<a href="table.php?op=delete&amp;id=<{$table.id}>" title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" alt="<{$smarty.const._DELETE}> table" ></a>
</td>
Expand Down

0 comments on commit 4df9c8f

Please sign in to comment.