Merge branch 'master' of github.com:opensupports/opensupports
This commit is contained in:
commit
0bfb36afd6
|
@ -1,6 +1,6 @@
|
|||

|
||||
|
||||
[](https://travis-ci.org/opensupports/opensupports) v4.4.0
|
||||
[](https://travis-ci.org/opensupports/opensupports) v4.5.0
|
||||
|
||||
OpenSupports is an open source ticket system built primarily with PHP and ReactJS.
|
||||
Please, visit our website for more information: [http://www.opensupports.com/](http://www.opensupports.com/)
|
||||
|
|
21
build.sh
21
build.sh
|
@ -12,17 +12,18 @@ rm -rf files/
|
|||
mv files2 files
|
||||
cd ..
|
||||
mkdir api
|
||||
cp server/index.php api
|
||||
cp server/.htaccess api
|
||||
cp server/composer.json api
|
||||
cp server/composer.lock api
|
||||
cp server/controllers api
|
||||
cp server/data api
|
||||
cp server/libs api
|
||||
cp server/models api
|
||||
cp server/vendor api
|
||||
cp server/files api
|
||||
mv server/index.php api
|
||||
mv server/.htaccess api
|
||||
mv server/composer.json api
|
||||
mv server/composer.lock api
|
||||
mv server/controllers api
|
||||
mv server/data api
|
||||
mv server/libs api
|
||||
mv server/models api
|
||||
mv server/vendor api
|
||||
mv server/files api
|
||||
cp server/config.php api
|
||||
chmod -R 755 .
|
||||
cp client/src/index.php client/build
|
||||
echo "3/3 Generating zip..."
|
||||
cd client/build
|
||||
|
|
|
@ -117,7 +117,7 @@ class TicketEvent extends React.Component {
|
|||
return (
|
||||
<div className="ticket-event__comment-content">
|
||||
<div dangerouslySetInnerHTML={{__html: this.props.content}}></div>
|
||||
{((this.props.author.id === this.props.userId) || (this.props.userStaff)) ? this.renderEditIcon() : null}
|
||||
{((this.props.author.id == this.props.userId && this.props.author.staff == this.props.userStaff) || this.props.userStaff) ? this.renderEditIcon() : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -69,7 +69,6 @@ class TicketViewer extends React.Component {
|
|||
|
||||
render() {
|
||||
const ticket = this.props.ticket;
|
||||
|
||||
return (
|
||||
<div className="ticket-viewer">
|
||||
<div className="ticket-viewer__header row">
|
||||
|
@ -605,6 +604,7 @@ class TicketViewer extends React.Component {
|
|||
}
|
||||
|
||||
export default connect((store) => {
|
||||
|
||||
return {
|
||||
userId: store.session.userId,
|
||||
userStaff: store.session.staff,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
opensupports_version = '4.4.0';
|
||||
opensupports_version = '4.5.0';
|
||||
root = 'http://localhost:3000';
|
||||
apiRoot = 'http://localhost:3000/api';
|
||||
globalIndexPath = '';
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div id="app"></div>
|
||||
|
||||
<script>
|
||||
opensupports_version = '4.4.0';
|
||||
opensupports_version = '4.5.0';
|
||||
root = "<?=$url ?>";
|
||||
apiRoot = '<?=$url ?>/api';
|
||||
globalIndexPath = "<?=$path ?>";
|
||||
|
|
|
@ -77,7 +77,8 @@ class SessionReducer extends Reducer {
|
|||
logged: true,
|
||||
pending: false,
|
||||
failed: false,
|
||||
userId: payload.data.userId
|
||||
userId: payload.data.userId,
|
||||
staff: payload.data.staff
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -94,6 +95,7 @@ class SessionReducer extends Reducer {
|
|||
sessionStore.storeRememberData({
|
||||
token: resultData.rememberToken,
|
||||
userId: resultData.userId,
|
||||
staff: resultData.staff,
|
||||
expiration: resultData.rememberExpiration
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "OpenSupports API Documentation",
|
||||
"version": "4.4.0",
|
||||
"version": "4.5.0",
|
||||
"title": "OpenSupports API Documentation",
|
||||
"description": "Backend API documentation for developers.",
|
||||
"header": {
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/add-topic Add topic
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add topic
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/add Add article
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add article
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/delete-topic Delete topic
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete topic
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/delete Delete article
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete article
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/edit-topic Edit topic
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit topic
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/edit Edit article
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit a article
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /article/get-all Get all articles
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get all articles
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /staff/add Add staff
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add staff
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /staff/assign-ticket Assign ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Assign ticket
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/delete Delete staff
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete staff
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/edit Edit staff
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit staff
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/get-all-tickets Get all tickets according to search
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get all tickets
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/get-all Get all staffs
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get all staffs
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/get-new-tickets Get new tickets
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get new tickets
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/get-tickets Get tickets
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get tickets
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /staff/get Get staff
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get staff
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/last-events Get last events
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get last events
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /staff/search-tickets Search tickets
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Search tickets
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /staff/un-assign-ticket Un-assign ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Un-assign ticket
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/add-api-key Add APIKey
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add APIKey
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/add-custom-field Add a custom field
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add Custom field
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/add-department Add department
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add department
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Ifsnop\Mysqldump as IMysqldump;
|
|||
|
||||
/**
|
||||
* @api {post} /system/backup-database Backup database
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Backup database
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/check-requirements Checks requirements
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Check requirements
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/csv-import CSV import
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName CSV import
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /system/delete-all-users Delete all users
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete all users
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/delete-api-key Delete APIKey
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete APIKey
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/delete-custom-field Delete custom field
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete a custom field
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /system/delete-department Delete department
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete department
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/disable-registration Disable registration
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Disable registration
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/disable-user-system Disable user system
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Disable user system
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {get} /system/download Download file
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Download file
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /system/edit-department Edit department
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit department
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/edit-mail-template Edit mail template
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit mail template
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/edit-settings Edit settings
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit settings
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/enable-registration Enable registration
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Enable registration
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/enable-user-system Enable user system
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Enable user system
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-api-keys Get APIKeys
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get APIKeys
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-custom-fields Get custom fields
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get all Custom field items
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-logs Get logs
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get logs
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-mail-template-list Get mail template
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get mail template list
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-mail-template Get mail template
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get mail template
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-settings Get settings
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get settings
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /system/get-stats Get stats
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get stats
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /system/init-admin Init admin
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Init admin
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /system/init-database Init database
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Init database
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /system/init-settings Init settings
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Init settings
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /system/installation-done Installation done
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Installation done
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/recover-mail-template Recover mail template
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Recover mail template
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /system/test-imap Test IMAP Connection
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Test IMAP Connection
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /system/test-smtp Test SMTP Connection
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Test SMTP Connection
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/add-custom-response Add custom responses
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add a custom response
|
||||
*
|
||||
|
@ -55,7 +55,7 @@ class AddCustomResponseController extends Controller {
|
|||
$customResponse = new CustomResponse();
|
||||
$customResponse->setProperties([
|
||||
'name' => Controller::request('name'),
|
||||
'content' => Controller::request('content'),
|
||||
'content' => Controller::request('content', true),
|
||||
'language' => Controller::request('language')
|
||||
]);
|
||||
$customResponse->store();
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/add-tag Add tag
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Add tag
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/change-department Change department
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Change department
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/change-priority Change priority
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Change priority
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/check Check ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Check ticket
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/close Close ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Close
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/comment Comment ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Comment ticket
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/create-tag Create tag
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Create tag
|
||||
*
|
||||
|
@ -36,6 +36,10 @@ class CreateTagController extends Controller {
|
|||
'name' => [
|
||||
'validation' => DataValidator::length(2, 100),
|
||||
'error' => ERRORS::INVALID_NAME
|
||||
],
|
||||
'color' => [
|
||||
'validation' => DataValidator::hexRgbColor()->startsWith('#'),
|
||||
'error' => ERRORS::INVALID_COLOR
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/create Create ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Create ticket
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/delete-custom-response Delete custom response
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete custom response
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/delete-tag Delete a tag
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete tag
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/delete Delete a ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete ticket
|
||||
*
|
||||
|
|
|
@ -4,22 +4,22 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/edit-comment Edit a comment
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit comment
|
||||
*
|
||||
* @apiGroup Ticket
|
||||
*
|
||||
* @apiDescription This path edit a comment.
|
||||
* @apiDescription This path edits a comment.
|
||||
*
|
||||
* @apiPermission user
|
||||
*
|
||||
* @apiParam {String} content The new content of the comment.
|
||||
* @apiParam {Number} ticketEventId The id of the ticket event.
|
||||
* @apiParam {Number} ticketNumber The id of the ticket number.
|
||||
* @apiParam {Number} ticketNumber The number of the ticket.
|
||||
*
|
||||
* @apiUse NO_PERMISSION
|
||||
* @apiUse INVALID_CONENT
|
||||
* @apiUse INVALID_CONTENT
|
||||
*
|
||||
* @apiSuccess {Object} data Empty object
|
||||
*
|
||||
|
@ -43,7 +43,7 @@ class EditCommentController extends Controller {
|
|||
|
||||
public function handler() {
|
||||
$user = Controller::getLoggedUser();
|
||||
$newcontent = Controller::request('content');
|
||||
$newcontent = Controller::request('content', true);
|
||||
$ticketNumberLog = null;
|
||||
|
||||
$ticketevent = Ticketevent::getTicketEvent(Controller::request('ticketEventId'));
|
||||
|
@ -69,7 +69,7 @@ class EditCommentController extends Controller {
|
|||
$ticketevent->content = $newcontent;
|
||||
$ticketevent->editedContent = true;
|
||||
$ticketevent->store();
|
||||
}else{
|
||||
} else {
|
||||
$ticketNumber = $ticket->ticketNumber;
|
||||
|
||||
$ticket->content = $newcontent;
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/edit-custom-response Edit custom response
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit custom response
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/edit-tag Edit tag
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit tag
|
||||
*
|
||||
|
@ -37,6 +37,10 @@ class EditTagController extends Controller {
|
|||
'tagId' => [
|
||||
'validation' => DataValidator::dataStoreId('tag'),
|
||||
'error' => ERRORS::INVALID_TAG
|
||||
],
|
||||
'color' => [
|
||||
'validation' => DataValidator::hexRgbColor()->startsWith('#'),
|
||||
'error' => ERRORS::INVALID_COLOR
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/get-custom-responses Get custom responses
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get custom responses
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/get-tags Get tags
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get tags
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
DataValidator::with('CustomValidations', true);
|
||||
/**
|
||||
* @api {post} /ticket/get Get ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get ticket
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/re-open Reopen ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Reopen ticket
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/remove-tag Remove tag
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Remove tag
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /ticket/seen See ticket
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName See ticket
|
||||
*
|
||||
|
@ -44,7 +44,7 @@ class SeenController extends Controller {
|
|||
$user = Controller::getLoggedUser();
|
||||
$ticket = Ticket::getByTicketNumber($ticketnumber);
|
||||
|
||||
if(!$user->canManageTicket($this->ticket) && !$ticket->isAuthor($user)) {
|
||||
if(!$user->canManageTicket($ticket) && !$ticket->isAuthor($user)) {
|
||||
throw new RequestException(ERRORS::NO_PERMISSION);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/ban Ban email
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Ban email
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @api {post} /user/check-session Check session
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Check session
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /user/delete Delete user
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Delete user
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/disable Ban email
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Disable User
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/edit-custom-fields Edit custom field values
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit custom field values
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/edit-email Edit email
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit email
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/edit-password Edit password
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Edit password
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/enable Ban email
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Enable User
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /user/get-user Get user information
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get user information
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/get-users Get users list
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get users list
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /user/get Get my information
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get my Information
|
||||
*
|
||||
|
@ -54,6 +54,7 @@ class GetUserController extends Controller {
|
|||
Response::respondSuccess([
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
'staff' => false,
|
||||
'verified' => !$user->verificationToken,
|
||||
'tickets' => $parsedTicketList,
|
||||
'customfields' => $user->xownCustomfieldvalueList->toArray(),
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/list-ban Get ban list
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Get ban list
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
/**
|
||||
* @api {post} /user/login Login
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Login
|
||||
*
|
||||
|
@ -108,7 +108,7 @@ class LoginController extends Controller {
|
|||
return array(
|
||||
'userId' => $userInstance->id,
|
||||
'userEmail' => $userInstance->email,
|
||||
'staff' => Controller::request('staff'),
|
||||
'staff' => !!Controller::request('staff'),
|
||||
'token' => Session::getInstance()->getToken(),
|
||||
'rememberToken' => $this->rememberToken,
|
||||
'rememberExpiration' => $this->rememberExpiration
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @api {post} /user/logout Log out
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Log out
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /user/recover-password Recover password
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Recover password
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /user/send-recover-password Send password recovery
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Send password recovery
|
||||
*
|
||||
|
|
|
@ -5,7 +5,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
/**
|
||||
* @api {post} /user/signup Sign up
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Sign up
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/un-ban Un ban
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Un ban
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
/**
|
||||
* @api {post} /user/verify Verify email
|
||||
* @apiVersion 4.4.0
|
||||
* @apiVersion 4.5.0
|
||||
*
|
||||
* @apiName Verify email
|
||||
*
|
||||
|
|
|
@ -247,6 +247,10 @@
|
|||
* @apiDefine UNAVAILABLE_STATS
|
||||
* @apiError {String} UNAVAILABLE_STATS Stats are currently unavailable
|
||||
*/
|
||||
/**
|
||||
* @apiDefine INVALID_COLOR
|
||||
* @apiError {String} INVALID_COLOR The color should be in hexadecimal, preceded by a '#'
|
||||
*/
|
||||
|
||||
class ERRORS {
|
||||
const INVALID_CREDENTIALS = 'INVALID_CREDENTIALS';
|
||||
|
@ -312,4 +316,5 @@ class ERRORS {
|
|||
const INVALID_CUSTOM_FIELD_OPTIONS = 'INVALID_CUSTOM_FIELD_OPTIONS';
|
||||
const INVALID_CUSTOM_FIELD_OPTION = 'INVALID_CUSTOM_FIELD_OPTION';
|
||||
const UNAVAILABLE_STATS = 'UNAVAILABLE_STATS';
|
||||
const INVALID_COLOR = 'INVALID_COLOR';
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue