--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class CompanyCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\Company';
+ protected $_routeURL = 'company';
+ protected $_singular = 'company';
+ protected $_plural = 'companies';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class FluidbookQuoteCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Cubist\Backpack\Http\Controllers\Operations\ShowOperation;
+ use \App\Http\Controllers\Admin\Operations\FluidbookQuote\AssignOperation;
+ use \App\Http\Controllers\Admin\Operations\FluidbookQuote\CreateFromWebsite;
+ use \App\Http\Controllers\Admin\Operations\FluidbookQuote\ConfirmAssignmentOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\FluidbookQuote';
+ protected $_routeURL = 'fluidbook-quote';
+ protected $_singular = 'demande de devis';
+ protected $_plural = 'demandes de devis';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class LocaleCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\Locale';
+ protected $_routeURL = 'locale';
+ protected $_singular = 'langue';
+ protected $_plural = 'langues';
+ protected $_oneInstance= false;
+}
if ($quote->status == 1 && $quote->reseller == $reseller && $reseller == backpack_user()->id) {
$quote->status = 2;
$quote->save();
- Alert::add('success', 'La prise en charge de la demande de devis a été prise en compte')->flash();
+ Alert::add('success', __('La prise en charge de la demande de devis a été prise en compte'))->flash();
} else {
- Alert::add('error', 'Une erreur s\'est produite.')->flash();
+ Alert::add('error', __('Une erreur s\'est produite.'))->flash();
}
return Redirect::to('/fluidbook-quote');
}
{
$post = $this->validateCreateRequest();
if ($post === false) {
- $resp['message'] = sprintf(__("Une erreur s'est produite. Nous avons été averti de l'erreur que vous rencontrez. Vous pouvez nous contacter par e-mail à l'adresse suivante : %s"), '<a href="mailto:info@fluidbook.com">info@fluidbook.com</a>');
+ $resp['message'] = sprintf(__("Une erreur s'est produite. Nous avons été averti de l'erreur que vous rencontrez. Vous pouvez nous contacter par e-mail à l'adresse suivante : %s", [], $post['lang']), '<a href="mailto:info@fluidbook.com">info@fluidbook.com</a>');
} else {
$spam = (strlen($post['fax']) > 0);
$post['spam'] = $spam ? 'Oui' : 'Non';
$quote->save();
}
- $resp['message'] = __("Votre demande de devis a bien été envoyée. Merci pour l'intérêt que vous portez à Fluidbook.");
+ $resp['message'] = __("Votre demande de devis a bien été envoyée. Merci pour l'intérêt que vous portez à Fluidbook.", [], $post['lang']);
$quoteMail = new FluidbookQuoteReceived();
$quoteMail->setData($post);
$data = unserialize($d64);
}
if (!$data) {
- mail('tech@fluidbook.com', '[Fluidbook Workshop] Erreur envoi demande de devis', $request->get('data') . "\n\n" . utf8_decode($d64), 'From: tech@fluidbook.com');
+ mail('tech@fluidbook.com', '[Fluidbook Workshop] ' . __('Erreur envoi demande de devis'), $request->get('data') . "\n\n" . utf8_decode($d64), 'From: tech@fluidbook.com');
return false;
}
'ville' => '',
'pays' => 'INT',
'site' => '',
- 'contact_type'=>'',
+ 'contact_type' => '',
'telephone' => '',
'produits' => '',
'nombre_pages' => '',
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class QuizCrudController extends \App\Http\Controllers\Admin\Base\QuizController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\Quiz';
+ protected $_routeURL = 'quiz';
+ protected $_singular = 'quiz';
+ protected $_plural = 'quizzes';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class QuizatttemptCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+ protected $_modelNamespace = 'App\Models\QuizAttempt';
+ protected $_routeURL = 'quizatttempt';
+ protected $_singular = 'quiz attempt';
+ protected $_plural = 'quiz attempts';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class QuiztranslationCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+ protected $_modelNamespace = 'App\Models\QuizTranslation';
+ protected $_routeURL = 'quiztranslation';
+ protected $_singular = 'quiz translation';
+ protected $_plural = 'quiz translations';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class SettingsCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\Settings';
+ protected $_routeURL = 'settings';
+ protected $_singular = 'paramètre';
+ protected $_plural = 'paramètres';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class SignatureCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\Signature';
+ protected $_routeURL = 'signature';
+ protected $_singular = 'signature';
+ protected $_plural = 'signatures';
+ protected $_oneInstance= false;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class ToolboxTranslateCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\ToolboxTranslate';
+ protected $_routeURL = 'toolbox-translate';
+ protected $_singular = 'traduction';
+ protected $_plural = 'traductions';
+ protected $_oneInstance= true;
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+class UsersCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
+{
+ use \Cubedesigners\UserDatabase\Operations\LoginasOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\BulkPublishOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
+ use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+
+
+
+ protected $_modelNamespace = 'App\Models\User';
+ protected $_routeURL = 'users';
+ protected $_singular = 'user';
+ protected $_plural = 'users';
+ protected $_oneInstance= false;
+}
{
$this->from('tech@fluidbook.com');
$reseller = User::where('id', $quote->reseller)->first();
+ $resselerLocale = $reseller->locale;
$user = User::where('id', $quote->user)->first();
//$this->to($reseller->email);
$this->to('vincent+' . $quote->reseller . '@fluidbook.com');
$this->bcc('tech@fluidbook.com');
- $this->subject('[Fluidbook Workshop] Demande de devis');
+ $this->subject('[Fluidbook Workshop] ' . __('Demande de devis', [], $resselerLocale));
$confirmURL = 'http://toolbox.fluidbook.com/fluidbook-quote/' . $quote->id . '/confirm-assignment/' . $quote->reseller;
- $this->html('<html><body><h3>---- Demande ----</h3>
+ $this->html('<html><body><h3>---- ' . __('Demande', [], $resselerLocale) . ' ----</h3>
<p>' . nl2br($quote->message) . '<p>
<h3>---- Coordonnées ----</h3>
<ul>
-<li>Email : <a href="mailto:' . $user->email . '">' . $user->email . '</a></li>
-<li>Prenom : ' . $user->name . '</li>
-<li>Nom : ' . $user->lastname . '</li>
-<li>Entreprise : ' . $user->companyName . '</li>
-<li>Téléphone : ' . $user->phone . '</li>
-<li>Pays : ' . $user->address['country'] . '</li>
+<li>' . __('E-mail', [], $resselerLocale) . ' : <a href="mailto:' . $user->email . '">' . $user->email . '</a></li>
+<li>' . __('Prénom', [], $resselerLocale) . ' : ' . $user->name . '</li>
+<li>' . __('Nom', [], $resselerLocale) . ' : ' . $user->lastname . '</li>
+<li>' . __('Entreprise', [], $resselerLocale) . ' : ' . $user->companyName . '</li>
+<li>' . __('Téléphone', [], $resselerLocale) . ' : ' . $user->phone . '</li>
+<li>' . __('Pays', [], $resselerLocale) . ' : ' . $user->address['country'] . '</li>
</ul>
-<p>
-Afin de nous confirmer que vous prenez en compte cette demande, veuillez cliquer sur le lien ci-dessous :
+<p>' . __('Afin de nous confirmer que vous prenez en compte cette demande, veuillez cliquer sur le lien ci-dessous', [], $resselerLocale) . ' :
<a href="' . $confirmURL . '">' . $confirmURL . '</a>
-
</p>
-<p>Si dans un délai de deux jours ouvrés, vous n\'avez pas accepté cette demande, nous nous réservons le droit de la prendre en charge.</p></body></html>');
+<p>' . __('Si dans un délai de deux jours ouvrés, vous n\'avez pas accepté cette demande, nous nous réservons le droit de la prendre en charge.', [], $resselerLocale) . '</p></body></html>');
}
}
$this->addField('links', 'Hidden');
$this->addField('langs', 'Hidden');
- $this->addField('user', 'SelectFromModel', 'Utilisateur', ['optionsmodel' => User::class, 'attribute' => 'nameWithCompany', 'column' => true,]);
+ $this->addField('user', 'SelectFromModel', __('Utilisateur'), ['optionsmodel' => User::class, 'attribute' => 'nameWithCompany', 'column' => true,]);
$this->addField(['name' => 'created_at',
- 'label' => 'Date',
+ 'label' => __('Date'),
'type' => 'Datetime',
'filter' => true,
'column' => true,
'column_type' => 'date',
'column_format' => null]);
- $this->addField('contact_type', 'SelectFromArray', 'Type de client', ['options' => [
- 'agency' => 'Agence de communication',
- 'freelancer' => 'Freelance',
- 'company' => 'Société',
- 'other' => 'Autre',
+ $this->addField('contact_type', 'SelectFromArray', __('Type de client'), ['options' => [
+ 'agency' => __('Agence de communication'),
+ 'freelancer' => __('Freelance'),
+ 'company' => __('Société'),
+ 'other' => __('Autre'),
]]);
- $this->addField('message', 'Textarea', 'Message');
+ $this->addField('message', 'Textarea', __('Message'));
$this->addField('gclid', 'Text', 'Google Adwords ID (gclid)');
- $this->addField('coupon', 'Text', 'Coupon');
+ $this->addField('coupon', 'Text', __('Coupon'));
- $this->addField('admin', 'SelectFromModel', 'Administrateur',
+ $this->addField('admin', 'SelectFromModel', __('Administrateur'),
['optionsmodel' => User::class, 'allows_null' => true, 'attribute' => 'nameWithCompany', 'column_attribute' => 'firstname', 'column' => true, 'can' => 'fluidbook-quote:admin',]
);
- $this->addField('reseller', 'SelectFromModel', 'Confiée à',
+ $this->addField('reseller', 'SelectFromModel', __('Confiée à'),
['optionsmodel' => User::class, 'allows_null' => true, 'attribute' => 'nameWithCompany', 'column_attribute' => 'companyName', 'column' => true, 'can' => 'fluidbook-quote:admin',]);
- $this->addField('status', 'SelectFromArray', 'Status', ['options' => [
- 0 => 'Non traitée',
- 1 => 'En attente de traitement',
- 2 => 'Traitée',
+ $this->addField('status', 'SelectFromArray', __('Status'), ['options' => [
+ 0 => __('Non traitée'),
+ 1 => __('En attente de traitement'),
+ 2 => __('Traitée'),
], 'column' => true, 'filter' => true]);
- $this->addField('conversion', 'SelectFromArray', 'Conversion', ['options' => [
- 0 => 'Pas de réponse',
- 1 => 'Devis en cours',
- 2 => 'Devis refusé',
- 3 => 'Projet validé',
- 4 => 'Déjà client',
+ $this->addField('conversion', 'SelectFromArray', __('Conversion'), ['options' => [
+ 0 => __('Pas de réponse'),
+ 1 => __('Devis en cours'),
+ 2 => __('Devis refusé'),
+ 3 => __('Projet validé'),
+ 4 => __('Déjà client'),
], 'column' => true, 'can' => 'fluidbook-quote:admin', 'filter' => true]);
- $this->addField('origin_column', FluidbookQuoteOrigin::class, 'Origine', ['column' => true, 'filter' => true]);
- $this->addField('fluidbooks', 'ModelAttribute', 'Fluidbooks', ['column' => true, 'column_label' => '<img width="20" src="/images/icons/icon-fluidbook.svg">', 'attribute' => 'user.e1_ws_count']);
+ $this->addField('origin_column', FluidbookQuoteOrigin::class, __('Origine'), ['column' => true, 'filter' => true]);
+ $this->addField('fluidbooks', 'ModelAttribute', __('Fluidbooks'), ['column' => true, 'column_label' => '<img width="20" src="/images/icons/icon-fluidbook.svg">', 'attribute' => 'user.e1_ws_count']);
}
public function getOriginAttribute()
'singular' => 'quiz',
'plural' => 'quizzes'];
- protected static $_messages = ['defaultMessage' => 'Message displayed at the end of the quiz',
- 'passedMessage' => 'Message displayed when passing the quiz',
- 'failedMessage' => 'Message displayed when failing the quiz'];
-
- protected static $_colors = [
- 'mainColor' => ['label' => 'Main color', 'hint' => 'Buttons and rollovers color', 'default' => '#e7007a'],
- 'overlay' => ['label' => 'Overlay', 'hint' => 'Overlay set on the banner', 'default' => 'rgba(0,0,0,0.75)'],
- 'reviewBackground' => ['label' => 'Review panel background color', 'default' => '#262626'],
- 'okColor' => ['label' => 'OK color', 'hint' => 'Color of the ok badge (usually green)', 'default' => '#66c924'],
- 'nokColor' => ['label' => 'NOK color', 'hint' => 'Color of the not ok badge (usually red)', 'default' => '#c61e35'],
- ];
-
- protected static $_images = [
- 'logo' => 'Logo',
- 'banner' => 'Banner',
- ];
-
- protected static $_actions = [
- 'passedAction' => 'Run code when passing the quiz',
- 'failedAction' => 'Run code when failing the quiz'];
+
+ protected static function _getColors()
+ {
+ return [
+ 'mainColor' => ['label' => __('Couleur principale'), 'hint' => __('Couleur des boutons et rollovers'), 'default' => '#e7007a'],
+ 'overlay' => ['label' => __('Overlay'), 'hint' => __('Overlay posé sur la bannière'), 'default' => 'rgba(0,0,0,0.75)'],
+ 'reviewBackground' => ['label' => __('Fond du panneau du passage en revue'), 'default' => '#262626'],
+ 'okColor' => ['label' => __('Couleur OK'), 'hint' => __('Couleur des pastilles "réussi" (habituellement vert)'), 'default' => '#66c924'],
+ 'nokColor' => ['label' => __('Couleur pas OK'), 'hint' => __('Couleur des pastilles "raté" (habituellement rouge)'), 'default' => '#c61e35'],
+ ];
+ }
+
+ protected static function _getActions()
+ {
+ return [
+ 'passedAction' => __('Exécuter un code lors de la réussite du quiz'),
+ 'failedAction' => __('Exécuter un code lors de l\'échec du quiz'),
+ ];
+ }
+
+ protected static function _getMessages()
+ {
+ return [
+ 'defaultMessage' => __('Message affiché à la fin du quiz'),
+ 'passedMessage' => __('Message affiché lors de la réussite du quiz'),
+ 'failedMessage' => __('Message affiché lors de l\'échec du quiz'),
+ ];
+ }
+
+ protected static function _getImages()
+ {
+ return [
+ 'logo' => __('Logo'),
+ 'banner' => __('Bannière'),
+ ];
+ }
public function setFields()
{
parent::setFields();
$this->addField(['name' => 'client',
- 'label' => 'Client name',
+ 'label' => __('Nom du client'),
'type' => 'Text',
'column' => true,
'column_label' => 'Client',
- 'tab' => 'Project']);
+ 'tab' => __('Projet')]);
$this->addField(['name' => 'project',
- 'label' => 'Project name',
+ 'label' => __('Nom du projet'),
'type' => 'Text',
'column' => true,
- 'column_label' => 'Project',
- 'tab' => 'Project']);
+ 'column_label' => __('Projet'),
+ 'tab' => __('Projet')]);
$this->addField(['name' => 'created_at',
- 'label' => 'Created at',
+ 'label' => __('Crée le'),
'type' => 'Datetime',
'column' => true,
'column_type' => 'date',
'column_format' => null,
- 'tab' => 'Project']);
+ 'tab' => __('Projet')]);
$this->addField(['name' => 'updated_at',
- 'label' => 'Updated at',
+ 'label' => __('Mis à jour le'),
'type' => 'Hidden',
'column' => true,
'column_type' => 'date',
'column_format' => null,
- 'tab' => 'Project']);
+ 'tab' => __('Projet')]);
$this->addField(['name' => 'owner',
- 'label' => 'Owner',
+ 'label' => __('Propriétaire'),
'type' => User::class,
'column' => true,
'can' => 'toolbox:quiz:edit_ownership',
'attribute' => 'companyWithName',
- 'tab' => 'Project']);
+ 'tab' => __('Projet')]);
$this->addField(['name' => 'title',
- 'label' => 'Quiz title',
+ 'label' => __('Titre du quiz'),
'type' => 'Text',
'column' => true,
- 'tab' => 'Contents']);
+ 'tab' => __('Contenus')]);
$this->addField(['name' => 'translation',
- 'label' => 'Quiz language',
+ 'label' => __('Langue'),
'type' => 'SelectFromModel',
'optionsmodel' => QuizTranslation::class,
'attribute' => 'locale',
'column' => true,
'column_label' => '<i class="fa fa-language"></i>',
- 'tab' => 'Contents']);
+ 'tab' => __('Contenus')]);
- foreach (self::$_messages as $name => $label) {
+ foreach (self::_getMessages() as $name => $label) {
$this->addField(['name' => $name,
'label' => $label,
- 'hint' => 'Let this field empty to use the default message',
+ 'hint' => __('Laisser vide pour utiliser le message par défaut'),
'type' => 'Text',
- 'tab' => 'Contents']);
+ 'tab' => __('Contenus')]);
}
$this->addField([
'type' => 'BunchOfFieldsMultiple',
'bunch' => 'App\SubForms\Question',
'label' => '',
- 'add_label' => 'New question',
- 'tab' => 'Questions / Answers',
+ 'add_label' => __('Nouvelle question'),
+ 'tab' => __('Questions / Réponses'),
]);
$this->addField(['name' => 'scorm',
- 'label' => 'SCORM enabled',
- 'column_label' => 'SCORM',
+ 'label' => __('SCORM activé'),
+ 'column_label' => __('SCORM'),
'type' => 'Checkbox',
'column' => true,
- 'tab' => 'Settings']);
+ 'tab' => __('Paramètres')]);
$this->addField(['name' => 'threshold',
- 'label' => 'Passed threshold',
+ 'label' => __('Seuil de réussite'),
'type' => 'Integer',
'min' => 0,
'max' => 100,
- 'hint' => 'Over this score (out of 100), the quiz is passed. Set 0 to disable',
- 'tab' => 'Settings']);
+ 'hint' => __('Au dessus de ce score (sur 100), le quiz est considéré comme réussi. Indiquer 0 pour désactiver'),
+ 'tab' => __('Paramètres')]);
$this->addField(['name' => 'instantReview',
- 'label' => 'Enable instant review',
- 'hint' => 'Let the user see if he had a correct or wrong answer with a icon, just after his answer',
+ 'label' => __('Activer l\'indication de réussite instantané'),
+ 'hint' => __('Montrer une pastille à l\'utilisateur juste après sa réponse pour signaler si il a bien répondu'),
'default' => true,
'type' => 'Checkbox',
- 'tab' => 'Settings']);
+ 'tab' => __('Paramètres')]);
$this->addField(['name' => 'review',
- 'label' => 'Enable answer review',
- 'hint' => 'Let the user review his answers and the correct ones at the end of the quiz',
+ 'label' => __('Activer le passage en revue'),
+ 'hint' => __('Montrer à l\'utilisateur les bonnes réponses à la fin du quiz'),
'type' => 'SelectFromArray',
'allows_null' => false,
'options' => [
- 'always' => 'Always',
- 'passed' => 'Only if passed',
- 'never' => 'Never',
+ 'always' => __('Toujours'),
+ 'passed' => __('Seulement en cas de réussite'),
+ 'never' => __('Jamais'),
],
'options_aliases' => [
'1' => 'always',
'0' => 'never',
],
'default' => true,
- 'tab' => 'Settings']);
+ 'tab' => __('Paramètres')]);
$this->addField(['name' => 'restart_button',
- 'label' => 'Add a restart button when quiz is failed',
+ 'label' => __('Ajouter un bouton "Redémarrer" lorsque l\'utilisateur a échoué'),
'type' => 'Checkbox',
'default' => false,
- 'tab' => 'Settings',
+ 'tab' => __('Paramètres'),
]);
$this->addField(['name' => 'logattempts',
- 'label' => 'Enable logging of users attempts',
- 'hint' => 'All users attempts will be sent to the toolbox server',
+ 'label' => __('Activer l\'enregistrement des tentatives'),
+ 'hint' => __('Les tentatives seront enregistrées sur le serveur de la Toolbox'),
'type' => 'Checkbox',
'default' => false,
- 'tab' => 'Settings']);
+ 'tab' => __('Paramètres')]);
- foreach (self::$_actions as $action => $label) {
+ foreach (self::_getActions() as $action => $label) {
$this->addField(['name' => $action,
'label' => $label,
- 'hint' => 'JavaScript code',
+ 'hint' => __('Code Javascript'),
'type' => 'Textarea',
- 'tab' => 'Settings']);
+ 'tab' => __('Paramètres')
+ ]);
}
- $default = ['tab' => 'Theme', 'type' => 'Color'];
- foreach (self::$_colors as $name => $color) {
+ $default = ['tab' => __('Thème'), 'type' => 'Color'];
+ foreach (self::_getColors() as $name => $color) {
$f = array_merge($default, $color, ['name' => $name]);
$this->addField($f);
}
- $default = ['tab' => 'Theme', 'type' => 'Images', 'maxFiles' => 1];
- foreach (self::$_images as $name => $label) {
+ $default = ['tab' => __('Thème'), 'type' => 'Images', 'maxFiles' => 1];
+ foreach (self::_getImages() as $name => $label) {
$f = array_merge($default, ['name' => $name, 'label' => $label]);
$this->addField($f);
}
foreach (QuizTranslation::getTexts() as $text => $default) {
$xt->addChild($text, $translation->getAttribute($text));
}
- foreach (self::$_colors as $color => $c) {
+ foreach (self::_getColors() as $color => $c) {
$xml->addChild($color, $this->getAttribute($color));
}
- foreach (self::$_messages as $message => $m) {
+ foreach (self::_getMessages() as $message => $m) {
$xml->addChild($message, $this->getAttribute($message) ?: $translation->getAttribute($message));
}
- foreach (self::$_actions as $action => $a) {
+ foreach (self::_getActions() as $action => $a) {
$xml->addChild($action, $this->getAttribute($action));
}
$questions = $this->getAttribute('questions');
public static function getMessages()
{
- return self::$_messages;
+ return self::_getMessages();
}
public static function getColors()
{
- return self::$_colors;
+ return self::_getColors();
}
public static function getActions()
{
- return self::$_actions;
+ return self::_getActions();
}
public function canLog($user)
$this->addField(['type' => 'Number',
'name' => 'quiz',
- 'label' => 'Quiz ID']);
+ 'label' => __('Identifiant du quiz'),
+ ]);
$this->addField(['type' => 'Number',
'name' => 'score',
- 'label' => 'Score']);
+ 'label' => __('Score'),
+ ]);
$this->addField(['type' => 'Checkbox',
'name' => 'passed',
- 'label' => 'Passed']);
+ 'label' => __('Réussi'),
+ ]);
$this->addField(['type' => 'Textarea',
'name' => 'answers',
- 'label' => 'Answers']);
+ 'label' => __('Réponses'),
+ ]);
}
}
'singular' => 'quiz translation',
'plural' => 'quiz translations'];
- protected static $_texts = [
- 'validateAnswer' => 'Validate answers',
- 'validateAnswerSingular' => 'Validate answer',
- 'reviewAnswer' => 'Review answers',
- 'question' => 'Question %d:',
- 'totalQuestions' => 'Total questions:',
- 'correctAnswers' => 'Correct answers:',
- 'restartQuiz' => 'Restart the quiz'];
-
public function setFields()
{
parent::setFields();
$this->addField(['name' => 'locale',
- 'label' => 'Language',
+ 'label' => __('Langue'),
'type' => 'Locale',
'column' => true]);
- foreach (self::$_texts as $name => $default) {
+ foreach (self::getTexts() as $name => $default) {
$this->addField(['name' => $name,
- 'label' => 'Translation of « ' . $default . ' »',
+ 'label' => sprintf(__('Traduction de « %s »'), $default),
'type' => 'Text']);
}
public static function getTexts()
{
- return self::$_texts;
+ return [
+ 'validateAnswer' => 'Validate answers',
+ 'validateAnswerSingular' => 'Validate answer',
+ 'reviewAnswer' => 'Review answers',
+ 'question' => 'Question %d:',
+ 'totalQuestions' => 'Total questions:',
+ 'correctAnswers' => 'Correct answers:',
+ 'restartQuiz' => 'Restart the quiz'
+ ];
}
}
$this->addField(['name' => 'name',
'type' => 'text',
- 'label' => 'Name',
+ 'label' => __('Nom'),
'column' => true]);
$this->addField(['name' => 'active',
'type' => 'Checkbox',
'default' => true,
'column' => true,
- 'label' => 'Active']);
+ 'label' => __('Actif')]);
$this->addField(['name' => 'credits',
- 'label' => 'Credits',
+ 'label' => __('Credits'),
'type' => 'Code',
'language' => 'html',
'default' => '<a href="https://" target="_blank">Powered by _____</a>',
--- /dev/null
+<?php
+
+
+namespace App\Models;
+
+use Cubist\Backpack\Magic\Models\Translate;
+
+class ToolboxTranslate extends Translate
+{
+ protected $table = 'toolbox_translate';
+
+ protected $_options = ['name' => 'toolbox-translate',
+ 'singular' => 'traduction',
+ 'plural' => 'traductions',
+ 'oneinstance' => true];
+}
$this->addField(['name' => 'answer',
'type' => 'Text',
- 'label' => 'Answer label']);
+ 'label' => __('Texte de la réponse')
+ ]);
$this->addField(['name' => 'correct',
'type' => 'Checkbox',
- 'label' => 'Correct']);
+ 'label' => __('Réponse correct')]);
}
}
$this->addField(['name' => 'question',
'type' => 'Text',
- 'label' => 'Question label']);
+ 'label' => __('Intitulé de la question'),
+ ]);
$this->addField(['name' => 'report_label',
'type' => 'Text',
- 'label' => 'Question label in reports']);
+ 'label' => __('Intitulé de la question dans les rapports'),
+ ]);
$this->addField(['name' => 'type',
'type' => 'SelectFromArray',
- 'label' => 'Type',
+ 'label' => __('Type'),
'default' => 'multiple',
- 'options' => ['multiple' => 'Multiple choice question',
- 'text' => 'Text',
- 'textarea' => 'Long text',
- 'email' => 'E-mail']]);
+ 'options' => [
+ 'multiple' => __('Question à choix multiple'),
+ 'text' => __('Texte'),
+ 'textarea' => __('Texte long'),
+ 'email' => __('E-mail'),
+ ]]);
$this->addField(['name' => 'count_for_score',
- 'label' => 'Count for score calculation',
+ 'label' => __('Comptabiliser dans le score'),
'type' => 'Checkbox',
'default' => true]);
$this->addField(['name' => 'placeholder',
'type' => 'Text',
- 'label' => 'Placeholder',
- 'hint' => 'Text displayed in the field when empty',
+ 'label' => __('Placeholder'),
+ 'hint' => __('Texte affiché lorsque le champ n\'a pas été rempli'),
'when' => ['type' => ['text', 'textarea', 'email']]
]);
$this->addField(['name' => 'explaination',
'type' => 'Textarea',
- 'label' => 'Explanation / Answer details',
- 'hint' => 'Text displayed at review time']);
+ 'label' => __('Explication ou réponse détaillée'),
+ 'hint' => __('Texte affiché lors du passage en revue des réponses'),
+ ]);
$this->addField(['name' => 'multiple',
'type' => 'Checkbox',
- 'label' => 'Multiple answers',
+ 'label' => __('Réponses multiples'),
'when' => ['type' => 'multiple']
]);
$this->addField([
'name' => 'min_score',
'type' => 'Integer',
- 'label' => 'Minimum score to pass',
- 'hint' => '0 means that all correct answers and only correct answers must be checked in order the user passes the question.',
+ 'label' => __('Score minimum nécessaire pour réussir'),
+ 'hint' => __('0 signifie que toutes et seulement les réponses correctes doivent être cochées.'),
'default' => 0,
'when' => ['type' => 'multiple', 'multiple' => 1]
]);
'name' => 'answers',
'type' => 'BunchOfFieldsMultiple',
'bunch' => 'App\SubForms\Answer',
- 'add_label' => 'New answer',
- 'label' => 'Answers',
+ 'add_label' => __('Nouvelle réponse'),
+ 'label' => __('Réponses'),
'when' => ['type' => 'multiple']
]);
</li>
@endcan
-@can('maintenance','toolbox:translate')
+@canany('maintenance','toolbox-translate:admin')
<li class='nav-item nav-dropdown'><a class='nav-link nav-dropdown-toggle' href='#'><i
class='nav-icon la la-cogs'></i>{{__('Administration')}}</a>
<ul class='nav-dropdown-items'>
- <li class="nav-item"><a class="nav-link" href='{{ backpack_url('backup') }}'><i class='la la-hdd-o'></i>
- <span>{{__('Sauvegardes')}}</span></a>
- </li>
- <li class="nav-item"><a class="nav-link" href='{{ backpack_url('log') }}'><i class='la la-terminal'></i>
- <span>{{__('Journaux d\'erreurs')}}</span></a>
- </li>
+ @can('toolbox-translate:admin')
+ <li class="nav-item"><a class="nav-link" href='{{ backpack_url('toolbox-translate') }}'><i class='la la-language'></i>
+ <span>{{__('Traduction')}}</span></a>
+ </li>
+ @endcan
+ @can('maintenance')
+ <li class="nav-item"><a class="nav-link" href='{{ backpack_url('backup') }}'><i class='la la-hdd-o'></i>
+ <span>{{__('Sauvegardes')}}</span></a>
+ </li>
+ <li class="nav-item"><a class="nav-link" href='{{ backpack_url('log') }}'><i class='la la-terminal'></i>
+ <span>{{__('Journaux d\'erreurs')}}</span></a>
+ </li>
+ @endcan
</ul>
</li>
-@endcan
+@endcanany
'namespace' => 'App\Http\Controllers\Admin',
], function () { // custom admin routes
try {
- Route::crud('company', 'CompanyCrudController');
+ Route::crud('users', 'UsersCrudController');
+ Route::crud('company', 'CompanyCrudController');
Route::crud('fluidbook-quote', 'FluidbookQuoteCrudController');
Route::crud('locale', 'LocaleCrudController');
- Route::crud('page', 'PageCrudController');
Route::crud('quiz', 'QuizCrudController');
Route::crud('quizatttempt', 'QuizatttemptCrudController');
Route::crud('quiztranslation', 'QuiztranslationCrudController');
Route::crud('settings', 'SettingsCrudController');
Route::crud('signature', 'SignatureCrudController');
+ Route::crud('toolbox-translate', 'ToolboxTranslateCrudController');
Route::crud('users', 'UsersCrudController');
} catch(\Throwable $e) {