Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Request View
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Nexus
|
||||
* @since 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -140,7 +139,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
}
|
||||
|
||||
/* Init buttons */
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
$requestActions = array(
|
||||
'status' => array(
|
||||
'icon' => 'tag',
|
||||
'title' => $this->request->status->_title,
|
||||
@@ -165,21 +164,6 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
'data' => array( 'role' => 'departmentMenu', 'controller' => 'nexus.admin.support.metamenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_department')
|
||||
),
|
||||
'staff' => array(
|
||||
'icon' => 'user',
|
||||
'title' => $this->request->staff ? $this->request->staff->name : 'unassigned',
|
||||
'menu' => array(),
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'controller' => 'nexus.admin.support.metamenu', 'role' => 'staffMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_staff')
|
||||
),
|
||||
'purchase' => array(
|
||||
'icon' => 'cube',
|
||||
'title' => 'associate_purchase',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'associate' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('associate'), 'ipsDialog-size' => 'narrow', 'role' => 'associatePurchaseMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_purchase')
|
||||
),
|
||||
'track' => array(
|
||||
'icon' => 'bookmark',
|
||||
'title' => $trackLang,
|
||||
@@ -203,22 +187,21 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'role' => 'trackMenu', 'controller' => 'nexus.admin.support.metamenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_tracking')
|
||||
)
|
||||
),
|
||||
'staff' => array(
|
||||
'icon' => 'user',
|
||||
'title' => $this->request->staff ? $this->request->staff->name : 'unassigned',
|
||||
'menu' => array(),
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'controller' => 'nexus.admin.support.metamenu', 'role' => 'staffMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_staff')
|
||||
),
|
||||
);
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_delete' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'delete' ),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
/* Populate statuses */
|
||||
foreach ( Support\Status::roots() as $status )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['status']['menu'][] = array(
|
||||
$requestActions['status']['menu'][] = array(
|
||||
'class' => $status->id === $this->request->status->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $status->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'status', 'status' => $status->id ) )
|
||||
@@ -234,7 +217,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
{
|
||||
foreach ( Support\Severity::roots() as $severity )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => $severity->id === $this->request->severity->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $severity->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'severity', 'severity' => $severity->id ) ),
|
||||
@@ -244,14 +227,14 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
|
||||
if ( $this->request->member and \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_block_sev' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array( 'hr' => TRUE );
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array( 'hr' => TRUE );
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => !$this->request->author()->cm_no_sev ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'cm_no_sev_off', FALSE, array( 'sprintf' => array( $this->request->supportAuthor()->name() ) ) ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'noSev', 'no_sev' => 0 ) ),
|
||||
'data' => array( 'group' => 'no_sev', 'noSet' => 'true' ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => $this->request->author()->cm_no_sev ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'cm_no_sev_on', FALSE, array( 'sprintf' => array( $this->request->supportAuthor()->name() ) ) ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'noSev', 'no_sev' => 1 ) ),
|
||||
@@ -263,7 +246,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
/* Populate departments */
|
||||
foreach ( Support\Department::roots() as $department )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['department']['menu'][] = array(
|
||||
$requestActions['department']['menu'][] = array(
|
||||
'class' => $department->id === $this->request->department->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $department->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'department', 'department' => $department->id ) )
|
||||
@@ -273,34 +256,56 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
/* Populate staff */
|
||||
foreach ( Support\Request::staff() as $id => $name )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => ( $this->request->staff and $id === $this->request->staff->member_id ) ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $name,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staff', 'staff' => $id ) ),
|
||||
'data' => array( 'group' => 'staff', 'id' => $id ),
|
||||
);
|
||||
}
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => !$this->request->staff ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => 'unassigned',
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staff', 'staff' => 0 ) ),
|
||||
'data' => array( 'group' => 'staff', 'id' => 0 ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array( 'hr' => TRUE );
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array( 'hr' => TRUE );
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => $this->request->staff_lock ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'request_staff_lock_on' ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staffLock', 'lock' => 1 ) ),
|
||||
'data' => array( 'group' => 'staff_lock', 'noSet' => 'true' ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => !$this->request->staff_lock ? 'ipsMenu_itemChecked' : '',
|
||||
'title' =>\IPS\Member::loggedIn()->language()->addToStack( 'request_staff_lock_off' ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staffLock', 'lock' => 0 ) ),
|
||||
'data' => array( 'group' => 'staff_lock', 'noSet' => 'true' ),
|
||||
);
|
||||
|
||||
/* Regular actions */
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_delete' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'delete' ),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
\IPS\Output::i()->sidebar['actions']['purchase'] = array(
|
||||
'icon' => 'cube',
|
||||
'title' => 'associate_purchase',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'associate' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('associate'), 'ipsDialog-size' => 'narrow', 'role' => 'associatePurchaseMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_purchase')
|
||||
);
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->request( $this->request, $requestActions );
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->customHeader = \IPS\Theme::i()->getTemplate( 'support' )->requestHeader( $this->request );
|
||||
\IPS\Output::i()->title = "#{$this->request->id} " . $this->request->mapped('title');
|
||||
\IPS\Output::i()->showTitle = FALSE;
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_support.js', 'nexus', 'admin' ) );
|
||||
@@ -498,7 +503,11 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Discard the message and any related changes */
|
||||
$url = $message->item()->acpUrl();
|
||||
$message->delete();
|
||||
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->department ) and \IPS\Request::i()->department != -1 )
|
||||
@@ -944,6 +953,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
{
|
||||
$request = Support\Request::loadAndCheckPerms( \IPS\Request::i()->id );
|
||||
$request->mergeIn( array( Support\Request::loadAndCheckPerms( \IPS\Request::i()->merge ) ) ) ;
|
||||
$request->log( 'merge', 0, 0 );
|
||||
\IPS\Output::i()->redirect( $request->acpUrl() );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
|
||||
Reference in new issue
Block a user