Update v1.0.6

This commit is contained in:
Bhanu Slathia
2016-02-16 23:22:09 +05:30
parent 62d04a0372
commit c710c20b9e
7620 changed files with 244752 additions and 1070312 deletions

6
.env
View File

@@ -2,9 +2,15 @@ APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
<<<<<<< Updated upstream
DB_DATABASE=faveo1.0.6
DB_USERNAME=root
DB_PASSWORD=
=======
DB_DATABASE=faveo-github
DB_USERNAME=bhanu
DB_PASSWORD=bhanu
>>>>>>> Stashed changes
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

View File

@@ -0,0 +1,333 @@
<?php
namespace App\Http\Controllers\Common;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Phpmailer\PHPMailerautoload;
use Illuminate\Http\Request;
use Auth;
use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Settings\Email;
use App\User;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Agent\Department;
class PhpMailController extends Controller {
public function fetch_smtp_details($id) {
$emails = Emails::where('id', '=', $id)->first();
return $emails;
}
/**
* Sending emails from the system.
*
* @return Mail
*/
public function sendmail($from, $to, $message, $template_variables) {
// dd($from);
$from_address = $this->fetch_smtp_details($from);
// dd($from_address);
$username = $from_address->email_address;
$fromname = $from_address->email_name;
$password = \Crypt::decrypt($from_address->password);
$smtpsecure = $from_address->sending_encryption;
$host = $from_address->sending_host;
$port = $from_address->sending_port;
if (isset($to['email'])) {
$recipants = $to['email'];
} else {
$recipants = null;
}
if (isset($to['name'])) {
$recipantname = $to['name'];
} else {
$recipantname = null;
}
if (isset($to['cc'])) {
$cc = $to['cc'];
} else {
$cc = null;
}
if (isset($to['bc'])) {
$bc = $to['bc'];
} else {
$bc = null;
}
if (isset($message['subject'])) {
$subject = $message['subject'];
} else {
$subject = null;
}
if (isset($message['body'])) {
$content = $message['body'];
} else {
$content = null;
}
if (isset($message['scenario'])) {
$template = $message['scenario'];
} else {
$template = null;
}
if (isset($message['attachments'])) {
$attachment = $message['attachments'];
} else {
$attachment = null;
}
// template variables
if (Auth::user()) {
$agent = Auth::user()->user_name;
} else {
$agent = null;
}
if (isset($template_variables['ticket_agent_name'])) {
$ticket_agent_name = $template_variables['ticket_agent_name'];
} else {
$ticket_agent_name = null;
}
if (isset($template_variables['ticket_number'])) {
$ticket_number = $template_variables['ticket_number'];
} else {
$ticket_number = null;
}
if (isset($template_variables['ticket_client_name'])) {
$ticket_client_name = $template_variables['ticket_client_name'];
} else {
$ticket_client_name = null;
}
if (isset($template_variables['ticket_client_email'])) {
$ticket_client_email = $template_variables['ticket_client_email'];
} else {
$ticket_client_email = null;
}
if (isset($template_variables['ticket_body'])) {
$ticket_body = $template_variables['ticket_body'];
} else {
$ticket_body = null;
}
if (isset($template_variables['ticket_assigner'])) {
$ticket_assigner = $template_variables['ticket_assigner'];
} else {
$ticket_assigner = null;
}
if (isset($template_variables['ticket_link_with_number'])) {
$ticket_link_with_number = $template_variables['ticket_link_with_number'];
} else {
$ticket_link_with_number = null;
}
// if (isset($template_variables['system_from'])) {
// $system_from = $template_variables['system_from'];
// } else {
// $system_from = null;
// }
if (isset($template_variables['system_link'])) {
$system_link = $template_variables['system_link'];
} else {
$system_link = null;
}
if (isset($template_variables['system_error'])) {
$system_error = $template_variables['system_error'];
} else {
$system_error = null;
}
if (isset($template_variables['agent_sign'])) {
$agent_sign = $template_variables['agent_sign'];
} else {
$agent_sign = null;
}
if (isset($template_variables['department_sign'])) {
$department_sign = $template_variables['department_sign'];
} else {
$department_sign = null;
}
if (isset($template_variables['password_reset_link'])) {
$password_reset_link = $template_variables['password_reset_link'];
} else {
$password_reset_link = null;
}
if (isset($template_variables['user_password'])) {
$user_password = $template_variables['user_password'];
} else {
$user_password = null;
}
if (isset($template_variables['email_address'])) {
$email_address = $template_variables['email_address'];
} else {
$email_address = null;
}
if (isset($template_variables['user'])) {
$user = $template_variables['user'];
} else {
$user = null;
}
$system_link = url('/');
$system_from = $this->company();
$mail = new \PHPMailer;
$status = \DB::table('settings_email')->first();
$path2 = \Config::get('view.paths');
$directory = $path2[0] . '\emails' . DIRECTORY_SEPARATOR . $status->template . DIRECTORY_SEPARATOR;
$handle = fopen($directory . $template . '.blade.php', "r");
$contents = fread($handle, filesize($directory . $template . '.blade.php'));
fclose($handle);
$variables = array('{!!$user!!}', '{!!$agent!!}', '{!!$ticket_number!!}', '{!!$content!!}', '{!!$from!!}', '{!!$ticket_agent_name!!}', '{!!$ticket_client_name!!}', '{!!$ticket_client_email!!}', '{!!$ticket_body!!}', '{!!$ticket_assigner!!}', '{!!$ticket_link_with_number!!}', '{!!$system_error!!}', '{!!$agent_sign!!}', '{!!$department_sign!!}', '{!!$password_reset_link!!}', '{!!$email_address!!}', '{!!$user_password!!}', '{!!$system_from!!}', '{!!$system_link!!}');
$data = array($user, $agent, $ticket_number, $content, $from, $ticket_agent_name, $ticket_client_name, $ticket_client_email, $ticket_body, $ticket_assigner, $ticket_link_with_number, $system_error, $agent_sign, $department_sign, $password_reset_link, $email_address, $user_password, $system_from, $system_link);
// dd($variables,$data,$contents);
// $messagebody = str_replace($variables, $data, $contents);
foreach ($variables as $key => $variable) {
$messagebody = str_replace($variables[$key], $data[$key], $contents);
// dd($messagebody);
$contents = $messagebody;
}
// dd($messagebody);
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = $host; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $username; // SMTP username
$mail->Password = $password; // SMTP password
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
$mail->Port = $port; // TCP port to connect to
$mail->setFrom($username, $fromname);
$mail->addAddress($recipants); // Add a recipient
// Name is optional
// $mail->addReplyTo('sada059@gmail.com', 'Information');
// Optional name
$mail->isHTML(true); // Set email format to HTML
if ($cc != null) {
foreach ($cc as $collaborator) {
//mail to collaborators
$collab_user_id = $collaborator->user_id;
$user_id_collab = User::where('id', '=', $collab_user_id)->first();
$collab_email = $user_id_collab->email;
$mail->addCC($collab_email);
}
}
$mail->addBCC($bc);
if ($attachment != null) {
$size = sizeOf($message['attachments']);
$attach = $message['attachments'];
for ($i = 0; $i < $size; $i++) {
$file_path = $attach[$i]->getRealPath();
$file_name = $attach[$i]->getClientOriginalName();
$mail->addAttachment($file_path, $file_name);
}
}
$mail->Subject = $subject;
if ($template == 'ticket-reply-agent') {
$line = "---Reply above this line--- <br/><br/>";
$mail->Body = $line . $messagebody;
} else {
$mail->Body = $messagebody;
}
// $mail->AltBody = $altbody;
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
}
/**
* Fetching comapny name to send mail
* @return type
*/
public function company() {
$company = Company::Where('id', '=', '1')->first();
if ($company->company_name == null) {
$company = "Support Center";
} else {
$company = $company->company_name;
}
return $company;
}
// public function testmail($host = '', $username = '', $password = '', $smtpsecure = '', $port = '', $from = '', $recipants = '', $subject = '', $scenario = '', $cc = '', $bc = '', $ishtml = '', $altbody = '', $attachment = '', $agent = '', $ticket_number = '', $content = '') {
// $mail = new \PHPMailer;
// $status = \DB::table('settings_email')->first();
// $path = '../resources/views/emails/';
// $default = $status->template . '/';
// $directory = $path . $default;
// $template = "Admin_mail.blade.php";
// $handle = fopen($directory . $template, "r");
// $contents = fread($handle, filesize($directory . $template));
// fclose($handle);
// if ($template == 'Admin_mail.blade.php') {
// $variables = array('{!! $agent !!}', '{!! $ticket_number !!}', '{!! $name !!}', '{!! $email !!}', '{!! $content !!}', '{!! $from !!}');
// $data = array('sada', '12345', 'rahul', 'rahul@test.com', 'DemoContent', 'testing');
// $messagebody = str_replace($variables, $data, $contents);
// }
// //$mail->SMTPDebug = 3; // Enable verbose debug output
// $mail->isSMTP(); // Set mailer to use SMTP
// $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
// $mail->SMTPAuth = true; // Enable SMTP authentication
// $mail->Username = 'sujitprasad4567@gmail.com'; // SMTP username
// $mail->Password = 'pankajprasad22.'; // SMTP password
// $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
// $mail->Port = 587; // TCP port to connect to
// $mail->setFrom('sujitprasad4567@gmail.com', 'Mailer');
// $mail->addAddress('sada059@gmail.com', 'Joe User'); // Add a recipient
// // Name is optional
// $mail->addReplyTo('sada059@gmail.com', 'Information');
// // Optional name
// $mail->isHTML(true); // Set email format to HTML
// $mail->addCC('cc@example.com');
// $mail->addBCC('bcc@example.com');
// $mail->addAttachment($attachment);
// $mail->Subject = 'Here is the subject';
// $mail->Body = $messagebody;
// $mail->AltBody = $altbody;
// if (!$mail->send()) {
// echo 'Message could not be sent.';
// echo 'Mailer Error: ' . $mail->ErrorInfo;
// } else {
// echo 'Message has been sent';
// }
// }
/**
* Function to choose from address
* @param type Reg $reg
* @param type Department $dept_id
* @return type integer
*/
public function mailfrom($reg, $dept_id) {
$email = Email::where('id', '=', '1')->first();
if ($reg == 1) {
return $email->sys_email;
} elseif ($dept_id > 0) {
$department = Department::where('id', '=', $dept_id)->first();
if ($department->outgoing_email) {
return $department->outgoing_email;
} else {
return $email->sys_email;
}
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Middleware;
use Closure;
use App\Model\helpdesk\Settings\System;
class ApiKey {
public $setting;
public function __construct() {
$setting = new System();
$this->setting = $setting;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next) {
$set = $this->setting->where('id', '1')->first();
if ($set->api_enable == 1) {
$key = $set->api_key;
if ($key == $request->input('api-key')) {
return $next($request);
} else {
$result = 'wrong api key';
return response()->json(compact('result'));
}
} else {
$result = 'please enable api';
return response()->json(compact('result'));
}
}
}

6
config/filemanager.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
return [
// needs to be set in filemanager.config.js too
'folder_path' => "filemanager/userfiles/"
];

18
config/image.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd'
);

144
config/jwt.php Normal file
View File

@@ -0,0 +1,144 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| JWT Authentication Secret
|--------------------------------------------------------------------------
|
| Don't forget to set this, as it will be used to sign your tokens.
| A helper command is provided for this: `php artisan jwt:generate`
|
*/
'secret' => env('JWT_SECRET', 'changeme'),
/*
|--------------------------------------------------------------------------
| JWT time to live
|--------------------------------------------------------------------------
|
| Specify the length of time (in minutes) that the token will be valid for.
| Defaults to 1 hour
|
*/
'ttl' => 60,
/*
|--------------------------------------------------------------------------
| Refresh time to live
|--------------------------------------------------------------------------
|
| Specify the length of time (in minutes) that the token can be refreshed
| within. I.E. The user can refresh their token within a 2 week window of
| the original token being created until they must re-authenticate.
| Defaults to 2 weeks
|
*/
'refresh_ttl' => 20160,
/*
|--------------------------------------------------------------------------
| JWT hashing algorithm
|--------------------------------------------------------------------------
|
| Specify the hashing algorithm that will be used to sign the token.
|
| See here: https://github.com/namshi/jose/tree/2.2.0/src/Namshi/JOSE/Signer
| for possible values
|
*/
'algo' => 'HS256',
/*
|--------------------------------------------------------------------------
| User Model namespace
|--------------------------------------------------------------------------
|
| Specify the full namespace to your User model.
| e.g. 'Acme\Entities\User'
|
*/
'user' => 'App\User',
/*
|--------------------------------------------------------------------------
| User identifier
|--------------------------------------------------------------------------
|
| Specify a unique property of the user that will be added as the 'sub'
| claim of the token payload.
|
*/
'identifier' => 'id',
/*
|--------------------------------------------------------------------------
| Required Claims
|--------------------------------------------------------------------------
|
| Specify the required claims that must exist in any token.
| A TokenInvalidException will be thrown if any of these claims are not
| present in the payload.
|
*/
'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'],
/*
|--------------------------------------------------------------------------
| Blacklist Enabled
|--------------------------------------------------------------------------
|
| In order to invalidate tokens, you must have the the blacklist enabled.
| If you do not want or need this functionality, then set this to false.
|
*/
'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Providers
|--------------------------------------------------------------------------
|
| Specify the various providers used throughout the package.
|
*/
'providers' => [
/*
|--------------------------------------------------------------------------
| User Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to find the user based
| on the subject claim
|
*/
'user' => 'Tymon\JWTAuth\Providers\User\EloquentUserAdapter',
/*
|--------------------------------------------------------------------------
| JWT Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to create and decode the tokens.
|
*/
'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter',
/*
|--------------------------------------------------------------------------
| Authentication Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to authenticate users.
|
*/
'auth' => function ($app) {
return new Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter($app['auth']);
},
/*
|--------------------------------------------------------------------------
| Storage Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to store tokens in the blacklist
|
*/
'storage' => function ($app) {
return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app['cache']);
}
]
];

43
config/lfm.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
return [
'rename_file' => true,
'use_package_routes' => true,
'middlewares' => ['auth'],
'allow_multi_user' => true,
'user_field' => 'id',
'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',
'images_dir' => 'public/photos/',
'images_url' => '%url%',
'files_dir' => 'public/files/',
'files_url' => '/files/',
'file_type_array' => [
'pdf' => 'Adobe Acrobat',
'docx' => 'Microsoft Word',
'docx' => 'Microsoft Word',
'xls' => 'Microsoft Excel',
'xls' => 'Microsoft Excel',
'zip' => 'Archive',
'gif' => 'GIF Image',
'jpg' => 'JPEG Image',
'jpeg' => 'JPEG Image',
'png' => 'PNG Image',
'ppt' => 'Microsoft PowerPoint',
'pptx' => 'Microsoft PowerPoint',
],
'file_icon_array' => [
'pdf' => 'fa-file-pdf-o',
'docx' => 'fa-file-word-o',
'docx' => 'fa-file-word-o',
'xls' => 'fa-file-excel-o',
'xls' => 'fa-file-excel-o',
'zip' => 'fa-file-archive-o',
'gif' => 'fa-file-image-o',
'jpg' => 'fa-file-image-o',
'jpeg' => 'fa-file-image-o',
'png' => 'fa-file-image-o',
'ppt' => 'fa-file-powerpoint-o',
'pptx' => 'fa-file-powerpoint-o',
],
];

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateBanlistTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('banlist', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('ban_status');
$table->string('email_address');
$table->string('internal_notes');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('banlist');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCannedResponseTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('canned_response', function(Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned()->index('user_id');
$table->string('title');
$table->text('message', 65535);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('canned_response');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCustomFormFieldsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('custom_form_fields', function(Blueprint $table)
{
$table->increments('id');
$table->integer('forms_id');
$table->string('label');
$table->string('name');
$table->string('type');
$table->string('value');
$table->string('required');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('custom_form_fields');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCustomFormsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('custom_forms', function(Blueprint $table)
{
$table->increments('id');
$table->string('formname');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('custom_forms');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDateFormatTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('date_format', function(Blueprint $table)
{
$table->increments('id');
$table->string('format');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('date_format');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDateTimeFormatTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('date_time_format', function(Blueprint $table)
{
$table->increments('id');
$table->string('format');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('date_time_format');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDepartmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('department', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('type');
$table->integer('sla')->unsigned()->nullable()->index('sla');
$table->integer('manager')->unsigned()->nullable()->index('manager_2');
$table->string('ticket_assignment');
$table->string('outgoing_email');
$table->string('template_set');
$table->string('auto_ticket_response');
$table->string('auto_message_response');
$table->string('auto_response_email');
$table->string('recipient');
$table->string('group_access');
$table->string('department_sign');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('department');
}
}

View File

@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateEmailsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('emails', function(Blueprint $table)
{
$table->increments('id');
$table->string('email_address');
$table->string('email_name');
$table->integer('department')->unsigned()->nullable();
$table->integer('priority')->unsigned()->nullable()->index('priority');
$table->integer('help_topic')->unsigned()->nullable()->index('help_topic');
$table->string('user_name');
$table->string('password');
$table->string('fetching_host');
$table->string('fetching_port');
$table->string('mailbox_protocol');
$table->string('imap_config');
$table->string('folder');
$table->string('sending_host');
$table->string('sending_port');
$table->string('sending_encryption');
$table->string('internal_notes');
$table->boolean('auto_response');
$table->boolean('fetching_status');
$table->boolean('move_to_folder');
$table->boolean('delete_email');
$table->boolean('do_nothing');
$table->boolean('sending_status');
$table->boolean('authentication');
$table->boolean('header_spoofing');
$table->timestamps();
$table->index(['department','priority','help_topic'], 'department');
$table->index(['department','priority','help_topic'], 'department_2');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('emails');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateGroupAssignDepartmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('group_assign_department', function(Blueprint $table)
{
$table->increments('id');
$table->integer('group_id')->unsigned()->index('group_id');
$table->integer('department_id')->unsigned()->index('department_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('group_assign_department');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateGroupsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('groups', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->boolean('group_status');
$table->boolean('can_create_ticket');
$table->boolean('can_edit_ticket');
$table->boolean('can_post_ticket');
$table->boolean('can_close_ticket');
$table->boolean('can_assign_ticket');
$table->boolean('can_transfer_ticket');
$table->boolean('can_delete_ticket');
$table->boolean('can_ban_email');
$table->boolean('can_manage_canned');
$table->boolean('can_manage_faq');
$table->boolean('can_view_agent_stats');
$table->boolean('department_access');
$table->string('admin_notes');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('groups');
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateHelpTopicTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('help_topic', function(Blueprint $table)
{
$table->increments('id');
$table->string('topic');
$table->string('parent_topic');
$table->integer('custom_form')->unsigned()->nullable()->index('custom_form');
$table->integer('department')->unsigned()->nullable()->index('department');
$table->integer('ticket_status')->unsigned()->nullable()->index('ticket_status');
$table->integer('priority')->unsigned()->nullable()->index('priority');
$table->integer('sla_plan')->unsigned()->nullable()->index('sla_plan');
$table->string('thank_page');
$table->string('ticket_num_format');
$table->string('internal_notes');
$table->boolean('status');
$table->boolean('type');
$table->integer('auto_assign')->unsigned()->nullable()->index('auto_assign_2');
$table->boolean('auto_response');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('help_topic');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbArticleRelationshipTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_article_relationship', function(Blueprint $table)
{
$table->increments('id');
$table->integer('article_id')->unsigned()->index('article_relationship_article_id_foreign');
$table->integer('category_id')->unsigned()->index('article_relationship_category_id_foreign');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_article_relationship');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbArticleTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_article', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->text('description', 65535);
$table->boolean('status');
$table->boolean('type');
$table->dateTime('publish_time')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_article');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbCategoryTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_category', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->text('description', 65535);
$table->boolean('status');
$table->integer('parent');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_category');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbCommentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_comment', function(Blueprint $table)
{
$table->increments('id');
$table->integer('article_id')->unsigned()->index('comment_article_id_foreign');
$table->string('name');
$table->string('email');
$table->string('website');
$table->string('comment');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_comment');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbPagesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_pages', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->boolean('status');
$table->boolean('visibility');
$table->string('slug');
$table->text('description', 65535);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_pages');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateKbSettingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kb_settings', function(Blueprint $table)
{
$table->increments('id');
$table->integer('pagination');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('kb_settings');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateLanguagesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('languages', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('locale');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('languages');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateLogNotificationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('log_notification', function(Blueprint $table)
{
$table->increments('id');
$table->string('log');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('log_notification');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateMailboxProtocolTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mailbox_protocol', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('value', 50)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('mailbox_protocol');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateOrganizationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('organization', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('phone');
$table->string('website');
$table->string('address');
$table->integer('head')->unsigned()->nullable()->index('head');
$table->string('internal_notes');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('organization');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePasswordResetsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function(Blueprint $table)
{
$table->string('email')->index();
$table->string('token')->index();
$table->dateTime('created_at')->default('0000-00-00 00:00:00');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('password_resets');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePluginsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('plugins', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('path');
$table->integer('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('plugins');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSendMailTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('send_mail', function(Blueprint $table)
{
$table->increments('id');
$table->string('driver');
$table->string('host');
$table->string('port');
$table->string('encryption');
$table->string('name');
$table->string('email');
$table->string('password');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('send_mail');
}
}

View File

@@ -0,0 +1,62 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsAlertNoticeTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_alert_notice', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('ticket_status');
$table->boolean('ticket_admin_email');
$table->boolean('ticket_department_manager');
$table->boolean('ticket_department_member');
$table->boolean('ticket_organization_accmanager');
$table->boolean('message_status');
$table->boolean('message_last_responder');
$table->boolean('message_assigned_agent');
$table->boolean('message_department_manager');
$table->boolean('message_organization_accmanager');
$table->boolean('internal_status');
$table->boolean('internal_last_responder');
$table->boolean('internal_assigned_agent');
$table->boolean('internal_department_manager');
$table->boolean('assignment_status');
$table->boolean('assignment_assigned_agent');
$table->boolean('assignment_team_leader');
$table->boolean('assignment_team_member');
$table->boolean('transfer_status');
$table->boolean('transfer_assigned_agent');
$table->boolean('transfer_department_manager');
$table->boolean('transfer_department_member');
$table->boolean('overdue_status');
$table->boolean('overdue_assigned_agent');
$table->boolean('overdue_department_manager');
$table->boolean('overdue_department_member');
$table->boolean('system_error');
$table->boolean('sql_error');
$table->boolean('excessive_failure');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_alert_notice');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsAutoResponseTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_auto_response', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('new_ticket');
$table->boolean('agent_new_ticket');
$table->boolean('submitter');
$table->boolean('participants');
$table->boolean('overlimit');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_auto_response');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsCompanyTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_company', function(Blueprint $table)
{
$table->increments('id');
$table->string('company_name');
$table->string('website');
$table->string('phone');
$table->string('address');
$table->string('landing_page');
$table->string('offline_page');
$table->string('thank_page');
$table->string('logo');
$table->string('use_logo');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_company');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsEmailTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_email', function(Blueprint $table)
{
$table->increments('id');
$table->string('template');
$table->string('sys_email')->nullable();
$table->string('alert_email');
$table->string('admin_email');
$table->string('mta');
$table->boolean('email_fetching');
$table->boolean('notification_cron');
$table->boolean('strip');
$table->boolean('separator');
$table->boolean('all_emails');
$table->boolean('email_collaborator');
$table->boolean('attachment');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_email');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsRatingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_ratings', function(Blueprint $table)
{
$table->increments('id');
$table->string('rating_name');
$table->integer('publish');
$table->integer('modify');
$table->string('slug')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_ratings');
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsSystemTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_system', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('status');
$table->string('url');
$table->string('name');
$table->string('department');
$table->string('page_size');
$table->string('log_level');
$table->string('purge_log');
$table->integer('api_enable');
$table->string('api_key');
$table->string('name_format');
$table->integer('time_farmat')->unsigned()->nullable()->index('time_farmat');
$table->integer('date_format')->unsigned()->nullable()->index('date_format');
$table->integer('date_time_format')->unsigned()->nullable()->index('date_time_format');
$table->string('day_date_time');
$table->integer('time_zone')->unsigned()->nullable()->index('time_zone');
$table->string('content');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_system');
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsTicketTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings_ticket', function(Blueprint $table)
{
$table->increments('id');
$table->string('num_format');
$table->string('num_sequence');
$table->string('priority');
$table->string('sla');
$table->string('help_topic');
$table->string('max_open_ticket');
$table->string('collision_avoid');
$table->string('captcha');
$table->boolean('status');
$table->boolean('claim_response');
$table->boolean('assigned_ticket');
$table->boolean('answered_ticket');
$table->boolean('agent_mask');
$table->boolean('html');
$table->boolean('client_update');
$table->boolean('max_file_size');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings_ticket');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSlaPlanTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sla_plan', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('grace_period');
$table->string('admin_note');
$table->boolean('status');
$table->boolean('transient');
$table->boolean('ticket_overdue');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sla_plan');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTeamAssignAgentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('team_assign_agent', function(Blueprint $table)
{
$table->increments('id');
$table->integer('team_id')->unsigned()->nullable()->index('team_id');
$table->integer('agent_id')->unsigned()->nullable()->index('agent_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('team_assign_agent');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTeamsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('teams', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->boolean('status');
$table->integer('team_lead')->unsigned()->nullable()->index('team_lead');
$table->boolean('assign_alert');
$table->string('admin_notes');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('teams');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTemplateTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('template', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->boolean('status');
$table->string('template_set_to_clone');
$table->string('language');
$table->string('internal_note');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('template');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketAttachmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_attachment', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->integer('thread_id')->unsigned()->nullable()->index('thread_id');
$table->string('size');
$table->string('type');
$table->string('poster');
$table->timestamps();
$table->binary('file', 65535)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_attachment');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketCollaboratorTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_collaborator', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('isactive');
$table->integer('ticket_id')->unsigned()->nullable()->index('ticket_id');
$table->integer('user_id')->unsigned()->nullable()->index('user_id');
$table->string('role');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_collaborator');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketFormDataTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_form_data', function(Blueprint $table)
{
$table->increments('id');
$table->integer('ticket_id')->unsigned()->nullable()->index('ticket_id');
$table->text('title', 65535);
$table->text('content', 65535);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_form_data');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketPriorityTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_priority', function(Blueprint $table)
{
$table->increments('priority_id');
$table->string('priority');
$table->string('priority_desc');
$table->string('priority_color');
$table->boolean('priority_urgency');
$table->boolean('ispublic');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_priority');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketSourceTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_source', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('value');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_source');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketStatusTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_status', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('state');
$table->integer('mode');
$table->string('message');
$table->integer('flags');
$table->integer('sort');
$table->string('properties');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_status');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketThreadTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ticket_thread', function(Blueprint $table)
{
$table->increments('id');
$table->integer('ticket_id')->unsigned()->nullable()->index('ticket_id_2');
$table->integer('user_id')->unsigned()->nullable()->index('user_id');
$table->string('poster');
$table->integer('source')->unsigned()->nullable()->index('source');
$table->boolean('is_internal');
$table->string('title');
$table->text('body', 65535);
$table->string('format');
$table->string('ip_address');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ticket_thread');
}
}

View File

@@ -0,0 +1,62 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTicketsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tickets', function(Blueprint $table)
{
$table->increments('id');
$table->string('ticket_number');
$table->integer('user_id')->unsigned()->nullable()->index('user_id');
$table->integer('dept_id')->unsigned()->nullable()->index('dept_id');
$table->integer('team_id')->unsigned()->nullable()->index('team_id');
$table->integer('priority_id')->unsigned()->nullable()->index('priority_id');
$table->integer('sla')->unsigned()->nullable()->index('sla');
$table->integer('help_topic_id')->unsigned()->nullable()->index('help_topic_id');
$table->integer('status')->unsigned()->nullable()->index('status');
$table->boolean('rating');
$table->boolean('ratingreply');
$table->integer('flags');
$table->integer('ip_address');
$table->integer('assigned_to')->unsigned()->nullable()->index('assigned_to');
$table->integer('lock_by');
$table->dateTime('lock_at')->nullable();
$table->integer('source')->unsigned()->nullable()->index('source');
$table->integer('isoverdue');
$table->integer('reopened');
$table->integer('isanswered');
$table->integer('html');
$table->integer('is_deleted');
$table->integer('closed');
$table->boolean('is_transferred');
$table->dateTime('transferred_at');
$table->dateTime('reopened_at')->nullable();
$table->dateTime('duedate')->nullable();
$table->dateTime('closed_at')->nullable();
$table->dateTime('last_message_at')->nullable();
$table->dateTime('last_response_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tickets');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTimeFormatTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('time_format', function(Blueprint $table)
{
$table->increments('id');
$table->string('format');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('time_format');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTimezoneTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('timezone', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('location');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('timezone');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUserAssignOrganizationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_assign_organization', function(Blueprint $table)
{
$table->increments('id');
$table->integer('org_id')->unsigned()->nullable()->index('org_id');
$table->integer('user_id')->unsigned()->nullable()->index('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('user_assign_organization');
}
}

View File

@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->string('user_name');
$table->string('first_name');
$table->string('last_name');
$table->boolean('gender');
$table->string('email')->unique();
$table->boolean('ban');
$table->string('password', 60);
$table->integer('active');
$table->string('ext');
$table->string('phone_number');
$table->string('mobile');
$table->text('agent_sign', 65535);
$table->string('account_type');
$table->string('account_status');
$table->integer('assign_group')->unsigned()->nullable()->index('assign_group_3');
$table->integer('primary_dpt')->unsigned()->nullable()->index('primary_dpt_2');
$table->string('agent_tzone');
$table->string('daylight_save');
$table->string('limit_access');
$table->string('directory_listing');
$table->string('vacation_mode');
$table->string('company');
$table->string('role');
$table->string('internal_note');
$table->string('profile_pic');
$table->string('remember_token', 100)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateVersionCheckTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('version_check', function(Blueprint $table)
{
$table->increments('id');
$table->string('current_version');
$table->string('new_version');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('version_check');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateWidgetsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('widgets', function(Blueprint $table)
{
$table->integer('id', true);
$table->string('name', 30)->nullable();
$table->string('title', 50)->nullable();
$table->text('value', 65535)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('widgets');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToCannedResponseTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('canned_response', function(Blueprint $table)
{
$table->foreign('user_id', 'canned_response_ibfk_1')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('canned_response', function(Blueprint $table)
{
$table->dropForeign('canned_response_ibfk_1');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToDepartmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('department', function(Blueprint $table)
{
$table->foreign('sla', 'department_ibfk_1')->references('id')->on('sla_plan')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('manager', 'department_ibfk_2')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('department', function(Blueprint $table)
{
$table->dropForeign('department_ibfk_1');
$table->dropForeign('department_ibfk_2');
});
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToEmailsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('emails', function(Blueprint $table)
{
$table->foreign('department', 'emails_ibfk_1')->references('id')->on('department')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('priority', 'emails_ibfk_2')->references('priority_id')->on('ticket_priority')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('help_topic', 'emails_ibfk_3')->references('id')->on('help_topic')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('emails', function(Blueprint $table)
{
$table->dropForeign('emails_ibfk_1');
$table->dropForeign('emails_ibfk_2');
$table->dropForeign('emails_ibfk_3');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToGroupAssignDepartmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('group_assign_department', function(Blueprint $table)
{
$table->foreign('group_id', 'group_assign_department_ibfk_1')->references('id')->on('groups')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('department_id', 'group_assign_department_ibfk_2')->references('id')->on('department')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('group_assign_department', function(Blueprint $table)
{
$table->dropForeign('group_assign_department_ibfk_1');
$table->dropForeign('group_assign_department_ibfk_2');
});
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToHelpTopicTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('help_topic', function(Blueprint $table)
{
$table->foreign('custom_form', 'help_topic_ibfk_1')->references('id')->on('custom_forms')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('department', 'help_topic_ibfk_2')->references('id')->on('department')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('ticket_status', 'help_topic_ibfk_3')->references('id')->on('ticket_status')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('priority', 'help_topic_ibfk_4')->references('priority_id')->on('ticket_priority')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('sla_plan', 'help_topic_ibfk_5')->references('id')->on('sla_plan')->onUpdate('RESTRICT')->onDelete('RESTRICT');
$table->foreign('auto_assign', 'help_topic_ibfk_6')->references('id')->on('users')->onUpdate('RESTRICT')->onDelete('SET NULL');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('help_topic', function(Blueprint $table)
{
$table->dropForeign('help_topic_ibfk_1');
$table->dropForeign('help_topic_ibfk_2');
$table->dropForeign('help_topic_ibfk_3');
$table->dropForeign('help_topic_ibfk_4');
$table->dropForeign('help_topic_ibfk_5');
$table->dropForeign('help_topic_ibfk_6');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToKbArticleRelationshipTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('kb_article_relationship', function(Blueprint $table)
{
$table->foreign('article_id', 'article_relationship_article_id_foreign')->references('id')->on('kb_article')->onUpdate('RESTRICT')->onDelete('RESTRICT');
$table->foreign('category_id', 'article_relationship_category_id_foreign')->references('id')->on('kb_category')->onUpdate('RESTRICT')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('kb_article_relationship', function(Blueprint $table)
{
$table->dropForeign('article_relationship_article_id_foreign');
$table->dropForeign('article_relationship_category_id_foreign');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToKbCommentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('kb_comment', function(Blueprint $table)
{
$table->foreign('article_id', 'comment_article_id_foreign')->references('id')->on('kb_article')->onUpdate('RESTRICT')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('kb_comment', function(Blueprint $table)
{
$table->dropForeign('comment_article_id_foreign');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToOrganizationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('organization', function(Blueprint $table)
{
$table->foreign('head', 'organization_ibfk_1')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('organization', function(Blueprint $table)
{
$table->dropForeign('organization_ibfk_1');
});
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToSettingsSystemTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings_system', function(Blueprint $table)
{
$table->foreign('time_zone', 'settings_system_ibfk_1')->references('id')->on('timezone')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('time_farmat', 'settings_system_ibfk_2')->references('id')->on('time_format')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('date_format', 'settings_system_ibfk_3')->references('id')->on('date_format')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('date_time_format', 'settings_system_ibfk_4')->references('id')->on('date_time_format')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings_system', function(Blueprint $table)
{
$table->dropForeign('settings_system_ibfk_1');
$table->dropForeign('settings_system_ibfk_2');
$table->dropForeign('settings_system_ibfk_3');
$table->dropForeign('settings_system_ibfk_4');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTeamAssignAgentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('team_assign_agent', function(Blueprint $table)
{
$table->foreign('team_id', 'team_assign_agent_ibfk_1')->references('id')->on('teams')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('agent_id', 'team_assign_agent_ibfk_2')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('team_assign_agent', function(Blueprint $table)
{
$table->dropForeign('team_assign_agent_ibfk_1');
$table->dropForeign('team_assign_agent_ibfk_2');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTeamsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('teams', function(Blueprint $table)
{
$table->foreign('team_lead', 'teams_ibfk_1')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('teams', function(Blueprint $table)
{
$table->dropForeign('teams_ibfk_1');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTicketAttachmentTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ticket_attachment', function(Blueprint $table)
{
$table->foreign('thread_id', 'ticket_attachment_ibfk_1')->references('id')->on('ticket_thread')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_attachment', function(Blueprint $table)
{
$table->dropForeign('ticket_attachment_ibfk_1');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTicketCollaboratorTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ticket_collaborator', function(Blueprint $table)
{
$table->foreign('ticket_id', 'ticket_collaborator_ibfk_1')->references('id')->on('tickets')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('user_id', 'ticket_collaborator_ibfk_2')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_collaborator', function(Blueprint $table)
{
$table->dropForeign('ticket_collaborator_ibfk_1');
$table->dropForeign('ticket_collaborator_ibfk_2');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTicketFormDataTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ticket_form_data', function(Blueprint $table)
{
$table->foreign('ticket_id', 'ticket_form_data_ibfk_1')->references('id')->on('tickets')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_form_data', function(Blueprint $table)
{
$table->dropForeign('ticket_form_data_ibfk_1');
});
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTicketThreadTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ticket_thread', function(Blueprint $table)
{
$table->foreign('ticket_id', 'ticket_thread_ibfk_1')->references('id')->on('tickets')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('user_id', 'ticket_thread_ibfk_2')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('source', 'ticket_thread_ibfk_3')->references('id')->on('ticket_source')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_thread', function(Blueprint $table)
{
$table->dropForeign('ticket_thread_ibfk_1');
$table->dropForeign('ticket_thread_ibfk_2');
$table->dropForeign('ticket_thread_ibfk_3');
});
}
}

View File

@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToTicketsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('tickets', function(Blueprint $table)
{
$table->foreign('user_id', 'tickets_ibfk_1')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('dept_id', 'tickets_ibfk_2')->references('id')->on('department')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('team_id', 'tickets_ibfk_3')->references('id')->on('teams')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('priority_id', 'tickets_ibfk_4')->references('priority_id')->on('ticket_priority')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('sla', 'tickets_ibfk_5')->references('id')->on('sla_plan')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('help_topic_id', 'tickets_ibfk_6')->references('id')->on('help_topic')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('status', 'tickets_ibfk_7')->references('id')->on('ticket_status')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('source', 'tickets_ibfk_8')->references('id')->on('ticket_source')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('assigned_to', 'tickets_ibfk_9')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('tickets', function(Blueprint $table)
{
$table->dropForeign('tickets_ibfk_1');
$table->dropForeign('tickets_ibfk_2');
$table->dropForeign('tickets_ibfk_3');
$table->dropForeign('tickets_ibfk_4');
$table->dropForeign('tickets_ibfk_5');
$table->dropForeign('tickets_ibfk_6');
$table->dropForeign('tickets_ibfk_7');
$table->dropForeign('tickets_ibfk_8');
$table->dropForeign('tickets_ibfk_9');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToUserAssignOrganizationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_assign_organization', function(Blueprint $table)
{
$table->foreign('org_id', 'user_assign_organization_ibfk_1')->references('id')->on('organization')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('user_id', 'user_assign_organization_ibfk_2')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('user_assign_organization', function(Blueprint $table)
{
$table->dropForeign('user_assign_organization_ibfk_1');
$table->dropForeign('user_assign_organization_ibfk_2');
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function(Blueprint $table)
{
$table->foreign('assign_group', 'users_ibfk_1')->references('id')->on('groups')->onUpdate('NO ACTION')->onDelete('RESTRICT');
$table->foreign('primary_dpt', 'users_ibfk_2')->references('id')->on('department')->onUpdate('NO ACTION')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function(Blueprint $table)
{
$table->dropForeign('users_ibfk_1');
$table->dropForeign('users_ibfk_2');
});
}
}

1037
public/ckeditor/CHANGES.md Normal file

File diff suppressed because it is too large Load Diff

1420
public/ckeditor/LICENSE.md Normal file

File diff suppressed because it is too large Load Diff

39
public/ckeditor/README.md Normal file
View File

@@ -0,0 +1,39 @@
CKEditor 4
==========
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
http://ckeditor.com - See LICENSE.md for license information.
CKEditor is a text editor to be used inside web pages. It's not a replacement
for desktop text editors like Word or OpenOffice, but a component to be used as
part of web applications and websites.
## Documentation
The full editor documentation is available online at the following address:
http://docs.ckeditor.com
## Installation
Installing CKEditor is an easy task. Just follow these simple steps:
1. **Download** the latest version from the CKEditor website:
http://ckeditor.com. You should have already completed this step, but be
sure you have the very latest version.
2. **Extract** (decompress) the downloaded file into the root of your website.
**Note:** CKEditor is by default installed in the `ckeditor` folder. You can
place the files in whichever you want though.
## Checking Your Installation
The editor comes with a few sample pages that can be used to verify that
installation proceeded properly. Take a look at the `samples` directory.
To test your installation, just call the following page at your website:
http://<your site>/<CKEditor installation path>/samples/index.html
For example:
http://www.example.com/ckeditor/samples/index.html

10
public/ckeditor/adapters/jquery.js vendored Normal file
View File

@@ -0,0 +1,10 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);

160
public/ckeditor/build-config.js vendored Normal file
View File

@@ -0,0 +1,160 @@
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time to build CKEditor again.
*
* If you would like to build CKEditor online again
* (for example to upgrade), visit one the following links:
*
* (1) http://ckeditor.com/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) http://ckeditor.com/builder/e41bccb8290b6d530f8478ddafe95c48
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) http://ckeditor.com/builder/download/e41bccb8290b6d530f8478ddafe95c48
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/
var CKBUILDER_CONFIG = {
skin: 'moono',
preset: 'standard',
ignore: [
'.bender',
'bender.js',
'bender-err.log',
'bender-out.log',
'dev',
'.DS_Store',
'.editorconfig',
'.gitattributes',
'.gitignore',
'gruntfile.js',
'.idea',
'.jscsrc',
'.jshintignore',
'.jshintrc',
'less',
'.mailmap',
'node_modules',
'package.json',
'README.md',
'tests'
],
plugins : {
'a11yhelp' : 1,
'about' : 1,
'basicstyles' : 1,
'blockquote' : 1,
'clipboard' : 1,
'contextmenu' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'filebrowser' : 1,
'floatingspace' : 1,
'format' : 1,
'horizontalrule' : 1,
'htmlwriter' : 1,
'image' : 1,
'indentlist' : 1,
'link' : 1,
'list' : 1,
'magicline' : 1,
'maximize' : 1,
'pastefromword' : 1,
'pastetext' : 1,
'removeformat' : 1,
'resize' : 1,
'scayt' : 1,
'showborders' : 1,
'sourcearea' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
'table' : 1,
'tabletools' : 1,
'toolbar' : 1,
'undo' : 1,
'wsc' : 1,
'wysiwygarea' : 1,
'popup' : 1,
'filebrowser' : 1,
},
languages : {
'af' : 1,
'ar' : 1,
'bg' : 1,
'bn' : 1,
'bs' : 1,
'ca' : 1,
'cs' : 1,
'cy' : 1,
'da' : 1,
'de' : 1,
'el' : 1,
'en' : 1,
'en-au' : 1,
'en-ca' : 1,
'en-gb' : 1,
'eo' : 1,
'es' : 1,
'et' : 1,
'eu' : 1,
'fa' : 1,
'fi' : 1,
'fo' : 1,
'fr' : 1,
'fr-ca' : 1,
'gl' : 1,
'gu' : 1,
'he' : 1,
'hi' : 1,
'hr' : 1,
'hu' : 1,
'id' : 1,
'is' : 1,
'it' : 1,
'ja' : 1,
'ka' : 1,
'km' : 1,
'ko' : 1,
'ku' : 1,
'lt' : 1,
'lv' : 1,
'mk' : 1,
'mn' : 1,
'ms' : 1,
'nb' : 1,
'nl' : 1,
'no' : 1,
'pl' : 1,
'pt' : 1,
'pt-br' : 1,
'ro' : 1,
'ru' : 1,
'si' : 1,
'sk' : 1,
'sl' : 1,
'sq' : 1,
'sr' : 1,
'sr-latn' : 1,
'sv' : 1,
'th' : 1,
'tr' : 1,
'tt' : 1,
'ug' : 1,
'uk' : 1,
'vi' : 1,
'zh' : 1,
'zh-cn' : 1
}
};

1009
public/ckeditor/ckeditor.js vendored Normal file

File diff suppressed because it is too large Load Diff

44
public/ckeditor/config.js vendored Normal file
View File

@@ -0,0 +1,44 @@
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;pre';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced;image:Upload;image:Link';
config.extraPlugins = 'popup';
config.extraPlugins = 'filebrowser';
//config.removeDialogTabs = 'link:upload;image:Upload';
};

132
public/ckeditor/contents.css vendored Normal file
View File

@@ -0,0 +1,132 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
body
{
/* Font */
font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
font-size: 12px;
/* Text color */
color: #333;
/* Remove the background color to make it transparent */
background-color: #fff;
margin: 20px;
}
.cke_editable
{
font-size: 13px;
line-height: 1.6;
}
blockquote
{
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
padding: 2px 0;
border-style: solid;
border-color: #ccc;
border-width: 0;
}
.cke_contents_ltr blockquote
{
padding-left: 20px;
padding-right: 8px;
border-left-width: 5px;
}
.cke_contents_rtl blockquote
{
padding-left: 8px;
padding-right: 20px;
border-right-width: 5px;
}
a
{
color: #0782C1;
}
ol,ul,dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right: 0px;
/* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/
padding: 0 40px;
}
h1,h2,h3,h4,h5,h6
{
font-weight: normal;
line-height: 1.2;
}
hr
{
border: 0px;
border-top: 1px solid #ccc;
}
img.right
{
border: 1px solid #ccc;
float: right;
margin-left: 15px;
padding: 5px;
}
img.left
{
border: 1px solid #ccc;
float: left;
margin-right: 15px;
padding: 5px;
}
pre
{
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* IE7 */
-moz-tab-size: 4;
tab-size: 4;
}
.marker
{
background-color: Yellow;
}
span[lang]
{
font-style: italic;
}
figure
{
text-align: center;
border: solid 1px #ccc;
border-radius: 2px;
background: rgba(0,0,0,0.05);
padding: 10px;
margin: 10px 20px;
display: inline-block;
}
figure > figcaption
{
text-align: center;
display: block; /* For IE8 */
}
a > img {
padding: 1px;
margin: 1px;
border: none;
outline: 1px solid #0782C1;
}

5
public/ckeditor/lang/af.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/ar.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/bg.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/bn.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/bs.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/ca.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/cs.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/cy.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/da.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/de.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/el.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/en-au.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/en-ca.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/en-gb.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/en.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/eo.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/es.js vendored Normal file

File diff suppressed because one or more lines are too long

5
public/ckeditor/lang/et.js vendored Normal file

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More