Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -98,17 +98,19 @@ class _view extends \IPS\Content\Controller
\IPS\Output::i()->error( 'node_error', '2X209/1', 404, '' );
}
$existingRating = NULL;
/* If we've rated, do not allow us to rate again */
try
{
$existingRating = \IPS\Db::i()->select( '*', 'nexus_support_ratings', array( 'rating_reply=?', $reply->id ) )->first();
\IPS\Db::i()->select( '*', 'nexus_support_ratings', array( 'rating_reply=?', $reply->id ) )->first();
\IPS\Output::i()->error( 'already_rated', '2X204/2', 403, '' );
}
catch ( \UnderflowException $e ) {}
$form = new \IPS\Helpers\Form( 'feedback', 'send_feedback' );
$form->class = 'ipsForm_vertical';
$form->add( new \IPS\Helpers\Form\Rating( 'support_rating_rating', \IPS\Request::i()->rating, TRUE ) );
$form->add( new \IPS\Helpers\Form\TextArea( 'support_rating_feedback', $existingRating ? $existingRating['rating_note'] : NULL, FALSE ) );
$form->add( new \IPS\Helpers\Form\TextArea( 'support_rating_feedback', NULL, FALSE ) );
if ( $values = $form->values() )
{
$save = array(
@@ -119,16 +121,9 @@ class _view extends \IPS\Content\Controller
'rating_note' => $values['support_rating_feedback'],
'rating_date' => time()
);
if ( $existingRating )
{
\IPS\Db::i()->update( 'nexus_support_ratings', $save, array( 'rating_reply=?', $reply->id ) );
}
else
{
\IPS\Db::i()->insert( 'nexus_support_ratings', $save );
}
\IPS\Db::i()->insert( 'nexus_support_ratings', $save );
if ( \IPS\Request::i()->isAjax() )
{
$reply->ratingData = $save;