-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
631 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
<?php | ||
Router::connect('/support', array('controller' => 'ticket', 'action' => 'index', 'plugin' => 'support')); | ||
Router::connect('/admin/support', array('controller' => 'Ticket', 'action' => 'index', 'plugin' => 'Support', 'admin' => true)); | ||
Router::connect('/support/ajax_clos', array('controller' => 'Ticket', 'action' => 'ajax_clos', 'plugin' => 'Support', 'admin' => false)); | ||
Router::connect('/admin/support/ajax_closa', array('controller' => 'Ticket', 'action' => 'ajax_closa', 'plugin' => 'Support', 'admin' => true)); | ||
Router::connect('/admin/support/ticket/*', array('controller' => 'Ticket', 'action' => 'ticket', 'plugin' => 'Support', 'admin' => true)); | ||
Router::connect('/admin/support/ajax_replya', array('controller' => 'Ticket', 'action' => 'ajax_replya', 'plugin' => 'Support', 'admin' => true)); | ||
Router::connect('/support', array('controller' => 'Ticket', 'action' => 'index', 'plugin' => 'Support')); | ||
Router::connect('/support/ajax_create', array('controller' => 'Ticket', 'action' => 'ajax_create', 'plugin' => 'Support', 'admin' => false)); | ||
Router::connect('/support/ticket/ajax_reply', array('controller' => 'Ticket', 'action' => 'ajax_reply', 'plugin' => 'Support', 'admin' => false)); | ||
Router::connect('/support/create', array('controller' => 'Ticket', 'action' => 'create', 'plugin' => 'Support')); | ||
Router::connect('/support/ticket/*', array('controller' => 'Ticket', 'action' => 'ticket', 'plugin' => 'Support')); | ||
|
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
<?php | ||
App::uses('CakeEvent', 'Event'); | ||
|
||
class ReplyTicket extends SupportAppModel { | ||
class ReplyTicket extends AppModel { | ||
|
||
public function afterSave($created, $options = array()) { | ||
if($created) { | ||
// nouvel enregistrement | ||
$this->getEventManager()->dispatch(new CakeEvent('afterReplyToTicket', $this)); | ||
} | ||
} | ||
|
||
public function afterDelete($cascade = true) { | ||
$this->getEventManager()->dispatch(new CakeEvent('afterDeleteReply', $this)); | ||
} | ||
public $useTable = "support__reply_tickets"; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
<?php | ||
App::uses('CakeEvent', 'Event'); | ||
|
||
class Ticket extends SupportAppModel { | ||
class Ticket extends AppModel { | ||
|
||
public function afterSave($created, $options = array()) { | ||
if($created) { | ||
// nouvel enregistrement | ||
$this->getEventManager()->dispatch(new CakeEvent('afterAddTicket', $this)); | ||
} else { | ||
// on édite, donc il reviens résolu | ||
$this->getEventManager()->dispatch(new CakeEvent('afterResolveTicket', $this)); | ||
} | ||
} | ||
|
||
public function afterDelete($cascade = true) { | ||
$this->getEventManager()->dispatch(new CakeEvent('afterDeleteTicket', $this)); | ||
} | ||
public $useTable = "support__tickets"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
<?php | ||
App::import('Controller', 'TicketController'); | ||
$TicketSupport = new TicketController(); | ||
?> | ||
<section class="content"> | ||
<div class="col-md-12"> | ||
<div class="box"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title"><?= $title_for_layout; ?></h3> | ||
</div> | ||
<div class="box-body"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th><?= $Lang->get('SUPPORT__SUBJECT') ?></th> | ||
<th><?= $Lang->get('SUPPORT__AUTHOR') ?></th> | ||
<th><?= $Lang->get('SUPPORT__STATE_TITLE') ?></th> | ||
<th><?= $Lang->get('SUPPORT__CREATED') ?></th> | ||
<th><?= $Lang->get('SUPPORT__ACTIONS') ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach($tickets as $ticket): ?> | ||
<tr> | ||
<td><?= $ticket['Ticket']['subject']; ?></td> | ||
<td><?= $TicketSupport->getUser('pseudo', $ticket['Ticket']['author']); ?></td> | ||
<td> | ||
<?php | ||
switch($ticket['Ticket']['state']) | ||
{ | ||
case '0': | ||
echo '<div class="label label-warning">'.$Lang->get('SUPPORT__STATE_1').'</div>'; | ||
break; | ||
case '1': | ||
echo '<div class="label label-info">'.$Lang->get('SUPPORT__STATE_0').'</div>'; | ||
break; | ||
case '2': | ||
echo '<div class="label label-success">'.$Lang->get('SUPPORT__STATE_2').'</div>'; | ||
break; | ||
} | ||
?> | ||
</td> | ||
<td><?= date('d m Y', $ticket['Ticket']['created']); ?></td> | ||
<td> | ||
<?php if($ticket['Ticket']['state'] == 0 || $ticket['Ticket']['state'] == 1){ ?> | ||
<form method="post" class="form-horizontal" data-ajax="true" data-redirect-url="?" action="<?= $this->Html->url(array('controller' => 'Ticket', 'action' => 'ajax_closa')) ?>"> | ||
<a class="btn btn-primary" href="<?= $this->Html->url(array('plugin' => null, 'admin' => true, 'controller' => 'support', 'action' => 'ticket', $ticket['Ticket']['id'])); ?>">Voir</a> | ||
<input type="hidden" name="idTicket" value="<?= $ticket['Ticket']['id']; ?>"> | ||
<button type="submit" class="btn btn-success" href="#"><?= $Lang->get('SUPPORT__CLOSE') ?></button> | ||
</form> | ||
<?php }else{ ?> | ||
<a class="btn btn-primary" href="<?= $this->Html->url(array('plugin' => null, 'admin' => true, 'controller' => 'support', 'action' => 'ticket', $ticket['Ticket']['id'])); ?>">Voir</a> | ||
<?php }?> | ||
</td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="clearfix"></div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
App::import('Controller', 'TicketController'); | ||
$TicketSupport = new TicketController(); | ||
?> | ||
<?= $this->Html->css('Support.jquery.cleditor.css'); ?> | ||
<section class="content"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<?php if($ticket['Ticket']['state'] == 0 || $ticket['Ticket']['state'] == 1){ ?> | ||
<form method="post" class="form-horizontal" data-ajax="true" data-redirect-url="../" action="<?= $this->Html->url(array('controller' => 'Ticket', 'action' => 'ajax_closa')) ?>"> | ||
<a class="btn btn-primary" href="<?= $this->Html->url(array('controller' => 'Ticket', 'admin' => true, 'action' => 'index')) ?>"><i class="fa fa-arrow-left"></i> <?= $Lang->get('SUPPORT_BACK_TO_LIST'); ?></a> | ||
<input type="hidden" name="idTicket" value="<?= $ticket['Ticket']['id']; ?>"> | ||
<button class="btn btn-success" type="submit"><i class="fa fa-close"></i> <?= $Lang->get('SUPPORT__CLOSE'); ?></button> | ||
</form> | ||
<?php }else{ ?> | ||
<a class="btn btn-primary" href="<?= $this->Html->url(array('controller' => 'Ticket', 'admin' => true, 'action' => 'index')) ?>"><i class="fa fa-arrow-left"></i> <?= $Lang->get('SUPPORT_BACK_TO_LIST'); ?></a> | ||
<?php }?> | ||
<h2><?= $Lang->get('SUPPORT__PROBLEMQUESTION') ?> <?= $TicketSupport->getUser('pseudo', $ticket['Ticket']['author']); ?></h2> | ||
<hr style="border-top: 1px solid #dedede;"> | ||
<div class="box"> | ||
<div style="word-wrap: break-word;" class="box-body"> | ||
<?= $ticket['Ticket']['reponse_text']; ?> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-sm-12"><h2><?= $Lang->get('SUPPORT__ANSWER'); ?></h2><hr style="border-top: 1px solid #dedede;"></div> | ||
<?php foreach($answers as $answer): ?> | ||
<div class="col-sm-8 <?php if($answer['ReplyTicket']['type'] == 1){ ?>pull-right<?php }?>"> | ||
<div class="box"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title"> | ||
<?= $Lang->get('SUPPORT__ANSWERTO') ?> <?= $TicketSupport->getUser('pseudo', $answer['ReplyTicket']['author']); ?> | ||
</h3> | ||
</div> | ||
<div style="word-wrap: break-word;" class="box-body"> | ||
<?= $answer['ReplyTicket']['reply']; ?> | ||
</div> | ||
</div> | ||
</div> | ||
<?php endforeach; ?> | ||
<div class="col-sm-12"> | ||
<h2><?= $Lang->get('SUPPORT__REPLYTICKET') ?></h2> | ||
<hr style="border-top: 1px solid #dedede;"> | ||
<div class="box"> | ||
<div class="box-body"> | ||
<?php if(!$ticket['Ticket']['state'] == 2){ ?> | ||
<form method="post" class="form-horizontal" data-ajax="true" data-redirect-url="../" action="<?= $this->Html->url(array('controller' => 'Ticket', 'action' => 'ajax_replya')) ?>"> | ||
<input type="hidden" name="idTicket" value="<?= $ticket['Ticket']['id']; ?>"> | ||
<textarea id="input" name="reponse_text"></textarea> | ||
<br> | ||
<button class="btn btn-primary" type="submit"><?= $Lang->get('SUPPORT__REPLY') ?></button> | ||
</form> | ||
<?php }else{ ?> | ||
<div class="alert alert-warning"><?= $Lang->get('SUPPORT__CLOSTICKETWARNING') ?></div> | ||
<?php }?> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<?= $this->Html->script('Support.jquery.cleditor.min.js'); ?> | ||
<script>$(document).ready(function() { $("#input").cleditor(); }); </script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?= $this->Html->css('Support.jquery.cleditor.css'); ?> | ||
<div class="container"> | ||
<div class="row"> | ||
<h1 style="display: inline-block;"><?= $Lang->get('SUPPORT__CREATE') ?> - <?= $Lang->get('SUPPORT__SUPPORT') ?></h1> | ||
<hr> | ||
<form method="post" class="form-horizontal" data-ajax="true" data-redirect-url="./" action="<?= $this->Html->url(array('controller' => 'Ticket', 'action' => 'ajax_create')) ?>"> | ||
<label><?= $Lang->get('SUPPORT__SUBJECT') ?></label> | ||
<input type="text" name="subject" class="form-control"> | ||
<label><?= $Lang->get('SUPPORT__YOURPROBLEM') ?></label> | ||
<textarea id="input" name="reponse_text"></textarea> | ||
<hr> | ||
<button class="btn btn-primary" type="submit"><?= $Lang->get('SUPPORT__CREATETICKET') ?></button> | ||
</form> | ||
</div> | ||
</div> | ||
<?= $this->Html->script('Support.jquery.cleditor.min.js'); ?> | ||
<script>$(document).ready(function() { $("#input").cleditor(); }); </script> |
Oops, something went wrong.