}
diff --git a/client/src/app/admin/panel/tickets/admin-panel-all-tickets.scss b/client/src/app/admin/panel/tickets/admin-panel-all-tickets.scss
index d09f84bc..6d901a7d 100644
--- a/client/src/app/admin/panel/tickets/admin-panel-all-tickets.scss
+++ b/client/src/app/admin/panel/tickets/admin-panel-all-tickets.scss
@@ -1,6 +1,11 @@
-.admin-panel-my-tickets {
+.admin-panel-all-tickets {
+
&__search-box {
padding: 0 50px;
margin-bottom: 30px;
}
-}
\ No newline at end of file
+
+ &__department-warning {
+ margin-bottom: 20px;
+ }
+}
diff --git a/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
index 185a3656..86b5e5be 100644
--- a/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
+++ b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
@@ -22,9 +22,11 @@ class AdminPanelNewTickets extends React.Component {
}
render() {
+ const noDepartments = !this.props.departments.length;
return (
-
+
+ {(noDepartments) ? {i18n('NO_DEPARTMENT_ASSIGNED')} : null}
{(this.props.error) ? {i18n('ERROR_RETRIEVING_TICKETS')} : }
);
diff --git a/client/src/app/admin/panel/tickets/admin-panel-new-tickets.scss b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.scss
new file mode 100644
index 00000000..6e7fb36b
--- /dev/null
+++ b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.scss
@@ -0,0 +1,6 @@
+.admin-panel-new-tickets {
+
+ &__department-warning {
+ margin-bottom: 20px;
+ }
+}
diff --git a/client/src/core-components/message.js b/client/src/core-components/message.js
index 64f75a7a..b8f32cf6 100644
--- a/client/src/core-components/message.js
+++ b/client/src/core-components/message.js
@@ -10,7 +10,7 @@ class Message extends React.Component {
title: React.PropTypes.string,
children: React.PropTypes.node,
leftAligned: React.PropTypes.bool,
- type: React.PropTypes.oneOf(['success', 'error', 'info'])
+ type: React.PropTypes.oneOf(['success', 'error', 'info', 'warning'])
};
static defaultProps = {
@@ -53,6 +53,7 @@ class Message extends React.Component {
'message_success': (this.props.type === 'success'),
'message_error': (this.props.type === 'error'),
'message_info': (this.props.type === 'info'),
+ 'message_warning': (this.props.type === 'warning'),
'message_with-title': (this.props.title),
'message_left-aligned': (this.props.leftAligned),
@@ -66,7 +67,8 @@ class Message extends React.Component {
let iconNames = {
'success': 'check-circle',
'error': 'exclamation-circle',
- 'info': 'info-circle'
+ 'info': 'info-circle',
+ 'warning': 'exclamation-triangle'
};
return iconNames[this.props.type];
diff --git a/client/src/core-components/message.scss b/client/src/core-components/message.scss
index aef7e563..31c1e532 100644
--- a/client/src/core-components/message.scss
+++ b/client/src/core-components/message.scss
@@ -68,6 +68,22 @@
}
}
+ &_warning {
+ background-color: #fcb90063;
+
+ .message__icon {
+ color: #fcb900;
+ }
+
+ .message__title {
+ color: $primary-blue;
+ }
+
+ .message__content {
+ color: $primary-blue;
+ }
+ }
+
&_with-title {
text-align: left;
@@ -95,4 +111,4 @@
padding-left: 28px;
}
}
-}
\ No newline at end of file
+}
diff --git a/client/src/data/fixtures/ticket-fixtures.js b/client/src/data/fixtures/ticket-fixtures.js
index 75af3df7..1c456fea 100644
--- a/client/src/data/fixtures/ticket-fixtures.js
+++ b/client/src/data/fixtures/ticket-fixtures.js
@@ -99,7 +99,7 @@ module.exports = [
title: 'Lorem ipsum door',
content: 'I had a problem with the installation of the php server',
department: {
- id: 1,
+ id: '1',
name: 'Sales Support'
},
date: '201604151155',
@@ -110,12 +110,12 @@ module.exports = [
closed: false,
priority: 'medium',
author: {
- id: 3,
+ id: '3',
name: 'Haskell Curry',
email: 'haskell@lambda.com'
},
owner: {
- id: 1,
+ id: '12',
name: 'Steve Jobs'
},
events: [
diff --git a/client/src/data/languages/br.js b/client/src/data/languages/br.js
index 3a0b5a15..12e23c8a 100644
--- a/client/src/data/languages/br.js
+++ b/client/src/data/languages/br.js
@@ -180,6 +180,7 @@ export default {
'STAFF_UPDATED': 'Membro da equipe atualizado',
'UPDATE': 'Atualizar',
'NEVER': 'Nunca',
+ 'HIMSELF': 'ele mesmo',
'CHART_CREATE_TICKET': 'Chamados criados',
'CHART_CLOSE': 'Chamados fechados',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'A resposta customizada será excluída.',
'WILL_DELETE_DEPARTMENT': 'O departamento será excluído. Todos os chamados serão transferidos para o departamento selecionado.',
'NO_STAFF_ASSIGNED': 'Ninguém da equipe está atribuído a este departamento.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Nenhum departamento de chamados é atribuído a você.',
'LEVEL_UPDATED': 'Nível foi atualizado com êxito.',
'DEPARTMENTS_UPDATED': 'Os departamentos foram atualizados com sucesso.',
'FAILED_EDIT_STAFF': 'Ocorreu um erro ao tentar editar o membro da equipe.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Últimos 365 dias',
'ACTIVITY_COMMENT_THIS': 'comentou este chamado',
- 'ACTIVITY_ASSIGN_THIS': 'atribuiu este chamado',
- 'ACTIVITY_UN_ASSIGN_THIS': 'desatribuiu este chamado',
+ 'ACTIVITY_ASSIGN_THIS': 'atribuiu este chamado para',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'desatribuiu este chamado para',
'ACTIVITY_CLOSE_THIS': 'fechou este chamado',
'ACTIVITY_CREATE_TICKET_THIS': 'criou este chamado',
'ACTIVITY_RE_OPEN_THIS': 'reabriu este chamado',
diff --git a/client/src/data/languages/cn.js b/client/src/data/languages/cn.js
index e07f443d..ab259450 100644
--- a/client/src/data/languages/cn.js
+++ b/client/src/data/languages/cn.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': '工作人员已更新',
'UPDATE': '更新',
'NEVER': '从来没有',
+ 'HIMSELF': '他自己',
'CHART_CREATE_TICKET': '已創建門票',
'CHART_CLOSE': '門票已關閉',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': '自定義響應將被刪除。',
'WILL_DELETE_DEPARTMENT': '部門將被刪除。所有票將轉移到所選部門。',
'NO_STAFF_ASSIGNED': '沒有工作人員被分配到這個部門。',
+ 'NO_DEPARTMENT_ASSIGNED': '没有为您分配票务部门。',
'LEVEL_UPDATED': '級別已成功更新。',
'DEPARTMENTS_UPDATED': '部門已成功更新。',
'FAILED_EDIT_STAFF': '嘗試編輯員工時出錯。',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS':'過去365天',
'ACTIVITY_COMMENT_THIS': '評論了這張票',
- 'ACTIVITY_ASSIGN_THIS': '分配這張票',
- 'ACTIVITY_UN_ASSIGN_THIS': '取消分配此票',
+ 'ACTIVITY_ASSIGN_THIS': '将此票证分配给',
+ 'ACTIVITY_UN_ASSIGN_THIS': '未分配此票给',
'ACTIVITY_CLOSE_THIS': '關閉這張票',
'ACTIVITY_CREATE_TICKET_THIS': '創建了這張票',
'ACTIVITY_RE_OPEN_THIS': '重新打開這張票',
diff --git a/client/src/data/languages/de.js b/client/src/data/languages/de.js
index 442e8a57..e6b172b6 100644
--- a/client/src/data/languages/de.js
+++ b/client/src/data/languages/de.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Mitarbeiter wurde aktualisiert',
'UPDATE': 'Aktualisierung',
'NEVER': 'Niemals',
+ 'HIMSELF': 'selbst',
'CHART_CREATE_TICKET': 'Tickets erstellt',
'CHART_CLOSE': 'Tickets geschlossen',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'Die benutzerdefinierte Antwort wird gelöscht.',
'WILL_DELETE_DEPARTMENT': 'Die Abteilung wird gelöscht. Alle Tickets werden an die gewählte Abteilung übertragen.',
'NO_STAFF_ASSIGNED': 'Dieser Abteilung ist kein Mitarbeiter zugeordnet.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Ihnen ist keine Ticketabteilung zugeordnet.',
'LEVEL_UPDATED': 'Level wurde erfolgreich aktualisiert.',
'DEPARTMENTS_UPDATED': 'Abteilungen wurden erfolgreich aktualisiert.',
'FAILED_EDIT_STAFF': 'Beim bearbeiten des Mitarbeiters ist ein Fehler aufgetreten.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Letzte 365 Tage',
'ACTIVITY_COMMENT_THIS': 'hat dieses Ticket kommentiert',
- 'ACTIVITY_ASSIGN_THIS': 'hat dieses Ticket zugewiesen',
- 'ACTIVITY_UN_ASSIGN_THIS': 'hat dieses Ticket nicht zugewiesen',
+ 'ACTIVITY_ASSIGN_THIS': 'hat dieses Ticket zugewiesen zu',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'hat dieses Ticket nicht zugewiesen zu',
"ACTIVITY_CLOSE_THIS": 'hat dieses Ticket geschlossen',
'ACTIVITY_CREATE_TICKET_THIS': 'hat dieses Ticket erstellt',
'ACTIVITY_RE_OPEN_THIS': 'hat dieses Ticket wieder geöffnet',
diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js
index 503ce6f5..8a980634 100644
--- a/client/src/data/languages/en.js
+++ b/client/src/data/languages/en.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Staff member has been updated',
'UPDATE': 'Update',
'NEVER': 'Never',
+ 'HIMSELF': 'himself',
'CHART_CREATE_TICKET': 'Tickets created',
'CHART_CLOSE': 'Tickets closed',
@@ -337,6 +338,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'The custom response will be deleted.',
'WILL_DELETE_DEPARTMENT': 'The department will be deleted. All the tickets will be transfer to the department selected.',
'NO_STAFF_ASSIGNED': 'No staff member is assigned to this department.',
+ 'NO_DEPARTMENT_ASSIGNED': 'No ticket department is assigned you.',
'LEVEL_UPDATED': 'Level has been updated successfully.',
'DEPARTMENTS_UPDATED': 'Departments have been updated successfully.',
'FAILED_EDIT_STAFF': 'An error occurred while trying to edit staff member.',
@@ -352,8 +354,8 @@ export default {
'LAST_365_DAYS': 'Last 365 days',
'ACTIVITY_COMMENT_THIS': 'commented this ticket',
- 'ACTIVITY_ASSIGN_THIS': 'assigned this ticket',
- 'ACTIVITY_UN_ASSIGN_THIS': 'unassigned this ticket',
+ 'ACTIVITY_ASSIGN_THIS': 'assigned this ticket to',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'unassigned this ticket to',
'ACTIVITY_CLOSE_THIS': 'closed this ticket',
'ACTIVITY_CREATE_TICKET_THIS': 'created this ticket',
'ACTIVITY_RE_OPEN_THIS': 'reopened this ticket',
diff --git a/client/src/data/languages/es.js b/client/src/data/languages/es.js
index 55439c6f..072bcd83 100644
--- a/client/src/data/languages/es.js
+++ b/client/src/data/languages/es.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Miembro de Staff actualizado',
'UPDATE': 'Actualizar',
'NEVER': 'Nunca',
+ 'HIMSELF': 'si mismo',
'CHART_CREATE_TICKET': 'Tickets creados',
'CHART_CLOSE': 'Tickets cerrados',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'La respuesta personalizada se eliminará.',
'WILL_DELETE_DEPARTMENT': 'Se eliminará el departamento. Todos los tickets serán transferidos al departamento seleccionado.',
'NO_STAFF_ASSIGNED': 'Ningún miembro de staff está asignado a este departamento.',
+ 'NO_DEPARTMENT_ASSIGNED': 'No tienes ningún departamento asignado.',
'LEVEL_UPDATED': 'El nivel se ha actualizado correctamente.',
'DEPARTMENTS_UPDATED': 'Los departamentos se han actualizado correctamente.',
'FAILED_EDIT_STAFF': 'Se ha producido un error al intentar editar al miembro de staff.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Últimos 365 dias',
'ACTIVITY_COMMENT_THIS': 'comentó este ticket',
- 'ACTIVITY_ASSIGN_THIS': 'se asignó este ticket',
- 'ACTIVITY_UN_ASSIGN_THIS': 'se desasignó este ticket',
+ 'ACTIVITY_ASSIGN_THIS': 'se asignó este ticket para',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'se desasignó este ticket para',
'ACTIVITY_CLOSE_THIS': 'cerró este ticket',
'ACTIVITY_CREATE_TICKET_THIS': 'creó este ticket',
'ACTIVITY_RE_OPEN_THIS': 'reabrió este ticket',
diff --git a/client/src/data/languages/fr.js b/client/src/data/languages/fr.js
index 25789de4..ee88f58e 100644
--- a/client/src/data/languages/fr.js
+++ b/client/src/data/languages/fr.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Le membre du personnel a été mis à jour',
'UPDATE': 'Mettre à jour',
'NEVER': 'Jamais',
+ 'HIMSELF': 'lui-même',
'CHART_CREATE_TICKET': 'Tickets créés',
'CHART_CLOSE': 'Tickets fermés',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'La réponse personnalisée sera supprimée.',
'WILL_DELETE_DEPARTMENT': 'Le département sera supprimé. Tous les tickets seront transférés au département sélectionné.',
'NO_STAFF_ASSIGNED': 'Aucun membre de l\'administration n\'est affecté à ce service.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Aucun service de tickets ne vous est assigné.',
'LEVEL_UPDATED': 'Le niveau a été mis à jour avec succès.',
'DEPARTMENTS_UPDATED': 'Les départements ont été mis à jour avec succès.',
'FAILED_EDIT_STAFF': 'Une erreur s\'est produite lors de la tentative de modification de l\'administrateur.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Les 365 derniers jours',
'ACTIVITY_COMMENT_THIS': 'a commenté ce ticket',
- 'ACTIVITY_ASSIGN_THIS': 'a assigné ce ticket',
- 'ACTIVITY_UN_ASSIGN_THIS': 'a supprimé l\'assignation de ce ticket',
+ 'ACTIVITY_ASSIGN_THIS': 'a assigné ce ticket à',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'a supprimé l\'assignation de ce ticket à',
'ACTIVITY_CLOSE_THIS': 'a fermé ce ticket',
'ACTIVITY_CREATE_TICKET_THIS': 'a créé ce ticket',
'ACTIVITY_RE_OPEN_THIS': 'a réouvert ce ticket',
diff --git a/client/src/data/languages/gr.js b/client/src/data/languages/gr.js
index a6222bba..11af28a9 100644
--- a/client/src/data/languages/gr.js
+++ b/client/src/data/languages/gr.js
@@ -181,6 +181,7 @@
'STAFF_UPDATED': 'Το μέλος προσωπικού έχει ενημερωθεί',
'UPDATE': 'Ενημέρωση',
'NEVER': 'Ποτέ',
+ 'HIMSELF': 'ο ίδιος',
'CHART_CREATE_TICKET': 'Τα εισιτήρια δημιουργήθηκαν',
'CHART_CLOSE': 'Τα εισιτήρια κλείσανε',
@@ -337,6 +338,7 @@
'WILL_DELETE_CUSTOM_RESPONSE': 'Η προσαρμοσμένη απάντηση θα διαγραφεί.',
'WILL_DELETE_DEPARTMENT': 'Το τμήμα θα διαγραφεί. Όλα τα εισιτήρια θα μεταφερθούν στο επιλεγμένο τμήμα.',
'NO_STAFF_ASSIGNED': 'Κανένας υπάλληλος δεν έχει ανατεθεί σε αυτό το τμήμα.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Κανένα τμήμα δεν σας έχει εκχωρηθεί.',
'LEVEL_UPDATED': 'Το επίπεδο έχει ενημερωθεί με επιτυχία.',
'DEPARTMENTS_UPDATED': 'Τα τμήματα ενημερώθηκαν με επιτυχία.',
'FAILED_EDIT_STAFF': 'Παρουσιάστηκε σφάλμα κατά την προσπάθεια επεξεργασίας του μέλους του προσωπικού.',
@@ -352,8 +354,8 @@
'LAST_365_DAYS': 'Τελευταίες 365 μέρες',
'ACTIVITY_COMMENT_THIS': 'σχολίασε αυτό το εισιτήριο',
- 'ACTIVITY_ASSIGN_THIS': 'ορίστηκε αυτό το εισιτήριο',
- 'ACTIVITY_UN_ASSIGN_THIS': 'δεν ορίστηκε αυτό το εισιτήριο',
+ 'ACTIVITY_ASSIGN_THIS': 'ορίστηκε αυτό το εισιτήριο σε',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'δεν ορίστηκε αυτό το εισιτήριο σε',
'ACTIVITY_CLOSE_THIS': 'έκλεισε αυτό το εισιτήριο',
'ACTIVITY_CREATE_TICKET_THIS': 'δημιουργήθηκε αυτό το εισιτήριο',
'ACTIVITY_RE_OPEN_THIS': 'άνοιξε εκ νέου αυτό το εισιτήριο',
diff --git a/client/src/data/languages/in.js b/client/src/data/languages/in.js
index eb7b89a4..dfb3c2be 100644
--- a/client/src/data/languages/in.js
+++ b/client/src/data/languages/in.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'स्टाफ सदस्य को अद्यतन किया गया है',
'UPDATE': 'अद्यतन',
'NEVER': 'कभी नहीँ',
+ 'HIMSELF': 'स्वयं',
'CHART_CREATE_TICKET': 'टिकट बनाया',
'CHART_CLOSE': 'टिकट बंद कर दिया',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'कस्टम प्रतिक्रिया हटा दिया जाएगा।',
'WILL_DELETE_DEPARTMENT': 'विभाग को हटा दिया जाएगा। सभी टिकट चुने हुए विभाग को हस्तांतरण होगा।',
'NO_STAFF_ASSIGNED': 'कोई स्टाफ सदस्य इस विभाग को सौंपा है।',
+ 'NO_DEPARTMENT_ASSIGNED': 'कोई टिकट विभाग आपको सौंपा गया है.',
'LEVEL_UPDATED': 'स्तर को सफलतापूर्वक अद्यतन किया गया है।',
'DEPARTMENTS_UPDATED': 'विभागों को सफलतापूर्वक अद्यतन किया गया है।',
'FAILED_EDIT_STAFF': 'स्टाफ सदस्य को संपादित करने की कोशिश में एक त्रुटि हुई।',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'पिछले 365 दिन',
'ACTIVITY_COMMENT_THIS': 'यह टिकट टिप्पणी की',
- 'ACTIVITY_ASSIGN_THIS': 'इस टिकट को सौंपा',
- 'ACTIVITY_UN_ASSIGN_THIS': 'इस टिकट को असाइन किया गया',
+ 'ACTIVITY_ASSIGN_THIS': 'इस टिकट को सौंपा गया',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'इस टिकट को असाइन नहीं किया गया',
'ACTIVITY_CLOSE_THIS': 'इस टिकट को बंद कर दिया',
'ACTIVITY_CREATE_TICKET_THIS': 'यह टिकट बनाया',
'ACTIVITY_RE_OPEN_THIS': 'इस टिकट को फिर से खोल दिया',
diff --git a/client/src/data/languages/it.js b/client/src/data/languages/it.js
index 2a1ee9ee..cf94a0eb 100644
--- a/client/src/data/languages/it.js
+++ b/client/src/data/languages/it.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Il membro del personale è stato aggiornato',
'UPDATE': 'Aggiornare',
'NEVER': 'Mai',
+ 'HIMSELF': 'lui stesso',
'CHART_CREATE_TICKET': 'Tickets creato',
'CHART_CLOSE': 'Tickets chiuso',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'La risposta personalizzata verrà eliminata..',
'WILL_DELETE_DEPARTMENT': 'Il dipartimento verrà cancellato. Tutti i ticket saranno trasferiti al dipartimento selezionato.',
'NO_STAFF_ASSIGNED': 'Nessun membro dello staff è assegnato a questo dipartimento.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Nessun reparto ticket è stato affidato a te.',
'LEVEL_UPDATED': 'Il livello è stato aggiornato correttamente.',
'DEPARTMENTS_UPDATED': 'I dipartimenti sono stati aggiornati con successo.',
'FAILED_EDIT_STAFF': 'Si è verificato un errore durante la modifica di un membro dello staff.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Ultimi 365 giorni',
'ACTIVITY_COMMENT_THIS': 'ha commentato questo ticket',
- 'ACTIVITY_ASSIGN_THIS': 'assegnato questo ticket',
- 'ACTIVITY_UN_ASSIGN_THIS': 'non ha assegnato questo ticket',
+ 'ACTIVITY_ASSIGN_THIS': 'assegnato questo ticket a',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'non ha assegnato questo ticket a',
'ACTIVITY_CLOSE_THIS': 'ha chiuso questo ticket',
'ACTIVITY_CREATE_TICKET_THIS': 'ha creato questo ticket',
'ACTIVITY_RE_OPEN_THIS': 'ha riaperto questo ticket',
diff --git a/client/src/data/languages/jp.js b/client/src/data/languages/jp.js
index 88fef672..3d1751f2 100644
--- a/client/src/data/languages/jp.js
+++ b/client/src/data/languages/jp.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'スタッフメンバーが更新されました',
'UPDATE': '更新',
'NEVER': '決して',
+ 'HIMSELF': '彼自身',
'CHART_CREATE_TICKET': '作成されたチケット',
'CHART_CLOSE': 'チケットが閉じられました',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'カスタムレスポンスが削除されます。',
'WILL_DELETE_DEPARTMENT': '部門は削除されます。すべてのチケットは、選択された部門に転送されます。',
'NO_STAFF_ASSIGNED': 'この部署にはスタッフが割り当てられていません。',
+ 'NO_DEPARTMENT_ASSIGNED': 'あなたに割り当てられたチケット部門はありません.',
'LEVEL_UPDATED': 'レベルが正常に更新されました。',
'DEPARTMENTS_UPDATED': '部署が正常に更新されました。',
'FAILED_EDIT_STAFF': 'スタッフメンバーの編集中にエラーが発生しました。',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': '過去365日間',
'ACTIVITY_COMMENT_THIS': 'はこのチケットにコメントしました',
- 'ACTIVITY_ASSIGN_THIS': 'がこのチケットを割り当てました',
- 'ACTIVITY_UN_ASSIGN_THIS': 'はこのチケットの割り当てを解除しました',
+ 'ACTIVITY_ASSIGN_THIS': 'はこのチケットを',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'はこのチケットの割当を解除しました',
'ACTIVITY_CLOSE_THIS': 'がこのチケットを閉鎖しました',
'ACTIVITY_CREATE_TICKET_THIS': 'がこのチケットを作成しました',
'ACTIVITY_RE_OPEN_THIS': 'がこのチケットを再開しました',
diff --git a/client/src/data/languages/nl.js b/client/src/data/languages/nl.js
index 98127830..c7e96fa0 100644
--- a/client/src/data/languages/nl.js
+++ b/client/src/data/languages/nl.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Medewerker is gewijzigd',
'UPDATE': 'Update',
'NEVER': 'Nooit',
+ 'HIMSELF': 'zichzelf',
'CHART_CREATE_TICKET': 'Aangemaakte incidenten',
'CHART_CLOSE': 'Gesloten incidenten',
@@ -337,6 +338,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'Het aangepaste antwoord zal worden verwijderd.',
'WILL_DELETE_DEPARTMENT': 'De afdeling wordt verwijderd. Alle incidenten worden overgedragen aan de geselecteerde afdeling.',
'NO_STAFF_ASSIGNED': 'Er is geen medewerker toegewezen aan deze afdeling.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Er is u geen incidentafdeling toegewezen.',
'LEVEL_UPDATED': 'Niveau is succesvol bijgewerkt.',
'DEPARTMENTS_UPDATED': 'Afdelingen zijn succesvol bijgewerkt.',
'FAILED_EDIT_STAFF': 'Er is een fout opgetreden bij het bewerken van de medewerker.',
@@ -352,8 +354,8 @@ export default {
'LAST_365_DAYS': 'Laatste 365 dagen',
'ACTIVITY_COMMENT_THIS': 'heeft een bericht achtergelaten op dit incident',
- 'ACTIVITY_ASSIGN_THIS': 'heeft dit incident toegewezen',
- 'ACTIVITY_UN_ASSIGN_THIS': 'heeft dit incident niet-toegewezen aan een medewerker',
+ 'ACTIVITY_ASSIGN_THIS': 'heeft dit incident toegewezen aan',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'heeft dit incident niet-toegewezen aan een medewerker aan',
'ACTIVITY_CLOSE_THIS': 'heeft dit incident gesloten',
'ACTIVITY_CREATE_TICKET_THIS': 'heeft dit incident aangemaakt',
'ACTIVITY_RE_OPEN_THIS': 'heeft dit incident heropend',
diff --git a/client/src/data/languages/pt.js b/client/src/data/languages/pt.js
index 585e5950..d2eb7d54 100644
--- a/client/src/data/languages/pt.js
+++ b/client/src/data/languages/pt.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Membro da equipe foi atualizado',
'UPDATE': 'Actualizar',
'NEVER': 'Nunca',
+ 'HIMSELF': 'ele mesmo',
'CHART_CREATE_TICKET': 'Ingressos criados',
'CHART_CLOSE': 'Ingressos fechados',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'A resposta personalizada será excluída.',
'WILL_DELETE_DEPARTMENT': 'O departamento será excluído. Todos os bilhetes serão transferidos para o departamento selecionado.',
'NO_STAFF_ASSIGNED': 'Nenhum membro do pessoal é atribuído a este departamento.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Nenhum departamento de tickets é atribuído a você.',
'LEVEL_UPDATED': 'Nível foi atualizado com êxito.',
'DEPARTMENTS_UPDATED': 'Os departamentos foram atualizados com sucesso.',
'FAILED_EDIT_STAFF': 'Ocorreu um erro ao tentar editar o membro da equipe.',
@@ -351,8 +353,8 @@ export default {
'LAST_365_DAYS': 'Últimos 365 dias',
'ACTIVITY_COMMENT_THIS': 'comentou este ticket',
- 'ACTIVITY_ASSIGN_THIS': 'atribuído este bilhete',
- 'ACTIVITY_UN_ASSIGN_THIS': 'não atribuído este bilhete',
+ 'ACTIVITY_ASSIGN_THIS': 'atribuído este bilhete para',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'não atribuído este bilhete para',
'ACTIVITY_CLOSE_THIS': 'fechado este bilhete',
'ACTIVITY_CREATE_TICKET_THIS': 'criado este bilhete',
'ACTIVITY_RE_OPEN_THIS': 'reaberto este bilhete',
diff --git a/client/src/data/languages/ru.js b/client/src/data/languages/ru.js
index 835788e9..1d3dce2b 100644
--- a/client/src/data/languages/ru.js
+++ b/client/src/data/languages/ru.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Сотрудник обновлен',
'UPDATE': 'Обновить',
'NEVER': 'Никогда',
+ 'HIMSELF': 'сам',
'CHART_CREATE_TICKET': 'Билеты создано',
'CHART_CLOSE': ' Билеты закрыты',
@@ -335,6 +336,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'Обычай ответ будет удален.',
'WILL_DELETE_DEPARTMENT': 'Отдел будет удален. Все билеты будут передача в отдел выбранного.',
'NO_STAFF_ASSIGNED': 'Ни один сотрудник не будет назначен в этот отдел.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Вам не назначено билетное ведомство.',
'LEVEL_UPDATED': 'Уровень был успешно обновлен.',
'DEPARTMENTS_UPDATED': 'Отделы были успешно обновлены.',
'FAILED_EDIT_STAFF': 'Произошла ошибка при попытке редактирования сотрудника.',
@@ -350,8 +352,8 @@ export default {
'LAST_365_DAYS': 'Последние 365 дней',
'ACTIVITY_COMMENT_THIS': 'прокомментировал этот билет',
- 'ACTIVITY_ASSIGN_THIS': 'присвоен этот билет',
- 'ACTIVITY_UN_ASSIGN_THIS': 'неназначенный билет',
+ 'ACTIVITY_ASSIGN_THIS': 'присвоен этот билет в',
+ 'ACTIVITY_UN_ASSIGN_THIS': 'неназначенный билет в',
'ACTIVITY_CLOSE_THIS': 'закрыл этот билет',
'ACTIVITY_CREATE_TICKET_THIS': 'создал этот билет',
'ACTIVITY_RE_OPEN_THIS': 'снова открыт этот билет',
diff --git a/client/src/data/languages/tr.js b/client/src/data/languages/tr.js
index 52d0a8a7..0e5fb187 100644
--- a/client/src/data/languages/tr.js
+++ b/client/src/data/languages/tr.js
@@ -181,6 +181,7 @@ export default {
'STAFF_UPDATED': 'Çalışanlar güncellendi',
'UPDATE': 'Güncelleştirme',
'NEVER': 'Asla',
+ 'HIMSELF': 'kendisi',
'CHART_CREATE_TICKET': 'Biletler oluşturuldu',
'CHART_CLOSE': 'Biletler kapandı',
@@ -336,6 +337,7 @@ export default {
'WILL_DELETE_CUSTOM_RESPONSE': 'Özel yanıt silinir.',
'WILL_DELETE_DEPARTMENT': 'Bölüm silinecek. Tüm biletler, seçilen bölüme transfer olacak.',
'NO_STAFF_ASSIGNED': 'Bu bölüme hiçbir personel atanmamaktadır.',
+ 'NO_DEPARTMENT_ASSIGNED': 'Hiçbir bilet departmanı size atanmadı.',
'LEVEL_UPDATED': 'Seviye başarıyla güncellendi.',
'DEPARTMENTS_UPDATED': 'Bölümler başarıyla güncellendi.',
'FAILED_EDIT_STAFF': 'Personel değiştirmeye çalışılırken bir hata oluştu.',
diff --git a/client/src/reducers/admin-data-reducer.js b/client/src/reducers/admin-data-reducer.js
index e3de7207..5aa12b2d 100644
--- a/client/src/reducers/admin-data-reducer.js
+++ b/client/src/reducers/admin-data-reducer.js
@@ -9,6 +9,7 @@ class AdminDataReducer extends Reducer {
return {
customResponses: [],
customResponsesLoaded: false,
+
myTickets: [],
myTicketsLoaded: false,
myTicketsError: false,
@@ -19,7 +20,11 @@ class AdminDataReducer extends Reducer {
allTickets: [],
allTicketsLoaded: false,
- allTicketsError: false
+ allTicketsError: false,
+
+ staffMembers: [],
+ staffMembersLoaded: false,
+ staffMembersError: false,
};
}
@@ -37,7 +42,11 @@ class AdminDataReducer extends Reducer {
'ALL_TICKETS_FULFILLED': this.onAllTicketsRetrieved,
'ALL_TICKETS_REJECTED': this.onAllTicketsRejected,
- 'ALL_TICKETS_PENDING': this.onAllTicketsPending
+ 'ALL_TICKETS_PENDING': this.onAllTicketsPending,
+
+ 'STAFF_MEMBERS_FULFILLED': this.onStaffMembersRetrieved,
+ 'STAFF_MEMBERS_REJECTED': this.onStaffMembersRejected,
+ 'STAFF_MEMBERS_PENDING': this.onStaffMembersPending
};
}
@@ -102,7 +111,7 @@ class AdminDataReducer extends Reducer {
onAllTicketsRejected(state) {
return _.extend({}, state, {
- allTicketsError: false,
+ allTicketsError: true,
allTicketsLoaded: false
});
}
@@ -113,6 +122,27 @@ class AdminDataReducer extends Reducer {
allTicketsLoaded: false
});
}
+
+ onStaffMembersRetrieved(state, payload) {
+ return _.extend({}, state, {
+ staffMembers: payload.data,
+ staffMembersLoaded: true
+ });
+ }
+
+ onStaffMembersRejected(state) {
+ return _.extend({}, state, {
+ staffMembersError: true,
+ staffMembersLoaded: false
+ });
+ }
+
+ onStaffMembersPending(state) {
+ return _.extend({}, state, {
+ staffMembersError: false,
+ staffMembersLoaded: false
+ });
+ }
}
-export default AdminDataReducer.getInstance();
\ No newline at end of file
+export default AdminDataReducer.getInstance();
diff --git a/server/controllers/staff/assign-ticket.php b/server/controllers/staff/assign-ticket.php
index 6343a769..58b7859d 100755
--- a/server/controllers/staff/assign-ticket.php
+++ b/server/controllers/staff/assign-ticket.php
@@ -15,6 +15,7 @@ DataValidator::with('CustomValidations', true);
* @apiPermission staff1
*
* @apiParam {Number} ticketNumber The number of the ticket to assign.
+ * @apiParam {Number} staffId The id of the staff.
*
* @apiUse NO_PERMISSION
* @apiUse INVALID_TICKET
@@ -30,7 +31,7 @@ class AssignStaffController extends Controller {
const METHOD = 'POST';
private $ticket;
- private $user;
+ private $staffToAssign;
public function validations() {
return [
@@ -46,29 +47,43 @@ class AssignStaffController extends Controller {
public function handler() {
$ticketNumber = Controller::request('ticketNumber');
- $this->user = Controller::getLoggedUser();
+ $staffId = Controller::request('staffId');
$this->ticket = Ticket::getByTicketNumber($ticketNumber);
+ if($staffId) {
+ $this->staffToAssign = Staff::getDataStore($staffId, 'id');
+
+ if($this->staffToAssign->isNull()) {
+ throw new Exception(ERRORS::INVALID_STAFF);
+ }
+
+ if(!$this->staffToAssign->sharedDepartmentList->includesId($this->ticket->department->id)) {
+ throw new Exception(ERRORS::INVALID_DEPARTMENT);
+ }
+ } else {
+ $this->staffToAssign = Controller::getLoggedUser();
+ }
+
if($this->ticket->owner) {
throw new Exception(ERRORS::TICKET_ALREADY_ASSIGNED);
- return;
}
if(!$this->ticketHasStaffDepartment()) {
throw new Exception(ERRORS::INVALID_DEPARTMENT);
} else {
- $this->user->sharedTicketList->add($this->ticket);
- $this->ticket->owner = $this->user;
- $this->ticket->unread = !$this->ticket->isAuthor($this->user);
+ $this->staffToAssign->sharedTicketList->add($this->ticket);
+ $this->ticket->owner = $this->staffToAssign;
+ $this->ticket->unread = !$this->ticket->isAuthor($this->staffToAssign);
$event = Ticketevent::getEvent(Ticketevent::ASSIGN);
$event->setProperties(array(
'authorStaff' => Controller::getLoggedUser(),
- 'date' => Date::getCurrentDate()
+ 'date' => Date::getCurrentDate(),
+ 'content' => $this->staffToAssign->name,
));
$this->ticket->addEvent($event);
$this->ticket->store();
- $this->user->store();
+ $this->staffToAssign->store();
Response::respondSuccess();
}
@@ -78,7 +93,7 @@ class AssignStaffController extends Controller {
public function ticketHasStaffDepartment() {
$departmentMatch = false;
- foreach ($this->user->sharedDepartmentList as $department) {
+ foreach ($this->staffToAssign->sharedDepartmentList as $department) {
if($this->ticket->department->id === $department->id) {
$departmentMatch = true;
}
diff --git a/server/controllers/staff/get-all-tickets.php b/server/controllers/staff/get-all-tickets.php
index abe1ff88..5a36bbac 100755
--- a/server/controllers/staff/get-all-tickets.php
+++ b/server/controllers/staff/get-all-tickets.php
@@ -39,7 +39,7 @@ class GetAllTicketsStaffController extends Controller {
]
];
}
-
+
public function handler() {
if (Ticket::isTableEmpty()) {
Response::respondSuccess([
@@ -77,9 +77,8 @@ class GetAllTicketsStaffController extends Controller {
foreach ($user->sharedDepartmentList as $department) {
$query .= 'department_id=' . $department->id . ' OR ';
}
- $query = substr($query,0,-3);
- $query .= ') ';
+ $query .= 'FALSE) ';
return $query;
}
-}
\ No newline at end of file
+}
diff --git a/server/controllers/staff/get-all.php b/server/controllers/staff/get-all.php
index aadc83af..305da700 100755
--- a/server/controllers/staff/get-all.php
+++ b/server/controllers/staff/get-all.php
@@ -12,7 +12,7 @@ use Respect\Validation\Validator as DataValidator;
* @apiDescription This path retrieves information about all the staff member.
*
* @apiPermission staff3
- *
+ *
* @apiUse NO_PERMISSION
*
* @apiSuccess {[Staff](#api-Data_Structures-ObjectStaff)[]} data Array of staff members.
@@ -25,7 +25,7 @@ class GetAllStaffController extends Controller {
public function validations() {
return [
- 'permission' => 'staff_3',
+ 'permission' => 'staff_1',
'requestData' => []
];
}
@@ -58,6 +58,6 @@ class GetAllStaffController extends Controller {
}
Response::respondSuccess($staffArray);
-
+
}
-}
\ No newline at end of file
+}
diff --git a/server/controllers/staff/un-assign-ticket.php b/server/controllers/staff/un-assign-ticket.php
index 4b84cd0a..5a67592c 100755
--- a/server/controllers/staff/un-assign-ticket.php
+++ b/server/controllers/staff/un-assign-ticket.php
@@ -57,7 +57,8 @@ class UnAssignStaffController extends Controller {
$event = Ticketevent::getEvent(Ticketevent::UN_ASSIGN);
$event->setProperties(array(
'authorStaff' => $user,
- 'date' => Date::getCurrentDate()
+ 'date' => Date::getCurrentDate(),
+ 'content' => $owner->name
));
$ticket->addEvent($event);
diff --git a/server/controllers/system/enable-user-system.php b/server/controllers/system/enable-user-system.php
index a29ad339..4a38ae0f 100755
--- a/server/controllers/system/enable-user-system.php
+++ b/server/controllers/system/enable-user-system.php
@@ -52,6 +52,9 @@ class EnableUserSystemController extends Controller {
$ticketList = Ticket::getAll();
foreach($ticketList as $ticket) {
+ if($ticket->authorStaff) {
+ continue;
+ }
$userInstance = User::getDataStore($ticket->authorEmail, 'email');
diff --git a/server/controllers/system/get-stats.php b/server/controllers/system/get-stats.php
index 3dfb1f2f..284efe3e 100755
--- a/server/controllers/system/get-stats.php
+++ b/server/controllers/system/get-stats.php
@@ -1,5 +1,6 @@
generationNewStats();
+ $this->generateNewStats();
+ $this->deleteLastStats();
$staffId = Controller::request('staffId');
@@ -56,7 +58,7 @@ class GetStatsController extends Controller {
}
}
- public function generationNewStats() {
+ public function generateNewStats() {
$lastStatDay = Setting::getSetting('last-stat-day');
$previousCurrentDate = floor(Date::getPreviousDate() / 10000);
$currentDate = floor(Date::getCurrentDate() / 10000);
@@ -109,6 +111,13 @@ class GetStatsController extends Controller {
}
}
+ public function deleteLastStats() {
+ $removeOlderThanDays = 31;
+ $oldDate = floor(Date::getPreviousDate($removeOlderThanDays) / 10000);
+
+ RedBean::exec("DELETE FROM stat WHERE date < $oldDate");
+ }
+
public function generateGeneralStat($type, $date) {
$value = Log::count('type=? AND date LIKE ?',[$type, $date->format('Ymd') . '%']);
$stat = new Stat();
@@ -161,4 +170,4 @@ class GetStatsController extends Controller {
return $daysToRetrieve;
}
-}
\ No newline at end of file
+}
diff --git a/server/controllers/ticket/create.php b/server/controllers/ticket/create.php
index 5e6e9600..f3f55545 100755
--- a/server/controllers/ticket/create.php
+++ b/server/controllers/ticket/create.php
@@ -79,6 +79,10 @@ class CreateController extends Controller {
'validation' => DataValidator::email(),
'error' => ERRORS::INVALID_EMAIL
];
+ $validations['requestData']['name'] = [
+ 'validation' => DataValidator::length(2, 40),
+ 'error' => ERRORS::INVALID_NAME
+ ];
}
return $validations;
diff --git a/server/controllers/user/recover-password.php b/server/controllers/user/recover-password.php
index c57ef82d..1050d82d 100755
--- a/server/controllers/user/recover-password.php
+++ b/server/controllers/user/recover-password.php
@@ -56,7 +56,7 @@ class RecoverPasswordController extends Controller {
if(!Controller::isUserSystemEnabled()) {
throw new Exception(ERRORS::USER_SYSTEM_DISABLED);
}
-
+
$this->requestData();
$this->changePassword();
}
@@ -68,7 +68,12 @@ class RecoverPasswordController extends Controller {
}
public function changePassword() {
$recoverPassword = RecoverPassword::getDataStore($this->token, 'token');
- $this->user = User::getDataStore($this->email, 'email');
+
+ if($recoverPassword->staff) {
+ $this->user = Staff::getDataStore($this->email, 'email');
+ }else {
+ $this->user = User::getDataStore($this->email, 'email');
+ }
if (!$recoverPassword->isNull() && !$this->user->isNull()) {
$recoverPassword->delete();
@@ -80,7 +85,7 @@ class RecoverPasswordController extends Controller {
$this->user->store();
$this->sendMail();
- Response::respondSuccess();
+ Response::respondSuccess(['staff' => $recoverPassword->staff]);
} else {
Response::respondError(ERRORS::NO_PERMISSION);
}
diff --git a/server/controllers/user/send-recover-password.php b/server/controllers/user/send-recover-password.php
index 93ee08a4..04619319 100755
--- a/server/controllers/user/send-recover-password.php
+++ b/server/controllers/user/send-recover-password.php
@@ -10,11 +10,12 @@ DataValidator::with('CustomValidations', true);
*
* @apiGroup User
*
- * @apiDescription This path sends a token to the email of the user to change his password.
+ * @apiDescription This path sends a token to the email of the user/staff to change his password.
*
* @apiPermission any
*
- * @apiParam {String} email The email of the user who forgot the password.
+ * @apiParam {String} email The email of the user/staff who forgot the password.
+ * @apiParam {Boolean} staff Indicates if the user is a staff member.
*
* @apiUse INVALID_EMAIL
* @apiUse USER_SYSTEM_DISABLED
@@ -30,6 +31,7 @@ class SendRecoverPasswordController extends Controller {
private $token;
private $user;
+ private $staff;
public function validations() {
return [
@@ -47,17 +49,24 @@ class SendRecoverPasswordController extends Controller {
if(!Controller::isUserSystemEnabled()) {
throw new Exception(ERRORS::USER_SYSTEM_DISABLED);
}
-
+
+ $this->staff = Controller::request('staff');
$email = Controller::request('email');
- $this->user = User::getUser($email,'email');
-
+
+ if($this->staff){
+ $this->user = Staff::getUser($email,'email');
+ }else {
+ $this->user = User::getUser($email,'email');
+ }
+
if(!$this->user->isNull()) {
$this->token = Hashing::generateRandomToken();
$recoverPassword = new RecoverPassword();
$recoverPassword->setProperties(array(
'email' => $email,
- 'token' => $this->token
+ 'token' => $this->token,
+ 'staff' => $this->staff
));
$recoverPassword->store();
@@ -67,7 +76,6 @@ class SendRecoverPasswordController extends Controller {
} else {
Response::respondError(ERRORS::INVALID_EMAIL);
}
-
}
public function sendEmail() {
diff --git a/server/libs/Date.php b/server/libs/Date.php
index 6921789f..7705ce7e 100755
--- a/server/libs/Date.php
+++ b/server/libs/Date.php
@@ -4,7 +4,7 @@ class Date {
return date('YmdHi');
}
- public static function getPreviousDate() {
- return date('YmdHi', strtotime(' -1 day '));
+ public static function getPreviousDate($days = 1) {
+ return date('YmdHi', strtotime(" -$days day "));
}
}
diff --git a/server/models/RecoverPassword.php b/server/models/RecoverPassword.php
index 1cf15f1b..9ecd2785 100755
--- a/server/models/RecoverPassword.php
+++ b/server/models/RecoverPassword.php
@@ -1,15 +1,16 @@