add front-end esctruct feature #101

This commit is contained in:
Guillermo 2018-07-18 21:38:12 -03:00
parent 92012d639b
commit 305b94c567
17 changed files with 42 additions and 10 deletions

View File

@ -112,9 +112,10 @@ class TicketViewer extends React.Component {
</Button>
</div>
<div className="col-md-4">
<Button type={(ticket.closed) ? 'secondary' : 'primary'} size="extra-small" onClick={this.onCloseClick.bind(this)}>
{i18n(ticket.closed ? 'RE_OPEN' : 'CLOSE')}
</Button>
{ticket.closed ?
<Button type='secondary' size="extra-small" onClick={this.onCloseClick.bind(this)}>
{i18n('RE_OPEN')}
</Button> : i18n('OPENED')}
</div>
</div>
</div>
@ -192,7 +193,10 @@ class TicketViewer extends React.Component {
<Form {...this.getCommentFormProps()}>
<FormField name="content" validation="TEXT_AREA" required field="textarea" />
{(this.props.allowAttachments) ? <FormField name="file" field="file"/> : null}
<SubmitButton>{i18n('RESPOND_TICKET')}</SubmitButton>
<div className="ticket-viewer__response-buttons">
<SubmitButton type="secondary">{i18n('RESPOND_TICKET')}</SubmitButton>
<Button size="medium" onClick={this.onCloseTicketClick.bind(this)}>{i18n('CLOSE_TICKET')}</Button>
</div>
</Form>
</div>
{(this.state.commentError) ? this.renderCommentError() : null}
@ -354,6 +358,15 @@ class TicketViewer extends React.Component {
this.props.onChange();
}
}
onCloseTicketClick(event){
event.preventDefault();
API.call({
path: '/ticket/close',
data: {
ticketNumber: this.props.ticket.ticketNumber
}
}).then(this.onTicketModification.bind(this));
}
}
export default connect((store) => {

View File

@ -76,5 +76,11 @@
padding: 20px 0 0 20px;
text-align: left;
}
&-buttons {
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
}

View File

@ -29,6 +29,7 @@ export default {
'DATE': '日期',
'RESPOND': '響應',
'RESPOND_TICKET': '響應故障單',
'CLOSE_TICKET': '關門票',
'NO_ATTACHMENT': '沒有文件附件',
'STAFF': '員工',
'CUSTOMER': '顧客',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Datum',
'RESPOND': 'Antworten',
'RESPOND_TICKET': 'Ticket beantworten',
'CLOSE_TICKET': 'Ticket schließen',
'NO_ATTACHMENT': 'Keine Dateianlage',
'STAFF': 'Personal',
'CUSTOMER': 'Kunde',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Date',
'RESPOND': 'Respond',
'RESPOND_TICKET': 'Respond Ticket',
'CLOSE_TICKET': 'Close ticket',
'NO_ATTACHMENT': 'No file attachment',
'STAFF': 'Staff',
'CUSTOMER': 'Customer',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Fecha',
'RESPOND': 'Responder',
'RESPOND_TICKET': 'Responder Ticket',
'CLOSE_TICKET': 'Cerrar Ticket',
'NO_ATTACHMENT': 'No hay archivo adjunto',
'STAFF': 'Staff',
'CUSTOMER': 'Cliente',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Date',
'RESPOND': 'Répondre',
'RESPOND_TICKET': 'Répondre au ticket',
'CLOSE_TICKET': 'Fermer ticket',
'NO_ATTACHMENT': 'Aucune pièce jointe',
'STAFF': 'Administrateur',
'CUSTOMER': 'Client',

View File

@ -29,6 +29,7 @@
'DATE': 'Ημερομηνία',
'RESPOND': 'Απάντηση',
'RESPOND_TICKET': 'Απάντηση Εισιτηρίου',
'CLOSE_TICKET': 'κλειστό εισιτήριο',
'NO_ATTACHMENT': 'Χωρίς Συνημμένα Αρχεία',
'STAFF': 'Προσωπικό',
'CUSTOMER': 'Πελάτης',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'तारीख',
'RESPOND': 'प्रतिक्रिया',
'RESPOND_TICKET': 'प्रतिक्रिया टिकट',
'CLOSE_TICKET': 'करीबी टिकट',
'NO_ATTACHMENT': 'कोई फ़ाइल अनुलग्नक नहीं',
'STAFF': 'कर्मचारी',
'CUSTOMER': 'ग्राहक',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Data',
'RESPOND': 'Rispondi',
'RESPOND_TICKET': 'Rispondi al ticket',
'CLOSE_TICKET': 'Ticket vicino',
'NO_ATTACHMENT': 'Nessun file allegato',
'STAFF': 'Staff',
'CUSTOMER': 'Customer',

View File

@ -29,6 +29,7 @@ export default {
'DATE': '日付',
'RESPOND': '応答する',
'RESPOND_TICKET': 'チケット応答',
'CLOSE_TICKET': 'クローズチケット',
'NO_ATTACHMENT': '添付ファイルがありません',
'STAFF': 'スタッフ',
'CUSTOMER': '顧客',
@ -180,7 +181,7 @@ export default {
'STAFF_UPDATED': 'スタッフメンバーが更新されました',
'UPDATE': '更新',
'NEVER': '決して',
'CHART_CREATE_TICKET': '作成されたチケット',
'CHART_CLOSE': 'チケットが閉じられました',
'CHART_SIGNUP': 'サインアップ',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Datum',
'RESPOND': 'Actie',
'RESPOND_TICKET': 'Reageren',
'CLOSE_TICKET': 'Sluit ticket',
'NO_ATTACHMENT': 'Geen bijlage',
'STAFF': 'Management',
'CUSTOMER': 'Klant',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Encontro',
'RESPOND': 'Responder',
'RESPOND_TICKET': 'Respond Ticket',
'CLOSE_TICKET': 'Fechar passagem',
'NO_ATTACHMENT': 'Nenhum anexo de arquivo',
'STAFF': 'Funcionários',
'CUSTOMER': 'Cliente',

View File

@ -29,6 +29,7 @@ export default {
'DATE': 'Дата',
'RESPOND': 'Отвечать',
'RESPOND_TICKET': 'Ответить билет',
'CLOSE_TICKET': 'закрыть билет',
'NO_ATTACHMENT': 'Нет вложений файлов',
'STAFF': 'Сотрудники',
'CUSTOMER': 'Клиент',

View File

@ -18,7 +18,7 @@ export default {
'NEW_PASSWORD': 'Yeni Şifre',
'REPEAT_NEW_PASSWORD': 'Yeni şifreyi tekrar girin',
'BACK_LOGIN_FORM': 'Giriş formuna geri dön',
'VIEW_ARTICLES': ' Makaleleri Görüntüle',
'VIEW_ARTICLES': 'Makaleleri Görüntüle',
'EDIT_PROFILE': 'Profili Düzenle',
'CLOSE_SESSION': 'Oturumu kapat',
'CREATE_TICKET': 'Bilet Oluştur',
@ -29,6 +29,7 @@ export default {
'DATE': 'Tarih',
'RESPOND': 'Yanıtla',
'RESPOND_TICKET': 'Bilete Gider',
'CLOSE_TICKET': 'Yakın bilet',
'NO_ATTACHMENT': 'Dosya eki yok',
'STAFF': 'Personel',
'CUSTOMER': 'Müşteri',

View File

@ -45,7 +45,7 @@ class UnAssignStaffController extends Controller {
$ticket = Ticket::getByTicketNumber($ticketNumber);
$owner = $ticket->owner;
if(($owner && $owner->id === $user->id) || $user->level > 1) {
if(($owner && $owner->id === $user->id) || $user->level > 2) {
$owner->sharedTicketList->remove($ticket);
$owner->store();

View File

@ -17,7 +17,7 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiUse NO_PERMISSION
* @apiUse INVALID_TICKET
*
*
* @apiSuccess {Object} data Empty object
*
*/
@ -89,4 +89,4 @@ class ReOpenController extends Controller {
$this->ticket->addEvent($event);
}
}
}