mirror of
https://github.com/opensupports/opensupports.git
synced 2025-08-31 06:38:32 +02:00
Merge branch 'master' into OS131-Path-system-edit-settings
This commit is contained in:
commit
8aaca982d6
@ -33,4 +33,4 @@ module.exports = {
|
||||
|
||||
'buildDir': './build/'
|
||||
|
||||
};
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ export default {
|
||||
|
||||
updateData() {
|
||||
return {
|
||||
type: 'UPDATE_DEPARTMENTS',
|
||||
type: 'UPDATE_DATA',
|
||||
payload: API.call({
|
||||
path: '/system/get-settings',
|
||||
data: {}
|
||||
|
@ -114,4 +114,4 @@ class PeopleList extends React.Component {
|
||||
|
||||
}
|
||||
|
||||
export default PeopleList;
|
||||
export default PeopleList;
|
||||
|
@ -2,6 +2,8 @@ import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import i18n from 'lib-app/i18n';
|
||||
|
||||
import DateTransformer from 'lib-core/date-transformer';
|
||||
import Icon from 'core-components/icon';
|
||||
|
||||
class TicketEvent extends React.Component {
|
||||
@ -80,7 +82,7 @@ class TicketEvent extends React.Component {
|
||||
<span className="ticket-event__comment-author-name">{this.props.author.name}</span>
|
||||
<span className="ticket-event__comment-author-type">({i18n((this.props.author.staff) ? 'STAFF' : 'CUSTOMER')})</span>
|
||||
</div>
|
||||
<div className="ticket-event__comment-date">{this.props.date}</div>
|
||||
<div className="ticket-event__comment-date">{DateTransformer.transformToString(this.props.date)}</div>
|
||||
<div className="ticket-event__comment-content" dangerouslySetInnerHTML={{__html: this.props.content}}></div>
|
||||
{this.renderFileRow(this.props.file)}
|
||||
</div>
|
||||
@ -92,7 +94,7 @@ class TicketEvent extends React.Component {
|
||||
<div className="ticket-event__circled">
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> assigned this ticket</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@ -102,7 +104,7 @@ class TicketEvent extends React.Component {
|
||||
<div className="ticket-event__circled">
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> unassigned this ticket</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@ -112,7 +114,7 @@ class TicketEvent extends React.Component {
|
||||
<div className="ticket-event__circled">
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> closed this ticket</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@ -122,7 +124,7 @@ class TicketEvent extends React.Component {
|
||||
<div className="ticket-event__circled">
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> reopen this ticket</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -133,7 +135,7 @@ class TicketEvent extends React.Component {
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> change department to</span>
|
||||
<span className="ticket-event__circled-indication"> {this.props.content}</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -144,7 +146,7 @@ class TicketEvent extends React.Component {
|
||||
<span className="ticket-event__circled-author">{this.props.author.name}</span>
|
||||
<span className="ticket-event__circled-text"> change priority to</span>
|
||||
<span className="ticket-event__circled-indication"> {this.props.content}</span>
|
||||
<span className="ticket-event__circled-date"> on {this.props.date}</span>
|
||||
<span className="ticket-event__circled-date"> on {DateTransformer.transformToString(this.props.date)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -225,4 +227,4 @@ class TicketEvent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default TicketEvent;
|
||||
export default TicketEvent;
|
||||
|
@ -64,7 +64,7 @@ class TicketList extends React.Component {
|
||||
size: 'medium'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
getTableProps() {
|
||||
return {
|
||||
loading: this.props.loading,
|
||||
@ -177,7 +177,7 @@ class TicketList extends React.Component {
|
||||
priority: this.getTicketPriority(ticket.priority),
|
||||
department: ticket.department.name,
|
||||
author: ticket.author.name,
|
||||
date: DateTransformer.transformToString(ticket.date),
|
||||
date: DateTransformer.transformToString(ticket.date, false),
|
||||
unread: this.isTicketUnread(ticket),
|
||||
highlighted: this.isTicketUnread(ticket)
|
||||
};
|
||||
|
@ -8,6 +8,7 @@ import SessionStore from 'lib-app/session-store';
|
||||
|
||||
import TicketEvent from 'app-components/ticket-event';
|
||||
import AreYouSure from 'app-components/are-you-sure';
|
||||
import DateTransformer from 'lib-core/date-transformer';
|
||||
import Form from 'core-components/form';
|
||||
import FormField from 'core-components/form-field';
|
||||
import SubmitButton from 'core-components/submit-button';
|
||||
@ -88,7 +89,7 @@ class TicketViewer extends React.Component {
|
||||
onChange={this.onDepartmentDropdownChanged.bind(this)} />
|
||||
</div>
|
||||
<div className="col-md-4">{ticket.author.name}</div>
|
||||
<div className="col-md-4">{ticket.date}</div>
|
||||
<div className="col-md-4">{DateTransformer.transformToString(ticket.date)}</div>
|
||||
</div>
|
||||
<div className="ticket-viewer__info-row-header row">
|
||||
<div className="col-md-4">{i18n('PRIORITY')}</div>
|
||||
@ -132,7 +133,7 @@ class TicketViewer extends React.Component {
|
||||
<div className="ticket-viewer__info-row-values row">
|
||||
<div className="ticket-viewer__department col-md-4">{ticket.department.name}</div>
|
||||
<div className="ticket-viewer__author col-md-4">{ticket.author.name}</div>
|
||||
<div className="ticket-viewer__date col-md-4">{ticket.date}</div>
|
||||
<div className="ticket-viewer__date col-md-4">{DateTransformer.transformToString(ticket.date, false)}</div>
|
||||
</div>
|
||||
<div className="ticket-viewer__info-row-header row">
|
||||
<div className="ticket-viewer__department col-md-4">{i18n('PRIORITY')}</div>
|
||||
@ -317,7 +318,7 @@ class TicketViewer extends React.Component {
|
||||
this.setState({
|
||||
loading: false
|
||||
});
|
||||
|
||||
|
||||
this.onTicketModification();
|
||||
}
|
||||
|
||||
@ -326,7 +327,7 @@ class TicketViewer extends React.Component {
|
||||
loading: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
onTicketModification() {
|
||||
if (this.props.onChange) {
|
||||
this.props.onChange();
|
||||
@ -334,4 +335,4 @@ class TicketViewer extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default TicketViewer;
|
||||
export default TicketViewer;
|
||||
|
@ -6,6 +6,17 @@ import { browserHistory } from 'react-router';
|
||||
|
||||
import ModalContainer from 'app-components/modal-container';
|
||||
|
||||
const level2Paths = [
|
||||
'/admin/panel/tickets/custom-responses',
|
||||
'/admin/panel/users',
|
||||
'/admin/panel/articles'
|
||||
];
|
||||
|
||||
const level3Paths = [
|
||||
'/admin/panel/staff',
|
||||
'/admin/panel/settings'
|
||||
];
|
||||
|
||||
class App extends React.Component {
|
||||
static contextTypes = {
|
||||
router: React.PropTypes.object,
|
||||
@ -66,6 +77,25 @@ class App extends React.Component {
|
||||
} else if(validations.loggedInStaff) {
|
||||
browserHistory.push('/admin/panel');
|
||||
}
|
||||
|
||||
if (this.props.session.userLevel && !this.isPathAvailableForStaff()) {
|
||||
browserHistory.push('/admin/panel');
|
||||
}
|
||||
}
|
||||
|
||||
isPathAvailableForStaff() {
|
||||
let pathForLevel2 = _.findIndex(level2Paths, path => _.includes(this.props.location.pathname, path)) !== -1;
|
||||
let pathForLevel3 = _.findIndex(level3Paths, path => _.includes(this.props.location.pathname, path)) !== -1;
|
||||
|
||||
if (this.props.session.userLevel === 1) {
|
||||
return !pathForLevel2 && !pathForLevel3;
|
||||
}
|
||||
|
||||
if (this.props.session.userLevel === 2) {
|
||||
return !pathForLevel3;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
import {connect} from 'react-redux';
|
||||
|
||||
import {dispatch} from 'app/store';
|
||||
import i18n from 'lib-app/i18n';
|
||||
@ -90,113 +91,142 @@ class AdminPanelMenu extends React.Component {
|
||||
}
|
||||
|
||||
getRoutes() {
|
||||
return [
|
||||
return this.getItemsByFilteredByLevel([
|
||||
{
|
||||
groupName: i18n('DASHBOARD'),
|
||||
path: '/admin/panel',
|
||||
icon: 'tachometer',
|
||||
items: [
|
||||
level: 1,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('TICKET_STATS'),
|
||||
path: '/admin/panel/stats'
|
||||
path: '/admin/panel/stats',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: i18n('LAST_ACTIVITY'),
|
||||
path: '/admin/panel/activity'
|
||||
path: '/admin/panel/activity',
|
||||
level: 1
|
||||
}
|
||||
]
|
||||
])
|
||||
},
|
||||
{
|
||||
groupName: i18n('TICKETS'),
|
||||
path: '/admin/panel/tickets',
|
||||
icon: 'ticket',
|
||||
items: [
|
||||
level: 1,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('MY_TICKETS'),
|
||||
path: '/admin/panel/tickets/my-tickets'
|
||||
path: '/admin/panel/tickets/my-tickets',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: i18n('NEW_TICKETS'),
|
||||
path: '/admin/panel/tickets/new-tickets'
|
||||
path: '/admin/panel/tickets/new-tickets',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: i18n('ALL_TICKETS'),
|
||||
path: '/admin/panel/tickets/all-tickets'
|
||||
path: '/admin/panel/tickets/all-tickets',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: i18n('CUSTOM_RESPONSES'),
|
||||
path: '/admin/panel/tickets/custom-responses'
|
||||
path: '/admin/panel/tickets/custom-responses',
|
||||
level: 2
|
||||
}
|
||||
]
|
||||
])
|
||||
},
|
||||
{
|
||||
groupName: i18n('USERS'),
|
||||
path: '/admin/panel/users',
|
||||
icon: 'user',
|
||||
items: [
|
||||
level: 1,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('LIST_USERS'),
|
||||
path: '/admin/panel/users/list-users'
|
||||
path: '/admin/panel/users/list-users',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: i18n('BAN_USERS'),
|
||||
path: '/admin/panel/users/ban-users'
|
||||
path: '/admin/panel/users/ban-users',
|
||||
level: 1
|
||||
}
|
||||
]
|
||||
])
|
||||
},
|
||||
{
|
||||
groupName: i18n('ARTICLES'),
|
||||
path: '/admin/panel/articles',
|
||||
icon: 'book',
|
||||
items: [
|
||||
level: 2,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('LIST_ARTICLES'),
|
||||
path: '/admin/panel/articles/list-articles'
|
||||
path: '/admin/panel/articles/list-articles',
|
||||
level: 2
|
||||
}
|
||||
]
|
||||
])
|
||||
},
|
||||
{
|
||||
|
||||
groupName: i18n('STAFF'),
|
||||
path: '/admin/panel/staff',
|
||||
icon: 'users',
|
||||
items: [
|
||||
level: 3,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('STAFF_MEMBERS'),
|
||||
path: '/admin/panel/staff/staff-members'
|
||||
path: '/admin/panel/staff/staff-members',
|
||||
level: 3
|
||||
},
|
||||
{
|
||||
name: i18n('DEPARTMENTS'),
|
||||
path: '/admin/panel/staff/departments'
|
||||
path: '/admin/panel/staff/departments',
|
||||
level: 3
|
||||
}
|
||||
]
|
||||
])
|
||||
},
|
||||
{
|
||||
|
||||
groupName: i18n('SETTINGS'),
|
||||
path: '/admin/panel/settings',
|
||||
icon: 'cogs',
|
||||
items: [
|
||||
level: 3,
|
||||
items: this.getItemsByFilteredByLevel([
|
||||
{
|
||||
name: i18n('SYSTEM_PREFERENCES'),
|
||||
path: '/admin/panel/settings/system-preferences'
|
||||
path: '/admin/panel/settings/system-preferences',
|
||||
level: 3
|
||||
},
|
||||
{
|
||||
name: i18n('USER_SYSTEM'),
|
||||
path: '/admin/panel/settings/user-system'
|
||||
path: '/admin/panel/settings/user-system',
|
||||
level: 3
|
||||
},
|
||||
{
|
||||
name: i18n('EMAIL_TEMPLATES'),
|
||||
path: '/admin/panel/settings/email-templates'
|
||||
path: '/admin/panel/settings/email-templates',
|
||||
level: 3
|
||||
},
|
||||
{
|
||||
name: i18n('FILTERS_CUSTOM_FIELDS'),
|
||||
path: '/admin/panel/settings/custom-fields'
|
||||
path: '/admin/panel/settings/custom-fields',
|
||||
level: 3
|
||||
}
|
||||
]
|
||||
])
|
||||
}
|
||||
];
|
||||
]);
|
||||
}
|
||||
|
||||
getItemsByFilteredByLevel(items) {
|
||||
return (this.props.level) ? _.filter(items, route => this.props.level >= route.level) : items;
|
||||
}
|
||||
}
|
||||
|
||||
export default AdminPanelMenu;
|
||||
export default connect((store) => {
|
||||
return {
|
||||
level: store.session.userLevel
|
||||
};
|
||||
})(AdminPanelMenu);
|
@ -76,7 +76,7 @@ class AddStaffModal extends React.Component {
|
||||
email: form.email,
|
||||
password: form.password,
|
||||
level: form.level + 1,
|
||||
department: JSON.stringify(departments)
|
||||
departments: JSON.stringify(departments)
|
||||
}
|
||||
}).then(this.context.closeModal).catch((result) => {
|
||||
this.setState({
|
||||
|
@ -136,7 +136,7 @@ class AdminPanelDepartments extends React.Component {
|
||||
|
||||
if(this.state.selectedIndex !== -1) {
|
||||
API.call({
|
||||
path: '/staff/edit-department',
|
||||
path: '/system/edit-department',
|
||||
data: {
|
||||
departmentId: this.getCurrentDepartment().id,
|
||||
name: form.name
|
||||
@ -147,9 +147,9 @@ class AdminPanelDepartments extends React.Component {
|
||||
}).catch(this.onItemChange.bind(this, -1));
|
||||
} else {
|
||||
API.call({
|
||||
path: '/staff/add-department',
|
||||
path: '/system/add-department',
|
||||
data: {
|
||||
name: form.title
|
||||
name: form.name
|
||||
}
|
||||
}).then(() => {
|
||||
this.retrieveDepartments();
|
||||
@ -172,7 +172,7 @@ class AdminPanelDepartments extends React.Component {
|
||||
|
||||
deleteDepartment() {
|
||||
API.call({
|
||||
path: '/staff/delete-department',
|
||||
path: '/system/delete-department',
|
||||
data: {
|
||||
departmentId: this.getCurrentDepartment().id,
|
||||
transferDepartmentId: this.getDropDownItemId()
|
||||
|
@ -73,8 +73,8 @@ class StaffEditor extends React.Component {
|
||||
</Form>
|
||||
<span className="separator staff-editor__separator" />
|
||||
<Form className="staff-editor__update-password" onSubmit={this.onSubmit.bind(this)}>
|
||||
<FormField name="password" validation="PASSWORD" required label={i18n('PASSWORD')} fieldProps={{size: 'large'}}/>
|
||||
<FormField name="rpassword" validation="REPEAT_PASSWORD" required label={i18n('REPEAT_PASSWORD')} fieldProps={{size: 'large'}}/>
|
||||
<FormField name="password" validation="PASSWORD" required label={i18n('PASSWORD')} fieldProps={{size: 'large', password: true}}/>
|
||||
<FormField name="rpassword" validation="REPEAT_PASSWORD" required label={i18n('REPEAT_PASSWORD')} fieldProps={{size: 'large', password: true}}/>
|
||||
<SubmitButton size="medium" className="staff-editor__submit-button">{i18n('UPDATE_PASSWORD')}</SubmitButton>
|
||||
</Form>
|
||||
{(!this.props.myAccount) ? this.renderLevelForm() : null}
|
||||
@ -86,10 +86,7 @@ class StaffEditor extends React.Component {
|
||||
<div className="col-md-4">
|
||||
<div className="staff-editor__departments">
|
||||
<div className="staff-editor__departments-title">{i18n('Departments')}</div>
|
||||
<Form values={{departments: this.state.departments}} onChange={form => this.setState({departments: form.departments})} onSubmit={this.onSubmit.bind(this)}>
|
||||
<FormField name="departments" field="checkbox-group" fieldProps={{items: this.getDepartments()}} />
|
||||
<SubmitButton size="medium">{i18n('UPDATE_DEPARTMENTS')}</SubmitButton>
|
||||
</Form>
|
||||
{(!this.props.myAccount) ? this.renderDepartmentsForm() : this.renderDepartmentsInfo()}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-md-8">
|
||||
@ -118,6 +115,24 @@ class StaffEditor extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
renderDepartmentsForm() {
|
||||
return (
|
||||
<Form values={{departments: this.state.departments}} onChange={form => this.setState({departments: form.departments})} onSubmit={this.onSubmit.bind(this)}>
|
||||
<FormField name="departments" field="checkbox-group" fieldProps={{items: this.getDepartments()}} />
|
||||
<SubmitButton size="medium">{i18n('UPDATE_DEPARTMENTS')}</SubmitButton>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
renderDepartmentsInfo() {
|
||||
return (
|
||||
<Form values={{departments: this.state.departments}}>
|
||||
<FormField name="departments" field="checkbox-group" fieldProps={{items: this.getDepartments()}} />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
renderTickets() {
|
||||
return (
|
||||
<div>
|
||||
|
@ -96,7 +96,7 @@ class AdminPanelListUsers extends React.Component {
|
||||
{user.tickets}
|
||||
</span>
|
||||
),
|
||||
signupDate: DateTransformer.transformToString(user.signupDate)
|
||||
signupDate: DateTransformer.transformToString(user.signupDate, false)
|
||||
};
|
||||
}
|
||||
|
||||
@ -159,4 +159,4 @@ class AdminPanelListUsers extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default AdminPanelListUsers;
|
||||
export default AdminPanelListUsers;
|
||||
|
@ -61,6 +61,7 @@ class CheckBox extends React.Component {
|
||||
delete props.errored;
|
||||
delete props.label;
|
||||
delete props.value;
|
||||
delete props.wrapInLabel;
|
||||
|
||||
return props;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ $transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
&_horizontal {
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
|
||||
.menu__list {
|
||||
background-color: transparent;
|
||||
@ -98,6 +98,7 @@ $transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
.menu__list-item {
|
||||
text-align: center;
|
||||
background-color: white;
|
||||
color: $primary-black;
|
||||
cursor: pointer;
|
||||
|
@ -16,35 +16,35 @@ module.exports = [
|
||||
id: '1',
|
||||
title: 'Mannaging apps for your account',
|
||||
content: 'Curabitur sed dignissim turpis, sed lacinia urna. Vestibulum semper suscipit interdum. Proin sed sem gravida massa tristique rhoncus auctor eu diam. Donec fringilla in ex non dignissim. Praesent sed ultricies eros. Nullam vel augue eget libero volutpat sodales sit amet et orci.',
|
||||
lastEdited: 20160516,
|
||||
lastEdited: 201605161230,
|
||||
position: 1
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: 'How to assign new task and files',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150429,
|
||||
lastEdited: 201504291029,
|
||||
position: 2
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
title: 'Updating your profile picture',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150429,
|
||||
lastEdited: 201504291422,
|
||||
position: 3
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
title: 'Deleting your account',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150929,
|
||||
lastEdited: 201509290102,
|
||||
position: 4
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
title: 'Upload files to your cloud drive',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20131229,
|
||||
lastEdited: 201312290549,
|
||||
position: 5
|
||||
}
|
||||
]
|
||||
@ -59,35 +59,35 @@ module.exports = [
|
||||
id: '1',
|
||||
title: 'Mannaging apps for your account',
|
||||
content: 'Curabitur sed dignissim turpis, sed lacinia urna. Vestibulum semper suscipit interdum. Proin sed sem gravida massa tristique rhoncus auctor eu diam. Donec fringilla in ex non dignissim. Praesent sed ultricies eros. Nullam vel augue eget libero volutpat sodales sit amet et orci.',
|
||||
lastEdited: 20160516,
|
||||
lastEdited: 201605161200,
|
||||
position: 1
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: 'How to assign new task and files',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150429,
|
||||
lastEdited: 201504291159,
|
||||
position: 2
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
title: 'Updating your profile picture',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150429,
|
||||
lastEdited: 201504291222,
|
||||
position: 3
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
title: 'Deleting your account',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20150929,
|
||||
lastEdited: 201509292359,
|
||||
position: 4
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
title: 'Upload files to your cloud drive',
|
||||
content: 'Aliquam aliquet mi nulla. Nam vel orci diam. Suspendisse euismod orci efficitur nulla mattis eleifend vitae quis neque. Etiam orci dolor, dignissim quis convallis quis, rhoncus eu tellus. Phasellus aliquam ut enim id ultrices. Nunc dolor arcu, viverra vel ullamcorper nec, dignissim a lectus. Praesent fringilla, neque nec suscipit placerat, augue elit suscipit velit, in feugiat leo justo id tortor.',
|
||||
lastEdited: 20131229,
|
||||
lastEdited: 201312290000,
|
||||
position: 5
|
||||
}
|
||||
]
|
||||
@ -156,4 +156,4 @@ module.exports = [
|
||||
};
|
||||
}
|
||||
}
|
||||
];
|
||||
];
|
||||
|
@ -11,7 +11,7 @@ module.exports = [
|
||||
name: 'Emilia Clarke',
|
||||
email: 'staff@opensupports.com',
|
||||
profilePic: 'http://www.opensupports.com/profilepic.jpg',
|
||||
level: 1,
|
||||
level: 3,
|
||||
staff: true,
|
||||
departments: [
|
||||
{id: 1, name: 'Sales Support', owners: 2},
|
||||
@ -420,7 +420,7 @@ module.exports = [
|
||||
name: 'Technical Issues',
|
||||
owners: 5
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161230',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: true,
|
||||
@ -439,7 +439,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504091149',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -449,7 +449,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504091238',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -460,7 +460,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504102349',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -470,7 +470,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504110021',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -481,7 +481,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504120123',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -491,7 +491,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504130402',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -502,7 +502,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505110405',
|
||||
content: 'Thanks!, I solved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -512,7 +512,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505130429',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -522,7 +522,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510180430',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -540,7 +540,7 @@ module.exports = [
|
||||
name: 'Technical Issues',
|
||||
owners: 5
|
||||
},
|
||||
date: '20160415',
|
||||
date: '201604150550',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -556,7 +556,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504091010',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -566,7 +566,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504091012',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -577,7 +577,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504101245',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -587,7 +587,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504112359',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -598,7 +598,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504122359',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -608,7 +608,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504132240',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -619,7 +619,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505112241',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -629,7 +629,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505132243',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -639,7 +639,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510182250',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -657,7 +657,7 @@ module.exports = [
|
||||
name: 'Technical Issues',
|
||||
owners: 5
|
||||
},
|
||||
date: '20150409',
|
||||
date: '201504092255',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -673,7 +673,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504092300',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -683,7 +683,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504092301',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -694,7 +694,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504102302',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -704,7 +704,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504112303',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -715,7 +715,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504122304',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -725,7 +725,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504132305',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -736,7 +736,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505112306',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -746,7 +746,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505132307',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -756,7 +756,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510182309',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -774,7 +774,7 @@ module.exports = [
|
||||
name: 'Sales Support',
|
||||
owners: 2
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604162310',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -812,7 +812,7 @@ module.exports = [
|
||||
name: 'Sales Support',
|
||||
owners: 2
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161040',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: true,
|
||||
@ -839,7 +839,7 @@ module.exports = [
|
||||
name: 'Sales Support',
|
||||
owners: 2
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161042',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: true,
|
||||
@ -866,7 +866,7 @@ module.exports = [
|
||||
name: 'Technical Issues',
|
||||
owners: 2
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161055',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: true,
|
||||
@ -905,7 +905,7 @@ module.exports = [
|
||||
name: 'Sales Support',
|
||||
owners: 2
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161055',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -946,7 +946,7 @@ module.exports = [
|
||||
id: 1,
|
||||
name: 'Sales Support'
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161100',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -984,7 +984,7 @@ module.exports = [
|
||||
departments: [{id: 2, name: 'Technical issues'}],
|
||||
assignedTickets: 4,
|
||||
closedTickets: 21,
|
||||
lastLogin: 20161212
|
||||
lastLogin: 201612121150
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
@ -993,7 +993,7 @@ module.exports = [
|
||||
departments: [{id: 2, name: 'Technical issues'}, {id: 1, name: 'Sales Support'}],
|
||||
assignedTickets: 9,
|
||||
closedTickets: 0,
|
||||
lastLogin: 20161212
|
||||
lastLogin: 201612121155
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
@ -1002,7 +1002,7 @@ module.exports = [
|
||||
departments: [{id: 1, name: 'Sales Support'}],
|
||||
assignedTickets: -1,
|
||||
closedTickets: -1,
|
||||
lastLogin: 20160212
|
||||
lastLogin: 201602121158
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
@ -1011,7 +1011,7 @@ module.exports = [
|
||||
departments: [{id: 1, name: 'Sales Support'}, {id: 3, name: 'System and Administration'}],
|
||||
assignedTickets: 100,
|
||||
closedTickets: 21,
|
||||
lastLogin: 20130101
|
||||
lastLogin: 201301012346
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
@ -1020,7 +1020,7 @@ module.exports = [
|
||||
departments: [{id: 3, name: 'System and Administration'}],
|
||||
assignedTickets: 1,
|
||||
closedTickets: 1,
|
||||
lastLogin: 2012050
|
||||
lastLogin: 20120501330
|
||||
}
|
||||
]
|
||||
};
|
||||
@ -1047,35 +1047,5 @@ module.exports = [
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/add-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/edit-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/delete-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
];
|
||||
];
|
||||
|
@ -16,5 +16,35 @@ module.exports = [
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/add-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/edit-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/staff/delete-department',
|
||||
time: 100,
|
||||
response: function () {
|
||||
return {
|
||||
status: 'success',
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
];
|
||||
|
@ -102,7 +102,7 @@ module.exports = [
|
||||
id: 1,
|
||||
name: 'Sales Support'
|
||||
},
|
||||
date: '20160415',
|
||||
date: '201604151155',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -119,7 +119,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504090650',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -129,7 +129,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504090729',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -140,7 +140,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504100922',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -150,7 +150,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504111000',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -161,7 +161,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504121001',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -171,7 +171,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504131002',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -182,7 +182,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505111003',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -192,7 +192,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505131004',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -202,7 +202,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510181005',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
|
@ -15,7 +15,7 @@ module.exports = [
|
||||
'userId': 12,
|
||||
'token': 'cc6b4921e6733d6aafe284ec0d7be57e',
|
||||
'rememberToken': (data.remember) ? 'aa41efe0a1b3eeb9bf303e4561ff8392' : null,
|
||||
'rememberExpiration': (data.remember) ? 20180806 : 0
|
||||
'rememberExpiration': (data.remember) ? 201808061020 : 0
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@ -147,14 +147,14 @@ module.exports = [
|
||||
email: 'kurt@currycurrylady.hs',
|
||||
tickets: _.times(13).map(() => {
|
||||
return {
|
||||
ticketNumber: '118551',
|
||||
ticketNumber: '1185510000',
|
||||
title: 'Lorem ipsum door',
|
||||
content: 'I had a problem with the installation of the php server',
|
||||
department: {
|
||||
id: 1,
|
||||
name: 'Sales Support'
|
||||
},
|
||||
date: '20150409',
|
||||
date: '201504090001',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -170,7 +170,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504090003',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -180,7 +180,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504090005',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -191,7 +191,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504100009',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -201,7 +201,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504110011',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -212,7 +212,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504120024',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -222,7 +222,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504130035',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -233,7 +233,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505110110',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -243,7 +243,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505130113',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -253,7 +253,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510180114',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -285,70 +285,70 @@ module.exports = [
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@currycurrylady.com',
|
||||
tickets: 5,
|
||||
signupDate: 20160415
|
||||
signupDate: 201604151230
|
||||
},
|
||||
{
|
||||
id: 97,
|
||||
name: 'Alan Turing',
|
||||
email: 'turing@currycurrylady.com',
|
||||
tickets: 1,
|
||||
signupDate: 20160401
|
||||
signupDate: 201604011230
|
||||
},
|
||||
{
|
||||
id: 89,
|
||||
name: 'David Hilbert',
|
||||
email: 'hilbert@currycurrylady.com',
|
||||
tickets: 2,
|
||||
signupDate: 20160208
|
||||
signupDate: 201602081230
|
||||
},
|
||||
{
|
||||
id: 83,
|
||||
name: 'Kurt Gödel',
|
||||
email: 'kurt@currycurrylady.com',
|
||||
tickets: 10,
|
||||
signupDate: 20160110
|
||||
signupDate: 201601101230
|
||||
},
|
||||
{
|
||||
id: 79,
|
||||
name: 'Mojzesz Presburger',
|
||||
email: 'presburger@currycurrylady.com',
|
||||
tickets: 6,
|
||||
signupDate: 20150415
|
||||
signupDate: 201504151230
|
||||
},
|
||||
{
|
||||
id: 73,
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@currycurrylady.com',
|
||||
tickets: 5,
|
||||
signupDate: 20160415
|
||||
signupDate: 201604151230
|
||||
},
|
||||
{
|
||||
id: 71,
|
||||
name: 'Alan Turing',
|
||||
email: 'turing@currycurrylady.com',
|
||||
tickets: 1,
|
||||
signupDate: 20160401
|
||||
signupDate: 201604011230
|
||||
},
|
||||
{
|
||||
id: 67,
|
||||
name: 'David Hilbert',
|
||||
email: 'hilbert@currycurrylady.com',
|
||||
tickets: 2,
|
||||
signupDate: 20160208
|
||||
signupDate: 201602081230
|
||||
},
|
||||
{
|
||||
id: 61,
|
||||
name: 'Kurt Gödel',
|
||||
email: 'kurt@currycurrylady.com',
|
||||
tickets: 10,
|
||||
signupDate: 20160110
|
||||
signupDate: 201601101233
|
||||
},
|
||||
{
|
||||
id: 59,
|
||||
name: 'Mojzesz Presburger',
|
||||
email: 'presburger@currycurrylady.com',
|
||||
tickets: 6,
|
||||
signupDate: 20150415
|
||||
signupDate: 201504151236
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -373,7 +373,7 @@ module.exports = [
|
||||
id: 2,
|
||||
name: 'Technical Issues'
|
||||
},
|
||||
date: '20160416',
|
||||
date: '201604161427',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: true,
|
||||
@ -392,7 +392,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504090729',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -402,7 +402,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504090731',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -413,7 +413,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504100732',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -423,7 +423,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504110735',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -434,7 +434,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504120749',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -444,7 +444,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504130755',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -455,7 +455,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505110759',
|
||||
content: 'Thanks!, I solved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -465,7 +465,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505130800',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -475,7 +475,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510180807',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -492,7 +492,7 @@ module.exports = [
|
||||
id: 1,
|
||||
name: 'Sales Support'
|
||||
},
|
||||
date: '20160415',
|
||||
date: '201604150849',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -508,7 +508,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504090855',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -518,7 +518,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504090912',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -529,7 +529,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504100924',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -539,7 +539,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504110932',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -550,7 +550,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504120941',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -560,7 +560,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504130943',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -571,7 +571,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505110955',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -581,7 +581,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505131030',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -591,7 +591,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510181031',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -608,7 +608,7 @@ module.exports = [
|
||||
id: 1,
|
||||
name: 'Sales Support'
|
||||
},
|
||||
date: '20150409',
|
||||
date: '201504091032',
|
||||
file: 'http://www.opensupports.com/some_file.zip',
|
||||
language: 'en',
|
||||
unread: false,
|
||||
@ -624,7 +624,7 @@ module.exports = [
|
||||
events: [
|
||||
{
|
||||
type: 'ASSIGN',
|
||||
date: '20150409',
|
||||
date: '201504091033',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -634,7 +634,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150409',
|
||||
date: '201504091055',
|
||||
content: 'Do you have apache installed? It generally happens if you dont have apache.',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -645,7 +645,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'UN_ASSIGN',
|
||||
date: '20150410',
|
||||
date: '201504101059',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -655,7 +655,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'DEPARTMENT_CHANGED',
|
||||
date: '20150411',
|
||||
date: '201504111115',
|
||||
content: 'System support',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -666,7 +666,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150412',
|
||||
date: '201504121117',
|
||||
content: 'I have already installed apache, but the problem persists',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -676,7 +676,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'PRIORITY_CHANGED',
|
||||
date: '20150413',
|
||||
date: '201504131119',
|
||||
content: 'MEDIUM',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
@ -687,7 +687,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'COMMENT',
|
||||
date: '20150511',
|
||||
date: '201505111121',
|
||||
content: 'Thanks!, I soved it by myself',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
@ -697,7 +697,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'CLOSE',
|
||||
date: '20150513',
|
||||
date: '201505131231',
|
||||
author: {
|
||||
name: 'Emilia Clarke',
|
||||
email: 'jobs@steve.com',
|
||||
@ -707,7 +707,7 @@ module.exports = [
|
||||
},
|
||||
{
|
||||
type: 'RE_OPEN',
|
||||
date: '20151018',
|
||||
date: '201510181244',
|
||||
author: {
|
||||
name: 'Haskell Curry',
|
||||
email: 'haskell@lambda.com',
|
||||
@ -802,4 +802,4 @@ module.exports = [
|
||||
};
|
||||
}
|
||||
}
|
||||
];
|
||||
];
|
||||
|
@ -1,13 +1,19 @@
|
||||
let month = ["", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
|
||||
export default {
|
||||
transformToString (date) {
|
||||
date += ''; //Transform to string
|
||||
transformToString(date, expressive = true) {
|
||||
date += ''; // Transform to string
|
||||
let y = date.substring(0, 4);
|
||||
let m = date.substring(4, 6);
|
||||
let d = date.substring(6, 8);
|
||||
m = (m[0] - '0') * 10 + (m[1] - '0');
|
||||
|
||||
return d + " " + month[m] + " " + y;
|
||||
if(!expressive)
|
||||
return d + " " + month[m] + " " + y;
|
||||
|
||||
let hr = date.substring(8, 10);
|
||||
let min = date.substring(10, 12);
|
||||
|
||||
return d + " " + month[m] + " " + y + " at " + hr + ":" + min;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -25,11 +25,13 @@ class UnAssignStaffController extends Controller {
|
||||
if($ticket->owner && $ticket->owner->id == $user->id) {
|
||||
$user->sharedTicketList->remove($ticket);
|
||||
$user->store();
|
||||
|
||||
$ticket->owner = null;
|
||||
$ticket->unread = true;
|
||||
|
||||
$event = Ticketevent::getEvent(Ticketevent::UN_ASSIGN);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'authorStaff' => $user,
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
|
||||
|
@ -4,6 +4,9 @@ DataValidator::with('CustomValidations', true);
|
||||
|
||||
class DeleteDepartmentController extends Controller {
|
||||
const PATH = '/delete-department';
|
||||
|
||||
private $departmentId;
|
||||
private $transferDepartmentId;
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
@ -13,15 +16,65 @@ class DeleteDepartmentController extends Controller {
|
||||
'validation' => DataValidator::dataStoreId('department'),
|
||||
'error' => ERRORS::INVALID_DEPARTMENT
|
||||
],
|
||||
'transferDepartmentId' => [
|
||||
'validation' => DataValidator::dataStoreId('department'),
|
||||
'error' => ERRORS::INVALID_DEPARTMENT
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function handler() {
|
||||
$this->departmentId = Controller::request('departmentId');
|
||||
$this->transferDepartmentId = Controller::request('transferDepartmentId');
|
||||
|
||||
$departmentId = Controller::request('departmentId');
|
||||
$departmentInstance = Department::getDataStore($departmentId);
|
||||
if ($this->departmentId === $this->transferDepartmentId) {
|
||||
Response::respondError(ERRORS::SAME_DEPARTMENT);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->transferDepartmentTickets();
|
||||
$departmentInstance = Department::getDataStore($this->departmentId);
|
||||
$departmentInstance->delete();
|
||||
|
||||
Response::respondSuccess();
|
||||
}
|
||||
|
||||
public function transferDepartmentTickets() {
|
||||
$tickets = Ticket::find('department_id = ?', [$this->departmentId]);
|
||||
$newDepartment = Department::getDataStore($this->transferDepartmentId);;
|
||||
|
||||
foreach($tickets as $ticket) {
|
||||
$staffOwner = $ticket->owner;
|
||||
|
||||
if($staffOwner) {
|
||||
$hasDepartment = false;
|
||||
|
||||
foreach($staffOwner->sharedDepartmentList as $department) {
|
||||
if($department->id === $newDepartment->id) {
|
||||
$hasDepartment = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$hasDepartment) {
|
||||
$staffOwner->sharedTicketList->remove($ticket);
|
||||
$staffOwner->store();
|
||||
|
||||
$ticket->owner = null;
|
||||
$ticket->unread = true;
|
||||
|
||||
$event = Ticketevent::getEvent(Ticketevent::UN_ASSIGN);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => $staffOwner,
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
|
||||
$ticket->addEvent($event);
|
||||
}
|
||||
}
|
||||
|
||||
$ticket->department = $newDepartment;
|
||||
$ticket->store();
|
||||
}
|
||||
}
|
||||
}
|
@ -14,6 +14,11 @@ class GetSettingsController extends Controller {
|
||||
Response::respondSuccess([
|
||||
'language' => Setting::getSetting('language')->getValue(),
|
||||
'reCaptchaKey' => Setting::getSetting('recaptcha-public')->getValue(),
|
||||
'time-zone' => Setting::getSetting('time-zone')->getValue(),
|
||||
'maintenance-mode' => Setting::getSetting('maintenance-mode')->getValue(),
|
||||
'layout' => Setting::getSetting('layout')->getValue(),
|
||||
'allow-attachments' => Setting::getSetting('allow-attachments')->getValue(),
|
||||
'max-size' => Setting::getSetting('max-size')->getValue(),
|
||||
'departments' => Department::getDepartmentNames()
|
||||
]);
|
||||
}
|
||||
|
@ -33,6 +33,12 @@ class InitSettingsController extends Controller {
|
||||
'smtp-port' => 7070,
|
||||
'smtp-user' => '',
|
||||
'smtp-pass' => '',
|
||||
'time-zone' => 0,
|
||||
'maintenance-mode' => 0,
|
||||
'layout' => 'boxed',
|
||||
'allow-attachments' => 0,
|
||||
'max-size' => 0,
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ class GetUserByIdController extends Controller {
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
'permission' => 'staff_2',
|
||||
'permission' => 'staff_1',
|
||||
'requestData' => [
|
||||
'userId' => [
|
||||
'validation' => DataValidator::dataStoreId('user'),
|
||||
@ -20,12 +20,21 @@ class GetUserByIdController extends Controller {
|
||||
public function handler() {
|
||||
$userId = Controller::request('userId');
|
||||
$user = User::getDataStore($userId);
|
||||
$staff = Controller::getLoggedUser();
|
||||
|
||||
$tickets = new DataStoreList();
|
||||
|
||||
foreach($user->sharedTicketList as $ticket) {
|
||||
if($staff->sharedDepartmentList->includesId($ticket->department->id)) {
|
||||
$tickets->add($ticket);
|
||||
}
|
||||
}
|
||||
|
||||
Response::respondSuccess([
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
'signupDate' => $user->signupDate,
|
||||
'tickets' => $user->sharedTicketList->toArray()
|
||||
'tickets' => $tickets->toArray()
|
||||
]);
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ class GetUsersController extends Controller {
|
||||
|
||||
public function validations() {
|
||||
return[
|
||||
'permission' => 'staff_2',
|
||||
'permission' => 'staff_1',
|
||||
'requestData' => [
|
||||
'page' => [
|
||||
'validation' => DataValidator::numeric(),
|
||||
|
@ -29,4 +29,5 @@ class ERRORS {
|
||||
const INVALID_LEVEL = 'INVALID_LEVEL';
|
||||
const ALREADY_A_STAFF = 'ALREADY_A_STAFF';
|
||||
const INVALID_STAFF = 'INVALID_STAFF';
|
||||
const SAME_DEPARTMENT = 'SAME_DEPARTMENT';
|
||||
}
|
||||
|
@ -33,6 +33,18 @@ class DataStoreList implements IteratorAggregate {
|
||||
}
|
||||
}
|
||||
|
||||
public function includesId($id) {
|
||||
$includes = false;
|
||||
|
||||
foreach($this->list as $item) {
|
||||
if($item->id == $id) {
|
||||
$includes = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $includes;
|
||||
}
|
||||
|
||||
public function toBeanList() {
|
||||
$beanList = [];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
<?php
|
||||
class Date {
|
||||
public static function getCurrentDate() {
|
||||
return date('Ymd');
|
||||
return date('YmdHi');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,82 @@
|
||||
describe'system/delete-department' do
|
||||
describe 'system/delete-department' do
|
||||
request('/user/logout')
|
||||
Scripts.createUser('tranferguy@opensupports.com', 'transfer', 'Transfer Guy')
|
||||
Scripts.login('tranferguy@opensupports.com', 'transfer')
|
||||
|
||||
ticket1 = request('/ticket/create',{
|
||||
title: 'Transferible ticket 1',
|
||||
content: 'The north remembers',
|
||||
departmentId: 4,
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
ticket2 =request('/ticket/create',{
|
||||
title: 'Transferible ticket 2',
|
||||
content: 'The north remembers',
|
||||
departmentId: 4,
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
ticket3 = request('/ticket/create',{
|
||||
title: 'Transferible ticket 3',
|
||||
content: 'The north remembers',
|
||||
departmentId: 4,
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
ticket1 = ticket1['data']['ticketNumber']
|
||||
ticket2 = ticket2['data']['ticketNumber']
|
||||
ticket3 = ticket3['data']['ticketNumber']
|
||||
|
||||
request('/user/logout')
|
||||
Scripts.login($staff[:email], $staff[:password], true)
|
||||
request('/staff/edit', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token,
|
||||
departments: '[1, 2, 3, 4]'
|
||||
})
|
||||
request('/staff/assign-ticket', {
|
||||
ticketNumber: ticket3,
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
|
||||
it 'should delete department' do
|
||||
result= request('/system/delete-department', {
|
||||
it 'should fail if departments are the same' do
|
||||
result = request('/system/delete-department', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token,
|
||||
departmentId: 4
|
||||
departmentId: 4,
|
||||
transferDepartmentId: 4
|
||||
})
|
||||
|
||||
(result['status']).should.equal('fail')
|
||||
(result['message']).should.equal('SAME_DEPARTMENT')
|
||||
end
|
||||
|
||||
it 'should delete department' do
|
||||
result = request('/system/delete-department', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token,
|
||||
departmentId: 4,
|
||||
transferDepartmentId: 2
|
||||
})
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
|
||||
row = $database.getRow('department', 4, 'id')
|
||||
|
||||
(row).should.equal(nil)
|
||||
|
||||
ticket1 = $database.getRow('ticket', ticket1, 'ticket_number')
|
||||
ticket2 = $database.getRow('ticket', ticket2, 'ticket_number')
|
||||
ticket3 = $database.getRow('ticket', ticket3, 'ticket_number')
|
||||
|
||||
(ticket1['department_id']).should.equal('2')
|
||||
(ticket1['owner_id']).should.equal(nil)
|
||||
|
||||
(ticket2['department_id']).should.equal('2')
|
||||
(ticket2['owner_id']).should.equal(nil)
|
||||
|
||||
(ticket3['department_id']).should.equal('2')
|
||||
(ticket3['owner_id']).should.equal($csrf_userid)
|
||||
end
|
||||
end
|
@ -96,7 +96,6 @@ describe '/ticket/create' do
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
|
||||
puts result['message']
|
||||
(result['status']).should.equal('success')
|
||||
|
||||
ticket = $database.getRow('ticket','Winter is coming','title')
|
||||
|
Loading…
x
Reference in New Issue
Block a user