aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application')
-rw-r--r--h-source/Application/Controllers/ModeratorsController.php2
-rw-r--r--h-source/Application/Include/myFunctions.php42
-rw-r--r--h-source/Application/Views/Issues/view.php1
-rw-r--r--h-source/Application/Views/Moderators/index.php2
-rw-r--r--h-source/Application/Views/talk.php1
5 files changed, 44 insertions, 4 deletions
diff --git a/h-source/Application/Controllers/ModeratorsController.php b/h-source/Application/Controllers/ModeratorsController.php
index f7a5737..2f4123f 100644
--- a/h-source/Application/Controllers/ModeratorsController.php
+++ b/h-source/Application/Controllers/ModeratorsController.php
@@ -41,8 +41,6 @@ class ModeratorsController extends BaseController
{
$this->shift(1);
- Params::$nullQueryValue = 'undef';
-
$this->s['registered']->check('moderator');
$whereClauseArray = array(
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index cf1708f..e182690 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -307,7 +307,7 @@ function gtext($string)
{
return Lang::$i18n[Lang::$current][$string];
}
- return $string;
+ return $string;
}
//rewrite the vendor name
@@ -322,3 +322,43 @@ function betterVendor($string)
return (array_key_exists($string,$names)) ? $names[$string] : $string;
}
+
+//get the hardware info from the talk id
+function getHardwareInfoFromTalkId($id = 0)
+{
+ $clean['id'] = (int)$id;
+ $talk = new TalkModel();
+ $res = $talk->select('hardware.type,hardware.id_hard')->from('hardware inner join talk')->using('id_hard')->where(array('id_talk'=>$clean['id']))->send();
+ return $res[0]['hardware'];
+}
+
+//get the issue info from the message id
+function getIssueNumberFromMessageId($id = 0)
+{
+ $clean['id'] = (int)$id;
+ $mess = new MessagesModel();
+ $res = $mess->select('issues.id_issue')->from('issues inner join messages')->using('id_issue')->where(array('id_mes'=>$clean['id']))->toList('issues.id_issue')->send();
+ return $res[0];
+}
+
+//return the URL to the moderated object page
+function goToModeratedItem( $row = array() )
+{
+ $url = null;
+
+ switch ($row['type'])
+ {
+ case 'message':
+ $url = 'issues/view/'.Lang::$current.'/'.getIssueNumberFromMessageId($row['id']).'#message-'.$row['id'];
+ break;
+ case 'talk':
+ $hardInfo = getHardwareInfoFromTalkId($row['id']);
+ $controller = MyStrings::$reverse[$hardInfo['type']];
+ $url = $controller.'/talk/'.Lang::$current.'/'.$hardInfo['id_hard'].'#talk-'.$row['id'];
+ break;
+ case 'user':
+ $url = 'meet/user/'.Lang::$current.'/'.getUserName($row['id']);
+ break;
+ }
+ return 'http://'.DOMAIN_NAME.'/'.$url;
+}
diff --git a/h-source/Application/Views/Issues/view.php b/h-source/Application/Views/Issues/view.php
index 906cf0d..1575d23 100644
--- a/h-source/Application/Views/Issues/view.php
+++ b/h-source/Application/Views/Issues/view.php
@@ -133,6 +133,7 @@
<?php } else { ?>
<?php if ($ismoderator) { ?>
+ <a name="message-<?php echo $row['messages']['id_mes'];?>"></a>
<div class="issues_message_item_hidden">
<?php echo gtext("this message has been deleted");?>
diff --git a/h-source/Application/Views/Moderators/index.php b/h-source/Application/Views/Moderators/index.php
index 7594695..7bbe3f3 100644
--- a/h-source/Application/Views/Moderators/index.php
+++ b/h-source/Application/Views/Moderators/index.php
@@ -43,7 +43,7 @@
<?php foreach ($table as $row) { ?>
<tr class="listRow">
<td class="simpleText">
- <span class='textItem'><?php echo $row['history']['id_history'];?></span>
+ <span class='textItem'><a href="<?php echo goToModeratedItem($row['history']);?>"><?php echo $row['history']['id_history'];?></a></span>
</td>
<td class="simpleText">
<span class='textItem'><?php echo $u->getUser($row['history']['created_by']);?></span>
diff --git a/h-source/Application/Views/talk.php b/h-source/Application/Views/talk.php
index 1cb549e..c251080 100644
--- a/h-source/Application/Views/talk.php
+++ b/h-source/Application/Views/talk.php
@@ -71,6 +71,7 @@
<?php } else { ?>
<?php if ($ismoderator) { ?>
+ <a name="talk-<?php echo $message['talk']['id_talk'];?>"></a>
<div class="talk_message_item_hidden">
this message has been deleted