Merge pull request #341 from ladybirdweb/manish-bug-fixes-and-updates

v1.9.0 updates
This commit is contained in:
Manish Verma
2016-12-14 16:57:11 +05:30
committed by GitHub
2236 changed files with 95571 additions and 72332 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,5 @@
# Please try and keep this file organized by alphabetical order. Single files first, then directories.
.env
example.env
Homestead.yaml
Homestead.json
/config/lfm.php

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,437 @@
-- ------------------------------------------------------
--
-- Table structure for table `field_values`
--
DROP TABLE IF EXISTS `field_values`;
CREATE TABLE IF NOT EXISTS `field_values` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`field_id` int(10) UNSIGNED DEFAULT NULL,
`child_id` int(10) UNSIGNED DEFAULT NULL,
`field_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`field_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `field_values_field_id_foreign` (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ------------------------------------------------------------
--
-- Update values in table `settings_ticket`
--
UPDATE `settings_ticket` SET `num_format` = '$$$$-####-####', `num_sequence` = 'sequence' WHERE `id` = 1;
-- --------------------------------------------------------------------
-- -----------------------------------------------------------
--
-- Table structure for table `conditions`
--
DROP TABLE IF EXISTS `conditions`;
CREATE TABLE IF NOT EXISTS `conditions` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`job` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
DROP TABLE IF EXISTS `failed_jobs`;
CREATE TABLE IF NOT EXISTS `failed_jobs` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8_unicode_ci NOT NULL,
`queue` text COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `faveo_mails`
--
DROP TABLE IF EXISTS `faveo_mails`;
CREATE TABLE IF NOT EXISTS `faveo_mails` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`email_id` int(11) NOT NULL,
`drive` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `faveo_queues`
--
DROP TABLE IF EXISTS `faveo_queues`;
CREATE TABLE IF NOT EXISTS `faveo_queues` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`service_id` int(11) NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `field_values`
--
DROP TABLE IF EXISTS `field_values`;
CREATE TABLE IF NOT EXISTS `field_values` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`field_id` int(10) UNSIGNED DEFAULT NULL,
`child_id` int(10) UNSIGNED DEFAULT NULL,
`field_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`field_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `field_values_field_id_foreign` (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `jobs`
--
DROP TABLE IF EXISTS `jobs`;
CREATE TABLE IF NOT EXISTS `jobs` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`queue` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
`attempts` tinyint(3) UNSIGNED NOT NULL,
`reserved` tinyint(3) UNSIGNED NOT NULL,
`reserved_at` int(10) UNSIGNED DEFAULT NULL,
`available_at` int(10) UNSIGNED NOT NULL,
`created_at` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
KEY `jobs_queue_reserved_reserved_at_index` (`queue`,`reserved`,`reserved_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mail_services`
--
DROP TABLE IF EXISTS `mail_services`;
CREATE TABLE IF NOT EXISTS `mail_services` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`short_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `mail_services`
--
INSERT INTO `mail_services` (`id`, `name`, `short_name`, `created_at`, `updated_at`) VALUES
(1, 'SMTP', 'smtp', '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(2, 'Php Mail', 'mail', '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(3, 'Send Mail', 'sendmail', '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(4, 'Mailgun', 'mailgun', '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(5, 'Mandrill', 'mandrill', '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(6, 'Log file', 'log', '2016-10-09 15:32:44', '2016-10-09 15:32:44');
-- --------------------------------------------------------
--
-- Table structure for table `queue_services`
--
DROP TABLE IF EXISTS `queue_services`;
CREATE TABLE IF NOT EXISTS `queue_services` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`short_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `queue_services`
--
INSERT INTO `queue_services` (`id`, `name`, `short_name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Sync', 'sync', 1, '2016-10-09 15:32:44', '2016-10-09 16:05:03'),
(2, 'Database', 'database', 0, '2016-10-09 15:32:44', '2016-10-09 16:05:03'),
(3, 'Beanstalkd', 'beanstalkd', 0, '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(4, 'SQS', 'sqs', 0, '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(5, 'Iron', 'iron', 0, '2016-10-09 15:32:44', '2016-10-09 15:32:44'),
(6, 'Redis', 'redis', 0, '2016-10-09 15:32:44', '2016-10-09 15:32:44');
-- --------------------------------------------------------
--
-- Table structure for table `social_media`
--
DROP TABLE IF EXISTS `social_media`;
CREATE TABLE IF NOT EXISTS `social_media` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `user_additional_infos`
--
DROP TABLE IF EXISTS `user_additional_infos`;
CREATE TABLE IF NOT EXISTS `user_additional_infos` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`owner` int(11) NOT NULL,
`service` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `approval`
--
DROP TABLE IF EXISTS `approval`;
CREATE TABLE IF NOT EXISTS `approval` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `approval`
--
INSERT INTO `approval` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'approval', '0', '2016-10-09 15:32:45', '2016-10-09 15:32:45');
-- --------------------------------------------------------
--
-- Table structure for table `followup`
--
DROP TABLE IF EXISTS `followup`;
CREATE TABLE IF NOT EXISTS `followup` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`condition` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `followup`
--
INSERT INTO `followup` (`id`, `name`, `status`, `condition`, `created_at`, `updated_at`) VALUES
(1, 'followup', '', '', '2016-10-09 15:32:45', '2016-10-09 15:32:45');
-- --------------------------------------------------------------------
--
-- Alter ticket_priority table
--
ALTER TABLE `ticket_priority` ADD (`status` tinyint(1) DEFAULT 0, `is_default` varchar(30));
--
-- Update ticket_priority table values
--
--
-- Alter ticket priority color
--
UPDATE `ticket_priority`
SET `priority_color` = '#00a65a'
WHERE `ticket_priority`.`priority` = "Low";
UPDATE `ticket_priority`
SET `priority_color` = '#00bfef'
WHERE `ticket_priority`.`priority` = "Normal";
UPDATE `ticket_priority`
SET `priority_color` = '#f39c11'
WHERE `ticket_priority`.`priority` = "High";
UPDATE `ticket_priority`
SET `priority_color` = '#dd4b38'
WHERE `ticket_priority`.`priority` = "Emergency";
UPDATE `ticket_priority` SET `is_default` = '1' WHERE `ticket_priority`.`priority_id` = 2;
-- ---------------------------------------------------------------------------------------------
--
-- Alter `users` table
--
ALTER TABLE `users` MODIFY `mobile` VARCHAR(30) DEFAULT NULL;
UPDATE `users` SET `mobile` = NULL WHERE `mobile` = '';
ALTER TABLE `users` ADD UNIQUE (`mobile`);
-- ----------------------------------------------------------------------
--
-- Insert new values in `template_types`
--
INSERT INTO `template_types` (`id`, `name`, `created_at`, `updated_at`) VALUES
(12, 'team_assign_ticket', '2016-10-10 01:29:36', '2016-10-10 01:29:36'),
(13, 'reset_new_password', '2016-10-10 01:29:36', '2016-10-10 01:29:36');
-- --------------------------------------------------------------------------
--
-- Insert new values in `templates` table
--
INSERT INTO `templates` (`id`, `name`, `variable`, `type`, `subject`, `message`, `description`, `set_id`, `created_at`, `updated_at`) VALUES
(12, 'This template is for sending notice to team when ticket is assigned to team', '1', 12, '', '<div>Hello {!!$ticket_agent_name!!},<br /><br /><b>Ticket No:</b> {!!$ticket_number!!}<br />Has been assigned to your team : {!!$team!!} by {!!$ticket_assigner!!} <br /><br />Thank You<br />Kind Regards,<br />{!!$system_from!!}</div>', '', 1, '2016-10-10 01:29:38', '2016-10-10 01:29:38'),
(13, 'This template is for sending notice to client when password is changed', '1', 13, 'Verify your email address', 'Hello {!!$user!!},<br /><br />Your password is successfully changed.Your new password is : {!!$user_password!!}<br /><br />Thank You.<br /><br />Kind Regards,<br /> {!!$system_from!!}', '', 1, '2016-10-10 01:29:38', '2016-10-10 01:29:38');
-- --------------------------------------------------------------------------
--
-- Alter Table structure for table `ticket_source`
--
ALTER TABLE `ticket_source` ADD `css_class` VARCHAR(255) NULL AFTER `value`;
--
-- Dumping data for table `ticket_source`
--
INSERT INTO `ticket_source` (`id`, `name`, `value`, `css_class`) VALUES
(4, 'facebook', 'Facebook', 'fa fa-facebook'),
(5, 'twitter', 'Twitter', 'fa fa-twitter'),
(6, 'call', 'Call', 'fa fa-phone'),
(7, 'chat', 'Chat', 'fa fa-comment');
--
-- Update table ticket_source
--
UPDATE `ticket_source` SET `css_class` = 'fa fa-internet-explorer' WHERE `id` = 1;
UPDATE `ticket_source` SET `css_class` = 'fa fa-envelope' WHERE `id` = 2;
UPDATE `ticket_source` SET `css_class` = 'fa fa-envelope' WHERE `id` = 3;
-- ----------------------------------------------------------------------
--
-- Alter tickets table
--
ALTER TABLE `tickets`
ADD COLUMN `approval` tinyint(10),
ADD COLUMN `follow_up` tinyint(10) ;
--
-- Alter users table
--
ALTER TABLE `users` ADD `is_delete` BOOLEAN NOT NULL DEFAULT FALSE AFTER `remember_token`;
-- ---------------------------------------------------------------------------------------
--
-- Update table templates
--
UPDATE `templates`
SET `message` = '<div>Hello {!!$ticket_agent_name!!},<br /><br /><b>Ticket No:</b> {!!$ticket_number!!}<br />Has been assigned to you by {!!$ticket_assigner!!} <br/> Please check and resppond on the ticket.<br /> Link: {!!$ticket_link!!}<br /><br />Thank You<br />Kind Regards,<br /> {!!$system_from!!}</div>'
WHERE `type` = 1;
-- --------------------------------------------------------------------------------------
--
-- Update queue services tables
--
UPDATE `queue_services` SET `status` = 1 Where `name` LIKE 'Sync' OR `short_name` LIKE 'sync';
-- ----------------------------------------------------------------------------------------
--
-- Table structure for table `common_settings`
--
DROP TABLE IF EXISTS `common_settings`;
CREATE TABLE `common_settings` (
`id` int(10) UNSIGNED NOT NULL,
`option_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`option_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`optional_field` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `common_settings`
--
INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) VALUES
(1, 'ticket_token_time_duration', '1', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(2, 'enable_rtl', '', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(3, 'user_set_ticket_status', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(4, 'send_otp', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(5, 'email_mandatory', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(6, 'user_priority', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:10:14');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `common_settings`
--
ALTER TABLE `common_settings`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `common_settings`
--
ALTER TABLE `common_settings`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
-- -------------------------------------------------------------------------------

View File

@@ -8,10 +8,6 @@ VALUES (5, 'email_mandatory', '',1,'','2016-06-14 09:07:17','2016-06-14 09:07:17
-- INSERT INTO `ticket_status` (`id`, `name`, `state`, `mode`, `message`, `flags`, `sort`, `email_user`, `icon_class`, `properties`, `created_at`, `updated_at`)
-- VALUES (6, 'Unverified', 'unverified', 3, 'User account verification required.', 0, 6, 0, '', 'Ticket will be open after user verifies his/her account.', '2016-06-14 09:07:04', '2016-06-14 09:07:04');
--
-- Alter Table structure for table `users`
--
ALTER TABLE `users` ADD `fcm_token` VARCHAR( 500 ) NULL AFTER `profile_pic`;
-- ------------------------------------------------------

View File

@@ -196,12 +196,6 @@ CREATE TABLE IF NOT EXISTS `user_additional_infos` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------------
--
-- Alter Table structure for table `common_settings`
--
INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`)
VALUES (6, 'user_priority', '', '0', '', '2016-10-09 15:32:50', '2016-10-09 15:32:50');
-- --------------------------------------------------------
--
@@ -310,28 +304,23 @@ INSERT INTO `templates` (`id`, `name`, `variable`, `type`, `subject`, `message`,
-- Alter Table structure for table `ticket_source`
--
DROP TABLE IF EXISTS `ticket_source`;
CREATE TABLE IF NOT EXISTS `ticket_source` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`css_class` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `ticket_source` ADD `css_class` VARCHAR(255) NULL AFTER `value`;
--
-- Dumping data for table `ticket_source`
--
INSERT INTO `ticket_source` (`id`, `name`, `value`, `css_class`) VALUES
(1, 'web', 'Web', 'fa fa-internet-explorer'),
(2, 'email', 'E-mail', 'fa fa-envelope'),
(3, 'agent', 'Agent Panel', 'fa fa-envelope'),
(4, 'facebook', 'Facebook', 'fa fa-facebook'),
(5, 'twitter', 'Twitter', 'fa fa-twitter'),
(6, 'call', 'Call', 'fa fa-phone'),
(7, 'chat', 'Chat', 'fa fa-comment');
-- ----------------------------------------------------------------------
--
-- Update table ticket_source
--
UPDATE `ticket_source` SET `css_class` = 'fa fa-internet-explorer' WHERE `id` = 1;
UPDATE `ticket_source` SET `css_class` = 'fa fa-envelope' WHERE `id` = 2;
UPDATE `ticket_source` SET `css_class` = 'fa fa-envelope' WHERE `id` = 3;
--
-- Alter tickets table

View File

@@ -0,0 +1,97 @@
--
-- Alter users table
--
ALTER TABLE `users` ADD `is_delete` BOOLEAN NOT NULL DEFAULT FALSE AFTER `remember_token`;
-- ---------------------------------------------------------------------------------------
--
-- Update table templates
--
UPDATE `templates`
SET `message` = '<div>Hello {!!$ticket_agent_name!!},<br /><br /><b>Ticket No:</b> {!!$ticket_number!!}<br />Has been assigned to you by {!!$ticket_assigner!!} <br/> Please check and resppond on the ticket.<br /> Link: {!!$ticket_link!!}<br /><br />Thank You<br />Kind Regards,<br /> {!!$system_from!!}</div>'
WHERE `type` = 1;
-- --------------------------------------------------------------------------------------
--
-- Update queue services tables
--
UPDATE `queue_services` SET `status` = 1 Where `name` LIKE 'Sync' OR `short_name` LIKE 'sync';
-- ----------------------------------------------------------------------------------------
--
-- Alter ticket priority color
--
UPDATE `ticket_priority`
SET `priority_color` = '#00a65a'
WHERE `ticket_priority`.`priority` = "Low";
UPDATE `ticket_priority`
SET `priority_color` = '#00bfef'
WHERE `ticket_priority`.`priority` = "Normal";
UPDATE `ticket_priority`
SET `priority_color` = '#f39c11'
WHERE `ticket_priority`.`priority` = "High";
UPDATE `ticket_priority`
SET `priority_color` = '#dd4b38'
WHERE `ticket_priority`.`priority` = "Emergency";
UPDATE `ticket_priority` SET `is_default` = '1' WHERE `ticket_priority`.`priority_id` = 2;
-- ---------------------------------------------------------------------------------------------
--
-- Table structure for table `common_settings`
--
DROP TABLE IF EXISTS `common_settings`;
CREATE TABLE `common_settings` (
`id` int(10) UNSIGNED NOT NULL,
`option_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`option_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`optional_field` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `common_settings`
--
INSERT INTO `common_settings` (`id`, `option_name`, `option_value`, `status`, `optional_field`, `created_at`, `updated_at`) VALUES
(1, 'ticket_token_time_duration', '1', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(2, 'enable_rtl', '', '', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(3, 'user_set_ticket_status', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(4, 'send_otp', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(5, 'email_mandatory', '', '1', '', '2016-12-13 05:01:02', '2016-12-13 05:01:02'),
(6, 'user_priority', '', '0', '', '2016-12-13 05:01:02', '2016-12-13 05:10:14');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `common_settings`
--
ALTER TABLE `common_settings`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `common_settings`
--
ALTER TABLE `common_settings`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
-- -------------------------------------------------------------------------------

View File

@@ -31,11 +31,10 @@ class Kernel extends ConsoleKernel
{
if (env('DB_INSTALL') == 1) {
$queue = $this->getCurrentQueue();
$schedule->command('queue:listen '.$queue, ['--tries' => 1])->everyMinute()->withoutOverlapping();
$schedule->command('queue:listen '.$queue, ['--tries' => 1])->everyMinute();
$this->execute($schedule, 'fetching');
$this->execute($schedule, 'notification');
$this->execute($schedule, 'work');
loging('cron', 'executed successfully', 'info');
}
}

View File

@@ -12,18 +12,20 @@ class FaveoAfterReply extends Event
public $para3;
public $para4;
public $para5;
public $para6;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($para1 = '', $para2 = '', $para3 = '', $para4 = '', $para5 = '')
public function __construct($para1 = '', $para2 = '', $para3 = '', $para4 = '', $para5 = '', $para6 = '')
{
$this->para1 = $para1;
$this->para2 = $para2;
$this->para3 = $para3;
$this->para4 = $para4;
$this->para5 = $para5;
$this->para6 = $para6;
}
}

View File

@@ -1,5 +1,5 @@
<?php
return [
'logs' => 'Logs',
'logs'=> 'Logs',
];

View File

@@ -0,0 +1,126 @@
<?php
namespace App\FaveoStorage\Controllers;
use App\Http\Controllers\Controller;
use App\Model\helpdesk\Settings\CommonSettings;
use Artisan;
use Exception;
use Illuminate\Http\Request;
use Lang;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
class SettingsController extends Controller
{
public function settingsIcon()
{
return ' <div class="col-md-2 col-sm-6">
<div class="settingiconblue">
<div class="settingdivblue">
<a href="'.url('storage').'">
<span class="fa-stack fa-2x">
<i class="fa fa-save fa-stack-1x"></i>
</span>
</a>
</div>
<p class="box-title" >'.Lang::get('storage::lang.storage').'</p>
</div>
</div>';
}
public function settings()
{
try {
$settings = new CommonSettings();
$directories = $this->directories();
$def = $settings->getOptionValue('storage', 'default');
$ro = $settings->getOptionValue('storage', 'root');
$default = 'local';
$root = storage_path('app');
if ($def) {
$default = $def->option_value;
}
if ($ro) {
$root = $ro->option_value;
}
return view('storage::settings', compact('default', 'root', 'directories'));
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
}
public function postSettings(Request $request)
{
try {
$requests = $request->except('_token');
$this->delete();
if (count($requests) > 0) {
foreach ($requests as $key => $value) {
if ($value) {
$this->save($key, $value);
}
}
}
return redirect()->back()->with('success', 'Updated');
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
}
public function delete()
{
$settings = CommonSettings::where('option_name', 'storage')->get();
if ($settings->count() > 0) {
foreach ($settings as $setting) {
$setting->delete();
}
}
}
public function save($key, $value)
{
CommonSettings::create([
'option_name' => 'storage',
'optional_field' => $key,
'option_value' => $value,
]);
}
public function directories($root = '')
{
if ($root == '') {
$root = base_path();
}
$iter = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied"
);
$paths = [$root];
foreach ($iter as $path => $dir) {
if ($dir->isDir()) {
$paths[$path] = $path;
}
}
return $paths;
}
public function attachment()
{
$storage = new StorageController();
$storage->upload();
}
public function activate()
{
$path = 'app'.DIRECTORY_SEPARATOR.'FaveoStorage'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations';
Artisan::call('migrate', [
'--path' => $path,
'--force'=> true,
]);
}
}

View File

@@ -0,0 +1,250 @@
<?php
namespace App\FaveoStorage\Controllers;
use App\Http\Controllers\Controller;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Ticket\Ticket_attachments;
use App\Model\helpdesk\Ticket\Ticket_Thread;
use Config;
use Storage;
class StorageController extends Controller
{
protected $default;
protected $driver;
protected $root;
protected $s3_key;
protected $s3_region;
protected $s3_secret;
protected $s3_bucket;
protected $rackspace_key;
protected $rackspace_region;
protected $rackspace_username;
protected $rackspace_container;
protected $rackspace_endpoint;
protected $rackspace_url_type;
public function __construct()
{
$this->default = $this->defaults();
$this->driver = $this->driver();
$this->root = $this->root();
$this->s3_key = $this->s3Key();
$this->s3_region = $this->s3Region();
$this->s3_bucket = $this->s3Bucket();
$this->rackspace_container = $this->rackspaceContainer();
$this->rackspace_endpoint = $this->rackspaceEndpoint();
$this->rackspace_key = $this->rackspaceKey();
$this->rackspace_region = $this->rackspaceRegion();
$this->rackspace_url_type = $this->rackspaceUrlType();
$this->rackspace_username = $this->rackspaceUsername();
}
protected function settings($option)
{
$settings = new CommonSettings();
$setting = $settings->getOptionValue('storage', $option);
$value = '';
if ($setting) {
$value = $setting->option_value;
}
return $value;
}
public function defaults()
{
$default = 'local';
if ($this->settings('default')) {
$default = $this->settings('default');
}
return $default;
}
public function driver()
{
return $this->settings('default');
}
public function root()
{
$root = storage_path('app');
if ($this->settings('root')) {
$root = $this->settings('root');
}
return $root;
}
public function s3Key()
{
return $this->settings('s3_key');
}
public function s3Region()
{
return $this->settings('s3_region');
}
public function s3Secret()
{
return $this->settings('s3_secret');
}
public function s3Bucket()
{
return $this->settings('s3_bucket');
}
public function rackspaceKey()
{
return $this->settings('root');
}
public function rackspaceRegion()
{
return $this->settings('rackspace_region');
}
public function rackspaceUsername()
{
return $this->settings('rackspace_username');
}
public function rackspaceContainer()
{
return $this->settings('rackspace_container');
}
public function rackspaceEndpoint()
{
return $this->settings('rackspace_endpoint');
}
public function rackspaceUrlType()
{
return $this->settings('rackspace_url_type');
}
protected function setFileSystem()
{
$config = $this->config();
//dd($config);
foreach ($config as $key => $con) {
if (is_array($con)) {
foreach ($con as $k => $v) {
Config::set("filesystem.$key.$k", $v);
}
}
Config::set("filesystem.$key", $con);
}
return Config::get('filesystem');
}
protected function config()
{
return [
'default' => $this->default,
'cloud' => 's3',
'disks' => $this->disks(),
];
}
protected function disks()
{
return [
'local' => [
'driver' => 'local',
'root' => $this->root.'/attachments',
],
's3' => [
'driver' => 's3',
'key' => $this->s3_key,
'secret' => $this->s3_secret,
'region' => $this->s3_region,
'bucket' => $this->s3_bucket,
],
'rackspace' => [
'driver' => 'rackspace',
'username' => $this->rackspace_username,
'key' => $this->rackspace_key,
'container' => $this->rackspace_container,
'endpoint' => $this->rackspace_endpoint,
'region' => $this->rackspace_region,
'url_type' => $this->rackspace_url_type,
],
];
}
public function upload($data, $filename, $type, $size, $disposition, $thread_id)
{
$upload = new Ticket_attachments();
$upload->thread_id = $thread_id;
$upload->name = $filename;
$upload->type = $type;
$upload->size = $size;
$upload->poster = $disposition;
$upload->driver = $this->default;
$upload->path = $this->root;
if ($this->default !== 'database') {
$this->setFileSystem();
Storage::disk($this->default)->put($filename, $data);
} else {
$upload->file = $data;
}
if ($data && $size && $disposition) {
$upload->save();
}
}
public function saveAttachments($thread_id, $attachments = [])
{
if (is_array($attachments) && count($attachments) > 0) {
foreach ($attachments as $attachment) {
$structure = $attachment->getStructure();
$disposition = 'ATTACHMENT';
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
}
$filename = str_random(16).'-'.$attachment->getFileName();
$type = $attachment->getMimeType();
$size = $attachment->getSize();
$data = $attachment->getData();
$this->upload($data, $filename, $type, $size, $disposition, $thread_id);
$this->updateBody($attachment, $thread_id, $filename);
}
}
}
public function updateBody($attachment, $thread_id, $filename)
{
$structure = $attachment->getStructure();
$disposition = 'ATTACHMENT';
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
}
if ($disposition == 'INLINE' || $disposition == 'inline') {
$id = str_replace('>', '', str_replace('<', '', $structure->id));
$threads = new Ticket_Thread();
$thread = $threads->find($thread_id);
$body = $thread->body;
$body = str_replace('cid:'.$id, $filename, $body);
$thread->body = $body;
$thread->save();
}
}
public function getFile($drive, $name)
{
//dd($drive,$name);
if ($drive != 'database') {
$this->setFileSystem();
if (Storage::disk($this->default)->exists($name)) {
return Storage::disk($this->default)->get($name);
}
}
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace App\FaveoStorage;
use Illuminate\Support\ServiceProvider;
class StorageServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$view_path = app_path().DIRECTORY_SEPARATOR.'FaveoStorage'.DIRECTORY_SEPARATOR.'views';
$this->loadViewsFrom($view_path, 'storage');
$lang_path = app_path().DIRECTORY_SEPARATOR.'FaveoStorage'.DIRECTORY_SEPARATOR.'lang';
$this->loadTranslationsFrom($lang_path, 'storage');
if (isInstall()) {
$controller = new Controllers\SettingsController();
$controller->activate();
}
if (class_exists('Breadcrumbs')) {
require __DIR__.'/breadcrumbs.php';
}
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Add routes
if (isInstall()) {
$routes = app_path('/FaveoStorage/routes.php');
if (file_exists($routes)) {
require $routes;
}
}
}
}

View File

@@ -0,0 +1,6 @@
<?php
Breadcrumbs::register('storage', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push('Storage', route('storage'));
});

View File

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

View File

@@ -0,0 +1,16 @@
<?php
return [
'settings' => 'Settings',
'storage' => 'Storage',
'default' => 'Default',
'root' => 'Root',
'region' => 'Region',
'key' => 'Key',
'secret' => 'Secret',
'bucket' => 'Bucket',
'username' => 'Username',
'container'=> 'Container',
'endpoint' => 'End Point',
'url_type' => 'Url Type',
];

View File

@@ -0,0 +1,12 @@
<?php
\Event::listen('settings.system', function () {
$controller = new \App\FaveoStorage\Controllers\SettingsController();
echo $controller->settingsIcon();
});
Route::group(['middleware'=>['web']], function () {
Route::get('storage', ['as'=>'storage', 'uses'=>'App\FaveoStorage\Controllers\SettingsController@settings']);
Route::post('storage', ['as'=>'post.storage', 'uses'=>'App\FaveoStorage\Controllers\SettingsController@postSettings']);
Route::get('attachment', ['as'=>'attach', 'uses'=>'App\FaveoStorage\Controllers\SettingsController@attachment']);
});

View File

@@ -0,0 +1,139 @@
@extends('themes.default1.admin.layout.admin')
@section('content')
<section class="content-header">
<h1> {{Lang::get('storage::lang.settings')}} </h1>
</section>
<div class="box box-primary">
<div class="box-header with-border">
<h4> {{Lang::get('storage::lang.storage')}} </h4>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@if(Session::has('success'))
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('success')}}
</div>
@endif
<!-- fail message -->
@if(Session::has('fails'))
<div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i>
<b>{{Lang::get('message.alert')}}!</b> {{Lang::get('message.failed')}}.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('fails')}}
</div>
@endif
{!! Form::open(['url'=>'storage','method'=>'post']) !!}
</div><!-- /.box-header -->
<!-- /.box-header -->
<div class="box-body">
<div class="row">
<div class="form-group col-md-8 {{ $errors->has('default') ? 'has-error' : '' }}">
{!! Form::label('default',Lang::get('storage::lang.default')) !!}
{!! Form::select('default',['database'=>'Database','local'=>'Local'],$default,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('root') ? 'has-error' : '' }}" id="root" style="display: none;">
{!! Form::label('root',Lang::get('storage::lang.root')) !!}
{!! Form::select('root',$directories,$root,['class'=>'form-control']) !!}
</div>
<div id="common" style="display: none;">
<div class="form-group col-md-6 {{ $errors->has('key') ? 'has-error' : '' }}">
{!! Form::label('key',Lang::get('storage::lang.key')) !!}
{!! Form::text('key',null,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('region') ? 'has-error' : '' }}">
{!! Form::label('region',Lang::get('storage::lang.region')) !!}
{!! Form::text('region',null,['class'=>'form-control']) !!}
</div>
</div>
<div id="s3" style="display: none;">
<div class="form-group col-md-6 {{ $errors->has('secret') ? 'has-error' : '' }}">
{!! Form::label('secret',Lang::get('storage::lang.secret')) !!}
{!! Form::text('secret',null,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('bucket') ? 'has-error' : '' }}">
{!! Form::label('bucket',Lang::get('storage::lang.bucket')) !!}
{!! Form::text('bucket',null,['class'=>'form-control']) !!}
</div>
</div>
<div id="rackspace" style="display: none;">
<div class="form-group col-md-6 {{ $errors->has('username') ? 'has-error' : '' }}">
{!! Form::label('username',Lang::get('storage::lang.username')) !!}
{!! Form::text('username',null,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('container') ? 'has-error' : '' }}">
{!! Form::label('container',Lang::get('storage::lang.container')) !!}
{!! Form::text('container',null,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('endpoint') ? 'has-error' : '' }}">
{!! Form::label('endpoint',Lang::get('storage::lang.endpoint')) !!}
{!! Form::text('endpoint',null,['class'=>'form-control']) !!}
</div>
<div class="form-group col-md-6 {{ $errors->has('url_type') ? 'has-error' : '' }}">
{!! Form::label('url_type',Lang::get('storage::lang.url_type')) !!}
{!! Form::text('url_type',null,['class'=>'form-control']) !!}
</div>
</div>
</div>
<!-- /.box-body -->
</div>
<div class="box-footer">
{!! Form::submit('Save',['class'=>'btn btn-success']) !!}
{!! Form::close() !!}
</div>
<!-- /.box -->
</div>
@stop
@section('FooterInclude')
<script>
$(document).ready(function () {
var defaults = $("#default").val();
switches(defaults);
$("#default").on("change", function () {
defaults = $("#default").val();
switches(defaults);
});
function switches(defaults) {
if(defaults=="local"){
$("#common").hide();
$("#s3").hide();
$("#rackspace").hide();
$("#root").show();
}
if(defaults=="s3"){
$("#root").hide();
$("#rackspace").hide();
$("#common").show();
$("#s3").show();
}
if(defaults=="rackspace"){
$("#root").hide();
$("#s3").hide();
$("#common").show();
$("#rackspace").show();
}
if(defaults=="database"){
$("#root").hide();
$("#s3").hide();
$("#common").hide();
$("#rackspace").hide();
}
}
});
</script>
@stop

View File

@@ -79,11 +79,11 @@ class AgentController extends Controller
{
try {
// gte all the teams
$team = $team_all->get();
$team = $team_all->where('status', '=', 1)->get();
// get all the timezones
$timezones = $timezone->get();
// get all the groups
$groups = $group->get();
$groups = $group->where('group_status', '=', 1)->get();
// get all department
$departments = $department->get();
// list all the teams in a single variable
@@ -186,10 +186,10 @@ class AgentController extends Controller
$location = GeoIP::getLocation();
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
$user = $user->whereId($id)->first();
$team = $team->get();
$team = $team->where('status', '=', 1)->get();
$teams1 = $team->lists('name', 'id');
$timezones = $timezone->get();
$groups = $group->get();
$groups = $group->where('group_status', '=', 1)->get();
$departments = $department->get();
$table = $team_assign_agent->where('agent_id', $id)->first();
$teams = $team->lists('id', 'name')->toArray();

View File

@@ -76,11 +76,12 @@ class DepartmentController extends Controller
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group)
{
try {
$slas = $sla->get();
$slas = $sla->where('status', '=', 1)
->select('grace_period', 'id')->get();
$user = $user->where('role', '<>', 'user')
->where('active', '=', 1)
->get();
$emails = $email->get();
$emails = $email->select('email_name', 'id')->get();
$templates = $template->get();
$department = $department->get();
$groups = $group->lists('id', 'name');
@@ -155,17 +156,18 @@ class DepartmentController extends Controller
->select('department')
->where('id', '=', 1)
->first();
$slas = $sla->get();
$slas = $sla->where('status', '=', 1)
->select('grace_period', 'id')->get();
$user = $user->where('primary_dpt', $id)
->where('active', '=', 1)
->get();
$emails = $email->get();
$emails = $email->select('email_name', 'id')->get();
$templates = $template->get();
$departments = $department->whereId($id)->first();
$groups = $group->lists('id', 'name');
//$groups = $group->lists('id', 'name');
$assign = $group_assign_department->where('department_id', $id)->lists('group_id');
return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'groups', 'sys_department'));
return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'sys_department'));
} catch (Exception $e) {
return redirect('departments')->with('fails', $e->getMessage());
}

View File

@@ -76,7 +76,7 @@ class EmailsController extends Controller
$departments = $department->get();
// fetch all the helptopics from the helptopic table
$helps = $help->where('status', '=', 1)->get();
// fetch all the types of active priority from the ticket_priority table
// fetch all the types of priority from the ticket_priority table
$priority = $ticket_priority->where('status', '=', 1)->get();
// fetch all the types of mailbox protocols from the mailbox_protocols table
$mailbox_protocols = $mailbox_protocol->get();
@@ -237,6 +237,29 @@ class EmailsController extends Controller
return 1;
}
public function checkMail($request)
{
$mailservice_id = $request->input('sending_protocol');
$driver = $this->getDriver($mailservice_id);
$username = $request->input('email_address');
$password = $request->input('password');
$name = $request->input('email_name');
$host = $request->input('sending_host');
$port = $request->input('sending_port');
$enc = $request->input('sending_encryption');
$service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode');
$this->emailService($driver, $service_request);
$this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port);
$transport = \Swift_SmtpTransport::newInstance($host, $port, $enc);
$transport->setUsername($username);
$transport->setPassword($password);
$mailer = \Swift_Mailer::newInstance($transport);
$mailer->getTransport()->start();
return 1;
}
public function sendDiagnoEmail($request)
{
$mailservice_id = $request->input('sending_protocol');
@@ -319,8 +342,8 @@ class EmailsController extends Controller
$count = $email->count();
// get all the helptopic
$helps = $help->where('status', '=', 1)->get();
// get all active the priority
$priority = $ticket_priority->where('status', '=', 1)->get();
// get all the priority
$priority = $ticket_priority->where('status', '=', 1)->get();
// get all the mailbox protocols
$mailbox_protocols = $mailbox_protocol->get();
@@ -638,27 +661,4 @@ class EmailsController extends Controller
$controller = new \App\Http\Controllers\Agent\helpdesk\MailController($TicketWorkflowController);
$controller->fetch($email);
}
public function checkMail($request)
{
$mailservice_id = $request->input('sending_protocol');
$driver = $this->getDriver($mailservice_id);
$username = $request->input('email_address');
$password = $request->input('password');
$name = $request->input('email_name');
$host = $request->input('sending_host');
$port = $request->input('sending_port');
$enc = $request->input('sending_encryption');
$service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode');
$this->emailService($driver, $service_request);
$this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port);
$transport = \Swift_SmtpTransport::newInstance($host, $port, $enc);
$transport->setUsername($username);
$transport->setPassword($password);
$mailer = \Swift_Mailer::newInstance($transport);
$mailer->getTransport()->start();
return 1;
}
}

View File

@@ -1,637 +0,0 @@
<?php
namespace App\Http\Controllers\Admin\helpdesk;
// controllers
use App\Http\Controllers\Controller;
// request
use App\Http\Requests\helpdesk\EmailsEditRequest;
use App\Http\Requests\helpdesk\EmailsRequest;
use App\Http\Requests\helpdesk\Mail\MailRequest;
// model
use App\Model\helpdesk\Agent\Department;
use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Manage\Help_topic;
use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Ticket\Ticket_Priority;
use App\Model\helpdesk\Utility\MailboxProtocol;
// classes
use Crypt;
use Exception;
use Illuminate\Http\Request;
use Lang;
/**
* ======================================
* EmailsController.
* ======================================
* This Controller is used to define below mentioned set of functions applied to the Emails in the system.
*
* @author Ladybird <info@ladybirdweb.com>
*/
class EmailsControllerOld extends Controller
{
/**
* Defining constructor variables.
*
* @return type
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('roles');
}
/**
* Display a listing of the Emails.
*
* @param type Emails $emails
*
* @return type view
*/
public function index(Emails $email)
{
try {
// fetch all the emails from emails table
$emails = $email->get();
return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Show the form for creating a new resource.
*
* @param type Department $department
* @param type Help_topic $help
* @param type Priority $priority
* @param type MailboxProtocol $mailbox_protocol
*
* @return type Response
*/
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
{
try {
// fetch all the departments from the department table
$departments = $department->get();
// fetch all the helptopics from the helptopic table
$helps = $help->get();
// fetch all the types of priority from the ticket_priority table
$priority = $ticket_priority->get();
// fetch all the types of mailbox protocols from the mailbox_protocols table
$mailbox_protocols = $mailbox_protocol->get();
$service = new \App\Model\MailJob\MailService();
$services = $service->lists('name', 'id')->toArray();
// return with all the table data
return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'services'));
} catch (Exception $e) {
// return error messages if any
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Check for email input validation.
*
* @param EmailsRequest $request
*
* @return int
*/
public function validatingEmailSettings(MailRequest $request, $id = '')
{
$service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode', 'code');
$service = $request->input('sending_protocol');
$send = 0;
$imap_check[0] = 0;
if ($request->input('imap_validate') == 'on') {
$validate = '/validate-cert';
} elseif (!$request->input('imap_validate')) {
$validate = '/novalidate-cert';
}
if ($request->input('fetching_status') == 'on') {
try {
$imap_check = $this->getImapStream($request, $validate);
} catch (Exception $ex) {
\Log::error($ex->getMessage());
$result = ['fails' => $ex->getMessage()];
return response()->json(compact('result'));
}
if ($imap_check[0] == 0) {
$response = Lang::get('lang.incoming_email_connection_failed_please_check_email_credentials_or_imap_settings');
}
} else {
$imap_check[0] = 1;
}
if ($request->input('sending_status') == 'on') {
$this->emailService($service, $service_request);
try {
$send = $this->sendDiagnoEmail($request);
} catch (Exception $ex) {
\Log::error($ex->getMessage());
$result = ['fails' => $ex->getMessage()];
return response()->json(compact('result'));
}
if ($send === 0) {
$response = Lang::get('lang.outgoing_email_connection_failed');
}
} else {
$send = 1;
}
if ($send === 1 && $imap_check[0] === 1) {
$this->store($request, $imap_check, $service_request, $id);
}
return $this->jsonResponse($send, $imap_check);
}
public function sendDiagnoEmail($request)
{
try {
$mailservice_id = $request->input('sending_protocol');
$driver = $this->getDriver($mailservice_id);
$username = $request->input('email_address');
$password = $request->input('password');
$name = $request->input('email_name');
$host = $request->input('sending_host');
$port = $request->input('sending_port');
$enc = $request->input('sending_encryption');
$service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode');
$this->emailService($driver, $service_request);
$this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port);
$controller = new \App\Http\Controllers\Common\PhpMailController();
$to = 'example@ladybirdweb.com';
$toname = 'test';
$subject = 'test';
$data = 'test';
//dd(\Config::get('mail'),\Config::get('services'));
$send = $controller->laravelMail($to, $toname, $subject, $data, [], []);
} catch (Exception $e) {
\Log::error($e->getMessage());
//dd($e);
}
return $send;
}
public function setMailConfig($driver, $username, $name, $password, $enc, $host, $port)
{
$configs = [
'username' => $username,
'from' => ['address' => $username, 'name' => $name],
'password' => $password,
'encryption' => $enc,
'host' => $host,
'port' => $port,
'driver' => $driver,
];
foreach ($configs as $key => $config) {
if (is_array($config)) {
foreach ($config as $from) {
\Config::set('mail.'.$key, $config);
}
} else {
\Config::set('mail.'.$key, $config);
}
}
}
public function getDriver($driver_id)
{
$short = '';
$email_drivers = new \App\Model\MailJob\MailService();
$email_driver = $email_drivers->find($driver_id);
if ($email_driver) {
$short = $email_driver->short_name;
}
return $short;
}
/**
* Store a newly created resource in storage.
*
* @param type Emails $email
* @param type EmailsRequest $request
*
* @return type Redirect
*/
public function store($request, $imap_check, $service_request = [], $id = '')
{
$email = new Emails();
if ($id !== '') {
$email = $email->find($id);
}
try {
$email->email_address = $request->email_address;
$email->email_name = $request->email_name;
$email->fetching_host = $request->fetching_host;
$email->fetching_port = $request->fetching_port;
$email->fetching_protocol = $request->fetching_protocol;
$email->sending_host = $request->sending_host;
$email->sending_port = $request->sending_port;
$email->sending_protocol = $this->getDriver($request->sending_protocol);
$email->sending_encryption = $request->sending_encryption;
if ($request->smtp_validate == 'on') {
$email->smtp_validate = $request->smtp_validate;
}
if ($request->input('password')) {
$email->password = Crypt::encrypt($request->input('password'));
}
if ($request->input('fetching_status') == 'on') {
$email->fetching_status = 1;
} else {
$email->fetching_status = 0;
}
if ($request->input('sending_status') == 'on') {
$email->sending_status = 1;
} else {
$email->sending_status = 0;
}
if ($request->input('auto_response') == 'on') {
$email->auto_response = 1;
} else {
$email->auto_response = 0;
}
//dd($email);
if ($imap_check !== null) {
$email->fetching_encryption = $imap_check[0];
} else {
$email->fetching_encryption = $request->input('fetching_encryption');
}
// fetching department value
$email->department = $this->departmentValue($request->input('department'));
// fetching priority value
$email->priority = $this->priorityValue($request->input('priority'));
// fetching helptopic value
$email->help_topic = $this->helpTopicValue($request->input('help_topic'));
// inserting the encrypted value of password
$email->password = Crypt::encrypt($request->input('password'));
$email->save(); // run save
if ($id === '') {
// Creating a default system email as the first email is inserted to the system
$email_settings = Email::where('id', '=', '1')->first();
$email_settings->sys_email = $email->id;
$email_settings->save();
} else {
$this->update($id, $request);
}
if (count($service_request) > 0) {
$this->saveMailService($email->id, $service_request, $this->getDriver($request->sending_protocol));
}
return 1;
} catch (Exception $e) {
return 0;
}
}
/**
* Show the form for editing the specified resource.
*
* @param type int $id
* @param type Department $department
* @param type Help_topic $help
* @param type Emails $email
* @param type Priority $priority
* @param type MailboxProtocol $mailbox_protocol
*
* @return type Response
*/
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
{
try {
$sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first();
// dd($sys_email);
// fetch the selected emails
$emails = $email->whereId($id)->first();
// get all the departments
$departments = $department->get();
//get count of emails
$count = $email->count();
// get all the helptopic
$helps = $help->get();
// get all the priority
$priority = $ticket_priority->get();
// get all the mailbox protocols
$mailbox_protocols = $mailbox_protocol->get();
$service = new \App\Model\MailJob\MailService();
$services = $service->lists('name', 'id')->toArray();
// return if the execution is succeeded
return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails', 'sys_email', 'services'))->with('count', $count);
} catch (Exception $e) {
// return if try fails
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Check for email input validation.
*
* @param EmailsRequest $request
*
* @return int
*/
public function validatingEmailSettingsUpdate($id, MailRequest $request)
{
return $this->validatingEmailSettings($request, $id);
}
/**
* Update the specified resource in storage.
*
* @param type $id
* @param type Emails $email
* @param type EmailsEditRequest $request
*
* @return type Response
*/
public function update($id, $request)
{
try {
if ($request->sys_email == 'on') {
$system = \DB::table('settings_email')
->where('id', '=', 1)
->update(['sys_email' => $id]);
} elseif ($request->input('count') <= 1 && $request->sys_email == null) {
$system = \DB::table('settings_email')
->where('id', '=', 1)
->update(['sys_email' => null]);
}
$return = 1;
} catch (Exception $e) {
$return = $e->getMessage();
}
return $return;
}
/**
* Remove the specified resource from storage.
*
* @param type int $id
* @param type Emails $email
*
* @return type Redirect
*/
public function destroy($id, Emails $email)
{
// fetching the details on the basis of the $id passed to the function
$default_system_email = Email::where('id', '=', '1')->first();
if ($default_system_email->sys_email) {
// checking if the default system email is the passed email
if ($id == $default_system_email->sys_email) {
return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email'));
}
}
try {
// fetching the database instance of the current email
$emails = $email->whereId($id)->first();
// checking if deleting the email is success or if it's carrying any dependencies
if ($emails->delete() == true) {
return redirect('emails')->with('success', Lang::get('lang.email_deleted_sucessfully'));
} else {
return redirect('emails')->with('fails', Lang::get('lang.email_can_not_delete'));
}
} catch (Exception $e) {
// returns if the try fails
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Create imap connection.
*
* @param type $request
*
* @return type int
*/
public function getImapStream($request, $validate)
{
$fetching_status = $request->input('fetching_status');
$username = $request->input('email_address');
$password = $request->input('password');
$protocol_id = $request->input('mailbox_protocol');
$fetching_protocol = '/'.$request->input('fetching_protocol');
$fetching_encryption = '/'.$request->input('fetching_encryption');
if ($fetching_encryption == '/none') {
$fetching_encryption2 = '/novalidate-cert';
$mailbox_protocol = $fetching_encryption2;
$host = $request->input('fetching_host');
$port = $request->input('fetching_port');
$mailbox = '{'.$host.':'.$port.$fetching_protocol.$mailbox_protocol.'}INBOX';
} else {
$mailbox_protocol = $fetching_protocol.$fetching_encryption;
$host = $request->input('fetching_host');
$port = $request->input('fetching_port');
$mailbox = '{'.$host.':'.$port.$mailbox_protocol.$validate.'}INBOX';
$mailbox_protocol = $fetching_encryption.$validate;
}
try {
$imap_stream = imap_open($mailbox, $username, $password);
} catch (\Exception $ex) {
\Log::error($ex->getMessage());
return $ex->getMessage();
}
//$imap_stream = imap_open($mailbox, $username, $password);
if ($imap_stream) {
$return = [0 => 1, 1 => $mailbox_protocol];
} else {
$return = [0 => 0];
}
return $return;
}
/**
* Check connection.
*
* @param type $imap_stream
*
* @return type int
*/
public function checkImapStream($imap_stream)
{
$check_imap_stream = imap_check($imap_stream);
if ($check_imap_stream) {
$imap_stream = 1;
} else {
$imap_stream = 0;
}
return $imap_stream;
}
/**
* Get smtp connection.
*
* @param type $request
*
* @return int
*/
public function getSmtp($request)
{
$sending_status = $request->input('sending_status');
// cheking for the sending protocol
if ($request->input('sending_protocol') == 'smtp') {
$mail = new \PHPMailer();
$mail->isSMTP();
$mail->Host = $request->input('sending_host'); // Specify main and backup SMTP servers
//$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $request->input('email_address'); // SMTP username
$mail->Password = $request->input('password'); // SMTP password
$mail->SMTPSecure = $request->input('sending_encryption'); // Enable TLS encryption, `ssl` also accepted
$mail->Port = $request->input('sending_port'); // TCP port to connect to
if (!$request->input('smtp_validate')) {
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->SMTPOptions = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
];
if ($mail->smtpConnect($mail->SMTPOptions) == true) {
$mail->smtpClose();
$return = 1;
} else {
$return = 0;
}
} else {
if ($mail->smtpConnect()) {
$mail->smtpClose();
$return = 1;
} else {
$return = 0;
}
}
} elseif ($request->input('sending_protocol') == 'mail') {
$return = 1;
}
return $return;
}
/**
* Checking if department value is null.
*
* @param type $dept
*
* @return type string or null
*/
public function departmentValue($dept)
{
if ($dept) {
$email_department = $dept;
} else {
$email_department = null;
}
return $email_department;
}
/**
* Checking if priority value is null.
*
* @param type $priority
*
* @return type string or null
*/
public function priorityValue($priority)
{
if ($priority) {
$email_priority = $priority;
} else {
$email_priority = null;
}
return $email_priority;
}
/**
* Checking if helptopic value is null.
*
* @param type $help_topic
*
* @return type string or null
*/
public function helpTopicValue($help_topic)
{
if ($help_topic) {
$email_help_topic = $help_topic;
} else {
$email_help_topic = null;
}
return $email_help_topic;
}
public function emailService($service, $value = [])
{
switch ($service) {
case 'mailgun':
$this->setServiceConfig($service, $value);
case 'mandrill':
$this->setServiceConfig($service, $value);
case 'ses':
$this->setServiceConfig($service, $value);
}
}
public function setServiceConfig($service, $value)
{
//dd($service);
if (count($value) > 0) {
foreach ($value as $k => $v) {
\Config::set("services.$service.$k", $v);
}
}
}
public function jsonResponse($out, $in)
{
if ($out !== 1) {
$result = ['fails' => Lang::get('lang.outgoing_email_connection_failed')];
}
if ($in[0] !== 1) {
$result = ['fails' => Lang::get('lang.incoming_email_connection_failed_please_check_email_credentials_or_imap_settings')];
}
if ($out === 1 && $in[0] === 1) {
$result = ['success' => Lang::get('lang.success')];
}
return response()->json(compact('result'));
}
public function saveMailService($emailid, $request, $driver)
{
$mail_service = new \App\Model\MailJob\FaveoMail();
$mails = $mail_service->where('email_id', $emailid)->get();
if (count($request) > 0) {
foreach ($mails as $mail) {
$mail->delete();
}
foreach ($request as $key => $value) {
$mail_service->create([
'drive' => $driver,
'key' => $key,
'value' => $value,
'email_id' => $emailid,
]);
}
}
}
}

View File

@@ -144,12 +144,14 @@ class FormController extends Controller
'required' => $require[$i],
]);
$field_id = $field->id;
$this->createValues($field_id, Input::get('value')[$i]);
$this->createValues($field_id, Input::get('value')[$i], null, $name);
}
}
return Redirect::back()->with('success', Lang::get('lang.successfully_created_form'));
} catch (Exception $ex) {
dd($ex);
return redirect()->back()->with('fails', $ex->getMessage());
}
}
@@ -255,11 +257,13 @@ class FormController extends Controller
'required' => Input::get('required')[$i],
]);
$field_id = $field->id;
$this->createValues($field_id, Input::get('value')[$i]);
$this->createValues($field_id, Input::get('value')[$i], null, $name);
}
return redirect()->back()->with('success', 'updated');
} catch (Exception $ex) {
dd($ex);
return redirect()->back()->with('fails', $ex->getMessage());
}
}
@@ -531,7 +535,7 @@ class FormController extends Controller
$session = self::getSession();
$script = self::jqueryScript($field_value = '', $field->id, $field->name, $field_type);
$form_hidden = Form::hidden('fieldid[]', $field->id, ['id' => 'hidden'.$session.$field->id]).Form::label($field->label, $field->label, ['class' => $required_class]);
$select = Form::$field_type($field->name, ['' => 'Select', 'Selects' => $field->values()->lists('field_value', 'field_value')->toArray()], null, ['class' => "form-control $session$field->id", 'id' => $session.$field->id, 'required' => $required]).'</br>';
$select = Form::$field_type($field->name, ['' => 'Select', 'Selects' => self::removeUnderscoreFromDB($field->values()->lists('field_value', 'field_value')->toArray())], null, ['class' => "form-control $session$field->id", 'id' => $session.$field->id, 'required' => $required]).'</br>';
$html = $script.$form_hidden.$select;
$response_div = '<div id='.$session.$field->name.'></div>';
@@ -617,4 +621,16 @@ class FormController extends Controller
return $form;
}
public static function removeUnderscoreFromDB($array)
{
$result = [];
if (is_array($array) && count($array) > 0) {
foreach ($array as $key => $value) {
$result[$key] = removeUnderscore($value);
}
}
return $result;
}
}

View File

@@ -124,6 +124,10 @@ class GroupController extends Controller
{
// Database instannce to the current id
$var = $group->whereId($id)->first();
$is_group_assigned = User::select('id')->where('assign_group', '=', $id)->count();
if ($is_group_assigned >= 1 && $request->input('group_status') == '0') {
return redirect('groups')->with('fails', Lang::get('lang.group_can_not_update').'<li>'.Lang::get('lang.can-not-inactive-group').'</li>');
}
// Updating Name
$var->name = $request->input('name');
//Updating Status

View File

@@ -44,7 +44,7 @@ class PriorityController extends Controller
*/
public function priorityIndex()
{
$user_status = CommonSettings::where('id', '=', 6)->first();
$user_status = CommonSettings::where('option_name', '=', 'user_priority')->first();
// dd( $user_status);
return view('themes.default1.admin.helpdesk.manage.ticket_priority.index', compact('user_status'));
@@ -60,7 +60,7 @@ class PriorityController extends Controller
try {
$user_status = $request->user_settings_priority;
CommonSettings::where('id', '=', 6)->update(['status' => $user_status]);
CommonSettings::where('option_name', '=', 'user_priority')->update(['status' => $user_status]);
return 'Your Status Updated';
} catch (Exception $e) {
@@ -94,7 +94,7 @@ class PriorityController extends Controller
})
->addColumn('action', function ($model) {
if ($model->is_default > 0) {
return '<a href='.url('ticket/priority/'.$model->priority_id.'/edit')." class='btn btn-info btn-xs' disabled='disabled'>Edit</a>&nbsp;<a href=".url('ticket_priority/'.$model->priority_id.'/destroy')." class='btn btn-warning btn-info btn-xs' disabled='disabled' > delete </a>";
return '<a href='.url('ticket/priority/'.$model->priority_id.'/edit')." class='btn btn-info btn-xs' disabled='disabled'>Edit</a>&nbsp;<a href=".url('ticket/priority/'.$model->priority_id.'/destroy')." class='btn btn-warning btn-info btn-xs' disabled='disabled' > delete </a>";
} else {
return '<a href='.url('ticket/priority/'.$model->priority_id.'/edit')." class='btn btn-info btn-xs'>Edit</a>&nbsp;<a class='btn btn-danger btn-xs' onclick='confirmDelete(".$model->priority_id.")'>Delete </a>";
}
@@ -156,7 +156,7 @@ class PriorityController extends Controller
$tk_priority->ispublic = $request->ispublic;
$tk_priority->save();
if ($request->input('default_priority') == 'on') {
Ticket_Priority::where('is_default', '=', 1)
Ticket_Priority::where('is_default', '>', 0)
->update(['is_default' => 0]);
Ticket_Priority::where('priority_id', '=', $priority_id)
->update(['is_default' => 1]);

View File

@@ -208,6 +208,13 @@ class SettingsController extends Controller
->update(['status' => $request->send_otp]);
$email_mandatory = CommonSettings::where('option_name', '=', 'email_mandatory')
->update(['status' => $request->email_mandatory]);
if ($request->has('itil')) {
$itil = $request->input('itil');
$sett = CommonSettings::firstOrCreate(['option_name'=>'itil']);
$sett->status = $itil;
$sett->save();
}
/* redirect to Index page with Success Message */
return redirect('getsystem')->with('success', Lang::get('lang.system_updated_successfully'));
} catch (Exception $e) {
@@ -356,8 +363,8 @@ class SettingsController extends Controller
$workflow = $workflow->whereId('1')->first();
$cron_path = base_path('artisan');
$command = ":- <pre>***** php $cron_path schedule:run > /dev/null 2>&1</pre>";
$shared = ":- <pre>/usr/bin/php-cli -q $cron_path schedule:run > /dev/null 2>&1</pre>";
$command = ":- <pre>***** php $cron_path schedule:run >> /dev/null 2>&1</pre>";
$shared = ":- <pre>/usr/bin/php-cli -q $cron_path schedule:run >> /dev/null 2>&1</pre>";
$warn = '';
$condition = new \App\Model\MailJob\Condition();
$job = $condition->checkActiveJob();
@@ -906,7 +913,7 @@ class SettingsController extends Controller
$fetching_command = $this->getCommand($fetching_commands, $fetching_dailyAt);
$notification_command = $this->getCommand($notification_commands, $notification_dailyAt);
$work_command = $this->getCommand($work_commands, $workflow_dailyAt);
$jobs = ['fetching' => $fetching_command, 'notification' => $notification_command, 'work' => $work_command];
$jobs = ['fetching'=>$fetching_command, 'notification'=>$notification_command, 'work'=>$work_command];
$this->storeCommand($jobs);
}
}
@@ -930,10 +937,10 @@ class SettingsController extends Controller
}
}
if (count($array) > 0) {
foreach ($array as $key => $save) {
foreach ($array as $key=>$save) {
$command->create([
'job' => $key,
'value' => $save,
'job' => $key,
'value'=> $save,
]);
}
}

View File

@@ -64,11 +64,8 @@ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
public function changeNonwww()
{
// $string = "\nRewriteEngine On
//RewriteBase /
//RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
//RewriteRule ^(.*)$ http://%1/$1 [R=301,L]\n";
$string = '';
$string = "RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]\n";
return $string;
}
@@ -102,7 +99,11 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
public function writeHtaccess($string)
{
//dd(public_path('.htaccess'),base_path('.htaccess'));
$file = public_path('.htaccess');
if (!\File::exists($file)) {
$file = base_path('/../.htaccess');
}
$this->deleteCustom();
$content = file_get_contents($file);
file_put_contents($file, $content."#custom\n".$string);
@@ -112,6 +113,9 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
public function deleteCustom()
{
$file = public_path('.htaccess');
if (!\File::exists($file)) {
$file = base_path('/../.htaccess');
}
$content = file_get_contents($file);
$custom_pos = strpos($content, '#custom');
if ($custom_pos) {

View File

@@ -356,7 +356,7 @@ class WorkflowController extends Controller
*/
public function priority($id)
{
$priorities = Ticket_Priority::all();
$priorities = Ticket_Priority::where('status', '=', 1)->get();
$var = "<select name='action[".$id."][b]' class='form-control' required>";
foreach ($priorities as $priority) {
$var .= "<option value='".$priority->priority_id."'>".$priority->priority_desc.'</option>';

View File

@@ -0,0 +1,338 @@
<?php
namespace App\Http\Controllers\Agent\helpdesk\Filter;
use App\Http\Controllers\Agent\helpdesk\TicketController;
use App\Http\Controllers\Controller;
use App\Model\helpdesk\Filters\Filter;
use App\Model\helpdesk\Filters\Label;
use App\Model\helpdesk\Ticket\Tickets;
use Auth;
use DB;
use Illuminate\Http\Request;
class FilterController extends Controller
{
protected $request;
public function __construct(Request $req)
{
$this->middleware(['auth', 'role.agent']);
$this->request = $req;
}
public function getFilter(Request $request)
{
$labels = $this->request->input('labels');
$tags = $this->request->input('tags');
if ($request->has('department')) {
$table = $this->departmentTickets($request->input('department'), $request->input('status'));
} else {
$segment = $this->request->input('segment');
$table = $this->segments($segment);
}
$tickets = [];
$render = false;
if (is_array($labels) && count($labels) > 0) {
$table = $table
->leftJoin('filters as label', function ($join) {
$join->on('tickets.id', '=', 'label.ticket_id')
->where('label.key', '=', 'label');
})
->whereIn('label.value', $labels);
}
if (is_array($tags) && count($tags) > 0) {
$table = $table
->leftJoin('filters as tag', function ($join) {
$join->on('tickets.id', '=', 'tag.ticket_id')
->where('tag.key', '=', 'tag');
})
->whereIn('tag.value', $tags);
}
if ((is_array($tags) && count($tags) > 0) || (is_array($labels) && count($labels) > 0)) {
$render = true;
}
// return \Datatables::of($table)->make();
return \Ttable::getTable($table);
}
public function filterByKey($key, $labels = [])
{
$filter = new Filter();
$query = $filter->where('key', $key)
->where(function ($query) use ($labels) {
if (is_array($labels) && count($labels) > 0) {
for ($i = 0; $i < count($labels); $i++) {
$query->orWhere('value', 'LIKE', '%'.$labels[$i].'%');
}
}
})
->lists('ticket_id')
->toArray();
return $query;
}
public function segments($segment)
{
if (strpos($segment, 'user') !== false) {
return $this->formatUserTickets($segment);
}
$table = $this->table();
switch ($segment) {
case '/ticket/inbox':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id)->orWhere('assigned_to', '=', Auth::user()->id);
}
return $table
->Join('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status')
->whereIn('ticket_status.id', [1, 7]);
});
case '/ticket/closed':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->Join('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status')
->whereIn('ticket_status.state', ['closed']);
});
case '/ticket/myticket':
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->orWhere('tickets.assigned_to', '=', Auth::user()->id)
->where('tickets.status', '=', 1);
case '/unassigned':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.assigned_to', '=', null)
->where('tickets.status', '=', 1);
case '/ticket/overdue':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.status', '=', 1)
// ->where('tickets.isanswered', '=', 0)
->whereNotNull('tickets.duedate')
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
// ->where('duedate','>',\Carbon\Carbon::now());
->where('tickets.duedate', '<', \Carbon\Carbon::now());
case '/ticket/approval/closed':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->Join('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status')
->where('tickets.status', '=', 7);
});
case '/trash':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->Join('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status')
->where('tickets.status', '=', 5);
});
case '/ticket/answered':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->Join('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status')
->where('tickets.status', '=', 1)
->where('tickets.isanswered', '=', 1);
});
case '/ticket/assigned':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.assigned_to', '>', 0)
->where('tickets.status', '=', 1);
case '/ticket/open':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.status', '=', 1);
case '/duetoday':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.status', '=', 1)
->whereNotNull('tickets.duedate')
->whereDate('tickets.duedate', '=', \Carbon\Carbon::now()->format('Y-m-d'));
case '/ticket/followup':
if (Auth::user()->role == 'agent') {
$id = Auth::user()->primary_dpt;
$table = $table->where('tickets.dept_id', '=', $id);
}
return $table
->leftJoin('ticket_status', function ($join) {
$join->on('ticket_status.id', '=', 'tickets.status');
})
->where('tickets.status', '=', 1)
// ->where('tickets.isanswered', '=', 0)
->where('tickets.follow_up', '=', 1);
}
}
public function table()
{
// if (Auth::user()->role == 'admin') {
$ticket = new Tickets();
$tickets = $ticket
->leftJoin('ticket_thread', function ($join) {
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
->whereNotNull('title')
->where('ticket_thread.is_internal', '<>', 1);
})
->Join('ticket_source', 'ticket_source.id', '=', 'tickets.source')
->leftJoin('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
->leftJoin('users as u', 'u.id', '=', 'tickets.user_id')
->leftJoin('users as u1', 'u1.id', '=', 'tickets.assigned_to')
->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id')
->leftJoin('ticket_collaborator', 'ticket_collaborator.ticket_id', '=', 'tickets.id')
->select(
'tickets.id',
'ticket_thread.title',
'tickets.ticket_number',
'ticket_priority.priority',
'u.user_name as user_name',
'u1.user_name as assign_user_name',
\DB::raw('max(ticket_thread.updated_at) as updated_at'),
\DB::raw('min(ticket_thread.updated_at) as created_at'),
'tickets.priority_id', 'tickets.assigned_to',
DB::raw('COUNT(ticket_thread.updated_at) as countthread'),
'ticket_priority.priority_color',
'u.first_name as first_name',
'u.last_name as last_name',
'u1.first_name as assign_first_name',
'u1.last_name as assign_last_name',
'tickets.status',
'tickets.user_id',
DB::raw('COUNT(ticket_attachment.thread_id) as countattachment'),
DB::raw('COUNT(ticket_collaborator.ticket_id) as countcollaborator'),
'ticket_status.name as tickets_status',
'ticket_source.css_class as css',
DB::raw('substring_index(group_concat(ticket_thread.poster order by ticket_thread.id desc) , ",", 1) as last_replier'),
DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as ticket_title'),
'u.active as verified')
->groupby('tickets.id');
return $tickets;
}
public function filter($render, $ticket_id = [])
{
if (Auth::user()->role == 'admin') {
$tickets = Tickets::whereIn('status', [1, 7]);
} else {
$dept = DB::table('department')->where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::whereIn('status', [1, 7])->where('dept_id', '=', $dept->id);
}
if ($render == true) {
$tickets = $tickets->whereIn('id', $ticket_id);
}
return $tickets;
}
public function ticketController()
{
$PhpMailController = new \App\Http\Controllers\Common\PhpMailController();
$NotificationController = new \App\Http\Controllers\Common\NotificationController();
$ticket_controller = new TicketController($PhpMailController, $NotificationController);
return $ticket_controller;
}
public function departmentTickets($dept, $status)
{
$table = $this->table();
return $table->leftJoin('department as dep', 'tickets.dept_id', '=', 'dep.id')
->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id')
->where('dep.name', $dept)
->where('ticket_status.name', $status);
}
/**
*@category function to format and return user tickets
*
*@param string $segment
*
*@return builder
*/
public function formatUserTickets($segment)
{
$convert_to_array = explode('/', $segment);
$user_id = $convert_to_array[2];
$user = \DB::table('users')->select('role', 'id')->where('id', '=', $user_id)->first();
$table = $this->table();
if ($user->role == 'user') {
$table = $table->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id')
->where('tickets.user_id', '=', $user->id)
->where('ticket_status.name', $convert_to_array[3]);
} else {
$table = $table->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id')
->where('tickets.assigned_to', '=', $user->id)
->where('ticket_status.name', $convert_to_array[3]);
}
return $table;
}
}

View File

@@ -180,8 +180,10 @@ class MailController extends Controller
public function message($messages, $email)
{
foreach ($messages as $message) {
$this->getMessageContent($message, $email);
if (count($messages) > 0) {
foreach ($messages as $message) {
$this->getMessageContent($message, $email);
}
}
}
@@ -191,6 +193,7 @@ class MailController extends Controller
if (!$body) {
$body = $message->getMessageBody();
}
$body = $this->separateReply($body);
$subject = $message->getSubject();
$address = $message->getAddresses('reply-to');
if (!$address) {
@@ -231,7 +234,17 @@ class MailController extends Controller
$thread = Ticket_Thread::where('id', '=', $thread_id)->first();
$thread->body = $this->separate_reply($body);
$thread->save();
$this->saveAttachments($thread->id, $attachments);
if (file_exists(app_path('/FaveoStorage/Controllers/StorageController.php'))) {
try {
$storage = new \App\FaveoStorage\Controllers\StorageController();
$storage->saveAttachments($thread->id, $attachments);
} catch (\Exception $ex) {
loging('attachment', $ex->getMessage());
}
} else {
loging('attachment', 'FaveoStorage not installed');
}
\Log::info('Ticket has created : ', ['id' => $thread->ticket_id]);
}
@@ -249,6 +262,8 @@ class MailController extends Controller
$type = $attachment->getMimeType();
$size = $attachment->getSize();
$data = $attachment->getData();
//$path = storage_path('/');
//$attachment->saveToDirectory($path);
$this->manageAttachment($data, $filename, $type, $size, $disposition, $thread_id);
$this->updateBody($attachment, $thread_id, $filename);
}
@@ -276,18 +291,15 @@ class MailController extends Controller
if (isset($structure->disposition)) {
$disposition = $structure->disposition;
}
if ($disposition == 'INLINE') {
if ($disposition == 'INLINE' || $disposition == 'inline') {
$id = str_replace('>', '', str_replace('<', '', $structure->id));
//$filename = $attachment->getFileName();
$path = public_path('attachments');
$filepath = asset('attachments/'.$filename);
$threads = new Ticket_Thread();
$thread = $threads->find($thread_id);
$body = $thread->body;
$body = str_replace('cid:'.$id, $filename, $body);
$thread->body = $body;
$thread->save();
$attachment->saveToDirectory($path);
}
}
@@ -355,4 +367,21 @@ class MailController extends Controller
->header('Content-Transfer-Encoding', 'binary');
}
}
/**
* separate reply.
*
* @param type $body
*
* @return type string
*/
public function separateReply($body)
{
$body2 = explode('---Reply above this line---', $body);
if (is_array($body2) && array_key_exists(0, $body2)) {
$body = $body2[0];
}
return $body;
}
}

View File

@@ -40,7 +40,7 @@ class NotificationController extends Controller
//dd('yes');
$send = 0;
$date = [0];
// dd($date);
// dd($date);
// checking if the daily notification is enabled or not
if ($email->notification_cron == 1) {
// checking if current date is equal to the last entered daily notification log
@@ -48,20 +48,20 @@ class NotificationController extends Controller
if ($notification) {
$date = explode(' ', $notification->created_at);
}
// if (date('Y-m-d') !== $date[0]) {
// creating a daily notification log
// if (date('Y-m-d') !== $date[0]) {
// creating a daily notification log
$company = $this->company();
// Send notification details to admin
$send += $this->send_notification_to_admin($company);
// Send notification details to team lead
$send += $this->send_notification_to_team_lead($company);
// Send notification details to manager of a department
$send += $this->send_notification_to_manager($company);
// Send notification details to all the agents
$send += $this->send_notification_to_agent($company);
$company = $this->company();
// Send notification details to admin
$send += $this->send_notification_to_admin($company);
// Send notification details to team lead
$send += $this->send_notification_to_team_lead($company);
// Send notification details to manager of a department
$send += $this->send_notification_to_manager($company);
// Send notification details to all the agents
$send += $this->send_notification_to_agent($company);
//}
Log_notification::create(['log' => 'NOT-1']);
Log_notification::create(['log' => 'NOT-1']);
}
return $send;
@@ -94,11 +94,8 @@ class NotificationController extends Controller
'scenario' => null,
'body' => $contents,
];
$job = new \App\Jobs\SendEmail($from, $to, $message);
$dispatch = $this->dispatch($job);
return $dispatch;
//return $this->PhpMailController->sendEmail($from,$to,$message);
return $this->PhpMailController->sendEmail($from, $to, $message);
}
}
@@ -132,8 +129,7 @@ class NotificationController extends Controller
'body' => $contents,
];
return $this->dispatch((new \App\Jobs\SendEmail($from, $to, $message)));
//$this->PhpMailController->sendEmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => 'Daily Report', 'scenario' => null, 'body' => $contents]);
return $this->PhpMailController->sendEmail($from, $to, $message);
}
}
}
@@ -169,8 +165,7 @@ class NotificationController extends Controller
'body' => $contents,
];
return $this->dispatch((new \App\Jobs\SendEmail($from, $to, $message)));
//$this->PhpMailController->sendEmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => 'Daily Report', 'scenario' => null, 'body' => $contents]);
return $this->PhpMailController->sendEmail($from, $to, $message);
}
}
}
@@ -195,15 +190,14 @@ class NotificationController extends Controller
$to = [
'name' => $user_name,
'email' => $email,
];
];
$message = [
'subject' => 'Daily Report',
'scenario' => null,
'body' => $contents,
];
];
return $this->dispatch((new \App\Jobs\SendEmail($from, $to, $message)));
//$this->PhpMailController->sendEmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => 'Daily Report', 'scenario' => null, 'body' => $contents]);
return $this->PhpMailController->sendEmail($from, $to, $message);
}
}

View File

@@ -61,16 +61,6 @@ class OrganizationController extends Controller
}
}
/**
* This function is used autofill organizations name .
*
* @return datatable
*/
public function organizationAutofill()
{
return view('themes.default1.agent.helpdesk.organization.getautocomplete');
}
/**
* This function is used to display the list of Organizations.
*
@@ -351,4 +341,14 @@ class OrganizationController extends Controller
return $orgs;
}
/**
* This function is used autofill organizations name .
*
* @return datatable
*/
public function organizationAutofill()
{
return view('themes.default1.agent.helpdesk.organization.getautocomplete');
}
}

View File

@@ -1,146 +0,0 @@
<?php
namespace App\Http\Controllers\Agent\helpdesk;
// controllers
use App\Http\Controllers\Controller;
// requests
// models
use App\Model\helpdesk\Agent\Department;
use App\Model\helpdesk\Ticket\Tickets;
use App\User;
use Auth;
// classes
use Ttable;
/**
* TicketController2.
*
* @author Ladybird <info@ladybirdweb.com>
*/
class Ticket2Controller extends Controller
{
/**
* Create a new controller instance.
*
* @return type response
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the Inbox ticket list page.
*
* @return type response
*/
public function deptopen($id)
{
$dept = Department::where('name', '=', $id)->first();
if (Auth::user()->role == 'agent') {
if (Auth::user()->dept_id == $dept->id) {
return view('themes.default1.agent.helpdesk.dept-ticket.open', compact('id'));
} else {
return redirect()->back()->with('fails', 'Unauthorised!');
}
} else {
return view('themes.default1.agent.helpdesk.dept-ticket.open', compact('id'));
}
}
/**
* this function returns the list of open tickets of a particular department.
*
* @param type $id
*
* @return type
*/
public function getOpenTickets($id)
{
if (Auth::user()->role == 'admin') {
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $id)->get();
} else {
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->get();
}
return Ttable::getTable($tickets);
}
/**
* Show the Inbox ticket list page.
*
* @return type response
*/
public function deptclose($id)
{
$dept = Department::where('name', '=', $id)->first();
if (Auth::user()->role == 'agent') {
if (Auth::user()->dept_id == $dept->id) {
return view('themes.default1.agent.helpdesk.dept-ticket.closed', compact('id'));
} else {
return redirect()->back()->with('fails', 'Unauthorised!');
}
} else {
return view('themes.default1.agent.helpdesk.dept-ticket.closed', compact('id'));
}
}
/**
* this function returns the list of close tickets of a particular department.
*
* @param type $id
*
* @return type
*/
public function getCloseTickets($id)
{
if (Auth::user()->role == 'admin') {
$tickets = Tickets::where('status', '=', '2')->where('status', '=', '3')->where('dept_id', '=', $id)->get();
} else {
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', '2')->where('status', '=', '3')->where('dept_id', '=', $dept->id)->get();
}
return Ttable::getTable($tickets);
}
/**
* this function returns the list of close tickets of a particular department.
*
* @param type $id
*
* @return type
*/
public function deptinprogress($id)
{
$dept = Department::where('name', '=', $id)->first();
if (Auth::user()->role == 'agent') {
if (Auth::user()->dept_id == $dept->id) {
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress', compact('id'));
} else {
return redirect()->back()->with('fails', 'Unauthorised!');
}
} else {
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress', compact('id'));
}
}
/**
*Show the list of In process tickets.
*
*@param $id int
*/
public function getInProcessTickets($id)
{
if (Auth::user()->role == 'admin') {
$tickets = Tickets::where('status', '=', '1')->where('assigned_to', '>', 0)->where('dept_id', '=', $id)->get();
} else {
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', '1')->where('assigned_to', '>', 0)->where('dept_id', '=', $dept->id)->get();
}
return Ttable::getTable($tickets);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -25,8 +25,6 @@ use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\UserNotification;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Ticket\Ticket_attachments;
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
use App\Model\helpdesk\Ticket\Ticket_Thread;
use App\Model\helpdesk\Ticket\Tickets;
use App\Model\helpdesk\Utility\CountryCode;
@@ -81,7 +79,30 @@ class UserController extends Controller
{
try {
/* get all values in Sys_user */
return view('themes.default1.agent.helpdesk.user.index');
$table = \ Datatable::table()
->addColumn(Lang::get('lang.name'),
Lang::get('lang.email'),
Lang::get('lang.phone'),
Lang::get('lang.status'),
Lang::get('lang.ban'),
Lang::get('lang.last_login'),
Lang::get('lang.role'),
Lang::get('lang.action')) // these are the column headings to be shown
->noScript();
return view('themes.default1.agent.helpdesk.user.index', compact('table'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
}
public function deletedUser()
{
try {
// dd('here');
/* get all values in Sys_user */
return view('themes.default1.agent.helpdesk.user.deleteduser');
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
@@ -92,10 +113,19 @@ class UserController extends Controller
*
* @return datatable
*/
public function user_list()
public function user_list(Request $request)
{
$type = $request->input('profiletype');
if ($type == 'active') {
$users = User::where('role', '!=', 'admin')->where('is_delete', '=', 0)->get();
} else {
$users = User::where('role', '!=', 'admin')->where('is_delete', '=', 1)->get();
}
// displaying list of users with chumper datatables
return \Datatable::collection(User::where('role', '!=', 'admin')->get())
// return \Datatable::collection(User::where('role', "!=", "admin")->get())
return \Datatable::collection($users)
/* searchable column username and email */
->searchColumns('user_name', 'email', 'phone')
/* order column username and email */
@@ -107,14 +137,14 @@ class UserController extends Controller
} else {
$string = strip_tags($model->user_name);
}
if (strlen($string) > 20) {
if (strlen($string) > 30) {
// truncate string
$stringCut = mb_substr($string, 0, 20, 'UTF-8');
$stringCut = mb_substr($string, 0, 30, 'UTF-8').'...';
} else {
$stringCut = $string;
}
return $stringCut;
return "<a href='".route('user.show', $model->id)."' title='".$string."''>".$stringCut.'</a>';
})
/* column email */
->addColumn('email', function ($model) {
@@ -172,11 +202,39 @@ class UserController extends Controller
})
/* column actions */
->addColumn('Actions', function ($model) {
return '<a href="'.route('user.edit', $model->id).'" class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp; <a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
if ($model->is_delete == 0) {
return '<a href="'.route('user.edit', $model->id).'" class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp; <a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
} else {
if (Auth::user()->role == 'admin') {
// @if(Auth::user()->role == 'admin')
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
}
if (Auth::user()->role == 'agent') {
// @if(Auth::user()->role == 'admin')
if ($model->role == 'user') {
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
}
}
}
})
->make();
}
public function restoreUser($id)
{
// dd($id);
// $delete_all = Input::get('delete_all');
$users = User::where('id', '=', $id)->first();
$users->is_delete = 0;
$users->active = 1;
$users->ban = 0;
$users->save();
return redirect('user')->with('success', Lang::get('lang.user_restore_successfully'));
}
/**
* Show the form for creating a new users.
*
@@ -209,7 +267,6 @@ class UserController extends Controller
{
/* insert the input request to sys_user table */
/* Check whether function success or not */
if ($request->input('email') != '') {
$user->email = $request->input('email');
} else {
@@ -409,78 +466,43 @@ class UserController extends Controller
public function deleteAgent($id)
{
// try {
$delete_all = Input::get('delete_all');
$delete_all = Input::get('delete_all');
$delete_all = Input::get('delete_all');
$users = User::where('id', '=', $id)->first();
if ($users->role == 'user') {
if ($delete_all == null || $delete_all == 1) {
$tickets = Tickets::where('user_id', '=', $id)->get();
if (count($tickets) > 0) {
foreach ($tickets as $ticket) {
$notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get();
foreach ($notification as $id) {
$user_notification = UserNotification::where(
'notification_id', '=', $id->id);
$user_notification->delete();
}
$notification = Notification::select('id')->where('model_id', '=', $ticket->id);
$notification->delete();
$thread = Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
foreach ($thread as $th_id) {
// echo $th_id->id." ";
$attachment = Ticket_attachments::where('thread_id', '=', $th_id->id)->get();
if (count($attachment)) {
foreach ($attachment as $a_id) {
Ticket_attachments::where('id', '=', $a_id->id)
->delete();
}
// echo "<br>";
}
$thread = Ticket_Thread::find($th_id->id);
// dd($thread);
$thread->delete();
}
$collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket->id)->get();
if (count($collaborators)) {
foreach ($collaborators as $collab_id) {
echo $collab_id->id;
$collab = Ticket_Collaborator::where('id', '=', $collab_id->id)
->delete();
}
}
$tickets = Tickets::find($ticket->id);
$tickets->delete();
}
}
$organization = User_org::where('user_id', '=', $users->id)->delete();
$user = User::where('id', '=', $users->id)
->delete();
$users = User::where('id', '=', $id)->first();
$users->is_delete = 1;
$users->active = 0;
$users->ban = 1;
$users->save();
return redirect('user')->with('success', Lang::get('lang.user_delete_successfully'));
}
return redirect('user')->with('success', Lang::get('lang.user_delete_successfully'));
}
// }
if ($users->role == 'agent') {
if ($delete_all == null) {
$UserEmail = Input::get('assign_to');
$assign_to = explode('_', $UserEmail);
$ticket = Tickets::where('assigned_to', '=', $id)->where('status', '=', '1')->get();
$ticket = Tickets::where('assigned_to', '=', $id)->get();
if ($assign_to[0] == 'user') {
if ($users->id == $assign_to[1]) {
return redirect('user')->with('warning', Lang::get('lang.select_another_agent'));
}
$user_detail = User::where('id', '=', $assign_to[1])->first();
$assignee = $user_detail->first_name.' '.$user_detail->last_name;
$ticket_logic1 = Tickets::where('assigned_to', '=', $id)
->update(['assigned_to' => $assign_to[1]]);
if ($ticket_logic2 = Tickets::where('user_id', '=', $id)->get()) {
$ticket_logic2 = Tickets::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
}
if ($ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->get()) {
$ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
}
if ($ticket_logic4 = User_org::where('user_id', '=', $id)->get()) {
$ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
}
// $user_detail = User::where('id', '=', $assign_to[1])->first();
// $assignee = $user_detail->first_name.' '.$user_detail->last_name;
// $ticket_logic1 = Tickets::where('assigned_to', '=', $id)
// ->update(['assigned_to' => $assign_to[1]]);
// if ($ticket_logic2 = Tickets::where('user_id', '=', $id)->get()) {
// $ticket_logic2 = Tickets::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
// }
// if ($ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->get()) {
// $ticket_logic3 = Ticket_Thread::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
// }
// if ($ticket_logic4 = User_org::where('user_id', '=', $id)->get()) {
// $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
// }
// $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
// $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee;
@@ -488,40 +510,75 @@ class UserController extends Controller
// UserNotification::where('notification_id', '=', $ticket->id)->delete();
// $users = User::where('id', '=', $id)->get();
// $organization = User_org::where('user_id', '=', $id)->delete();
Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]);
// Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]);
$tickets = Tickets::where('assigned_to', '=', $id)->get();
foreach ($tickets as $ticket) {
// code...
$ticket->assigned_to = $assign_to[1];
$user_detail = User::where('id', '=', $assign_to[1])->first();
$assignee = $user_detail->first_name.' '.$user_detail->last_name;
$ticket_number = $ticket->ticket_number;
$ticket->save();
$thread = new Ticket_Thread();
$thread->ticket_id = $ticket->id;
$thread->user_id = Auth::user()->id;
$thread->is_internal = 1;
$thread->body = 'This Ticket has been assigned to '.$assignee;
$thread->save();
}
$user = User::find($id);
$user->delete();
$users->is_delete = 1;
$users->active = 0;
$users->ban = 1;
$users->save();
return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully_and_ticket_assign_to_another_agent'));
}
if (User_org::where('user_id', '=', $id)) {
DB::table('user_assign_organization')->where('user_id', '=', $id)->delete();
}
// if (User_org::where('user_id', '=', $id)) {
// DB::table('user_assign_organization')->where('user_id', '=', $id)->delete();
// }
$user = User::find($id);
$user->delete();
$users->is_delete = 1;
$users->active = 0;
$users->ban = 1;
$users->save();
return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully'));
} elseif ($delete_all == 1) {
if ($ticket = Tickets::where('user_id', '=', $id)->first()) {
$ticket_assign = $ticket->assigned_to;
Ticket_Thread::where('ticket_id', '=', $ticket->id)->delete();
if ($ticket->user_id = $id) {
Tickets::where('user_id', '=', $id)->delete();
}
if ($ticket_assign) {
UserNotification::where('notification_id', '=', $ticket_assign)->delete();
}
UserNotification::where('notification_id', '=', $ticket->id)->delete();
$users = User::where('id', '=', $id)->get();
if ($delete_all) {
// dd('here');
$tickets = Tickets::where('assigned_to', '=', $id)->get();
// dd($tickets);
foreach ($tickets as $ticket) {
$ticket->assigned_to = null;
$ticket_number = $ticket->ticket_number;
$ticket->save();
$thread = new Ticket_Thread();
$thread->ticket_id = $ticket->id;
$thread->user_id = Auth::user()->id;
$thread->is_internal = 1;
$thread->body = 'This Ticket has been unassigned ';
$thread->save();
}
// $users = User::where('id', '=', $id)->get();
$user = User::find($id);
$user->delete();
$users->is_delete = 1;
$users->active = 0;
$users->save();
return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully'));
} else {
Assign_team_agent::where('agent_id', '=', $id)->delete();
User_org::where('user_id', '=', $id)->delete();
// Assign_team_agent::where('agent_id', '=', $id)->delete();
// User_org::where('user_id', '=', $id)->delete();
$user = User::find($id);
$user->delete();
$users->is_delete = 1;
$users->active = 0;
$users->save();
return redirect('user')->with('success', Lang::get('lang.agent_delete_successfully'));
}
@@ -567,6 +624,8 @@ class UserController extends Controller
public function edit($id, CountryCode $code)
{
try {
// dd('here');
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
@@ -575,9 +634,14 @@ class UserController extends Controller
$users = $user->whereId($id)->first();
$location = GeoIP::getLocation();
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
$org = Organization::lists('name', 'id')->toArray();
$orgs = Organization::all();
// dd($org);
$organization_id = User_org::where('user_id', '=', $id)->lists('org_id')->first();
return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'org', '$settings', '$email_mandatory'))->with('phonecode', $phonecode->phonecode);
// $org_name=Organization::where('id','=',$org_id)->lists('name')->first();
// dd($org_name);
return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'orgs', '$settings', '$email_mandatory', 'organization_id'))->with('phonecode', $phonecode->phonecode);
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
@@ -594,7 +658,6 @@ class UserController extends Controller
*/
public function update($id, Sys_userUpdate $request)
{
// dd($request);
$user = new User();
/* select the field where id = $id(request Id) */
$users = $user->whereId($id)->first();
@@ -616,7 +679,8 @@ class UserController extends Controller
$users->save();
if ($request->input('org_id') != '') {
$orgid = $request->input('org_id');
$this->storeUserOrgRelation($users->id, $orgid);
$this->storeUserOrgRelation($id, $orgid);
}
/* redirect to Index page with Success Message */
return redirect('user')->with('success', Lang::get('lang.User-profile-Updated-Successfully'));
@@ -734,7 +798,7 @@ class UserController extends Controller
return redirect('profile-edit')->with('success1', Lang::get('lang.password_updated_sucessfully'));
} catch (Exception $e) {
return redirect('profile-edit')->with('fails1', $e->getMessage());
return redirect('profile-edit')->with('fails', $e->getMessage());
}
} else {
return redirect('profile-edit')->with('fails1', Lang::get('lang.password_was_not_updated_incorrect_old_password'));
@@ -751,6 +815,7 @@ class UserController extends Controller
public function UserAssignOrg($id)
{
$org_name = Input::get('org');
if ($org_name) {
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
if ($org) {
@@ -768,13 +833,6 @@ class UserController extends Controller
}
}
/**
* Assigning an user to an organization.
*
* @param type $id
*
* @return type boolean
*/
public function UsereditAssignOrg($id)
{
$org_name = Input::get('org');
@@ -1004,18 +1062,11 @@ class UserController extends Controller
}
}
/**
* @category function to get user details and show in select field
*
* @param null
*
* @return data
*/
public function getAgentDetails()
{
$users = User::where('role', '<>', 'user')->where('active', '=', 1)->get();
foreach ($users as $user) {
echo "<option value='user_$user->id'>".$user->full_name.'</option>';
echo "<option value='user_$user->id'>".$user->name().'</option>';
}
}
}

View File

@@ -194,6 +194,9 @@ class ApiController extends Controller
}
$attach = $this->request->input('attachments');
$result = $this->ticket->reply($this->thread, $this->request, $this->attach, $attach);
$result = $result->join('users', 'ticket_thread.user_id', '=', 'users.id')
->select('ticket_thread.*', 'users.first_name as first_name')
->first();
return response()->json(compact('result'));
} catch (\Exception $e) {
@@ -1200,10 +1203,44 @@ class ApiController extends Controller
$join->on('users.id', '=', 'tickets.user_id')
->where('tickets.id', '=', $id);
});
$response = $this->differenciateHelpTopic($query);
$response = $this->differenciateHelpTopic($query)
->leftJoin('department', 'tickets.dept_id', '=', 'department.id')
->leftJoin('ticket_priority', 'tickets.priority_id', '=', 'ticket_priority.priority_id')
->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id')
->leftJoin('sla_plan', 'tickets.sla', '=', 'sla_plan.id')
->leftJoin('ticket_source', 'tickets.source', '=', 'ticket_source.id');
//$select = 'users.email','users.user_name','users.first_name','users.last_name','tickets.id','ticket_number','num_sequence','user_id','priority_id','sla','max_open_ticket','captcha','status','lock_by','lock_at','source','isoverdue','reopened','isanswered','is_deleted', 'closed','is_transfer','transfer_at','reopened_at','duedate','closed_at','last_message_at';
$result = $response->addSelect('users.email', 'users.user_name', 'users.first_name', 'users.last_name', 'tickets.id', 'ticket_number', 'user_id', 'priority_id', 'sla', 'status', 'lock_by', 'lock_at', 'source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'reopened_at', 'duedate', 'closed_at', 'tickets.created_at', 'tickets.updated_at')->first();
$result = $response->addSelect(
'users.email',
'users.user_name',
'users.first_name',
'users.last_name',
'tickets.id',
'ticket_number',
'user_id',
'ticket_priority.priority_id',
'ticket_priority.priority as priority_name',
'department.name as dept_name',
'ticket_status.name as status_name',
'sla_plan.name as sla_name',
'ticket_source.name as source_name',
'sla_plan.id as sla',
'ticket_status.id as status',
'lock_by',
'lock_at',
'ticket_source.id as source',
'isoverdue',
'reopened',
'isanswered',
'is_deleted',
'closed',
'reopened_at',
'duedate',
'closed_at',
'tickets.created_at',
'tickets.updated_at')->first();
return response()->json(compact('result'));
} catch (\Exception $e) {
@@ -1419,6 +1456,8 @@ class ApiController extends Controller
return $query->select('tickets.dept_id');
}
}
return $query;
}
public function getSystem($check, $query)

View File

@@ -1,491 +0,0 @@
<?php
namespace App\Http\Controllers\Api\v1;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class TestController extends Controller
{
public $server;
public function __construct()
{
$server = new Request();
$url = $_SERVER['REQUEST_URI'];
$server = parse_url($url);
$server['path'] = dirname($server['path']);
$server = parse_url($server['path']);
$server['path'] = dirname($server['path']);
$this->server = 'http://'.$_SERVER['HTTP_HOST'].$server['path'].'/';
}
public static function callGetApi($url)
{
//dd($url);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'error:'.curl_error($curl);
}
return $response;
curl_close($curl);
}
public static function callPostApi($url, $data)
{
//dd($url);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'error:'.curl_error($curl);
}
return $response;
curl_close($curl);
}
public function ticketReply()
{
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
$data = [
'ticket_ID' => '1',
'reply_content' => 'reply for the ticket id',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
// 'attachments' => [
// [
// 'name' => 'ladybird',
// 'size' => '26398',
// 'type' => 'png',
// 'file' => $file,
// ],
// [
// 'name' => 'ladybird',
// 'size' => '26398',
// 'type' => 'png',
// 'file' => $file,
// ]
// ],
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/reply?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function createTicket()
{
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
$data = [
'user_id' => 1,
'subject' => 'Api create via faveo api',
'body' => 'Test me when call api',
'helptopic' => '1',
'sla' => '1',
'priority' => '1',
'headers' => [0 => 'vijaycodename47@gmail.com'],
'dept' => '1',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
/* if attachment */
// 'attachments' => [
// [
// 'name' => 'ladybird',
// 'size' => '26398',
// 'type' => 'png',
// 'file' => $file,
// ],
// [
// 'name' => 'ladybird',
// 'size' => '26398',
// 'type' => 'png',
// 'file' => $file,
// ]
// ],
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/create?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function generateToken()
{
$data = [
//'email'=>'vijaycodename47@gmail.com',
'username' => 'vijay',
'password' => 'manjapra',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'authenticate';
//dd($url);
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function createUser()
{
$data = [
'email' => 'vijaycodename@gmail.com',
'password' => 'manjapra',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'register';
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function getAuthUser()
{
$url = $this->server.'authenticate/user?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function editTicket()
{
$data = [
'ticket_id' => '13',
'subject' => 'Api editing ticket via faveo api',
'sla_plan' => '2',
'help_topic' => '2',
'ticket_source' => '2',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
'ticket_priority' => '2',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/edit?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function deleteTicket()
{
$data = [
'ticket_id' => [11],
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/delete?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function openedTickets()
{
$url = $this->server.'helpdesk/open?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function unassignedTickets()
{
//dd('dsdf');
$url = $this->server.'helpdesk/unassigned?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
//dd($respose);
return $respose;
}
public function closeTickets()
{
$url = $this->server.'helpdesk/closed?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getAgents()
{
$url = $this->server.'helpdesk/agents?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getTeams()
{
$url = $this->server.'helpdesk/teams?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function assignTicket()
{
$data = [
'ticket_id' => 1,
'user' => 'vijay.sebastian@ladybirdweb.com',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/assign?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function getCustomers()
{
$search = [
'search' => 'vij',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($search, '', '&');
$url = $this->server.'helpdesk/customers?token='.\Config::get('app.token');
$url = $url.'&'.$data;
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getCustomer()
{
$search = [
'user_id' => '1',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($search, '', '&');
$url = $this->server.'helpdesk/customer?token='.\Config::get('app.token');
$url = $url.'&'.$data;
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getSearch()
{
$search = [
'search' => 'api',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($search, '', '&');
$url = $this->server.'helpdesk/ticket-search?token='.\Config::get('app.token');
$url = $url.'&'.$data;
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function ticketThreads()
{
$search = [
'id' => '1',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($search, '', '&');
$url = $this->server.'helpdesk/ticket-thread?token='.\Config::get('app.token');
$url = $url.'&'.$data;
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function url()
{
$search = [
'url' => 'http://localhost/faveo-helpdesk-github/public/',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($search, '', '&');
$url = $this->server.'helpdesk/url?token='.\Config::get('app.token');
$url = $url.'&'.$data;
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function generateApiKey()
{
$url = $this->server.'helpdesk/api_key?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getHelpTopic()
{
$url = $this->server.'helpdesk/help-topic?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getSlaPlan()
{
$url = $this->server.'helpdesk/sla-plan?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getPriority()
{
$url = $this->server.'helpdesk/priority?api_key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getDepartment()
{
$url = $this->server.'helpdesk/department?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function getTickets()
{
$url = $this->server.'helpdesk/tickets?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function inbox()
{
$url = $this->server.'helpdesk/inbox?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function internalNote()
{
$data = [
'ticketid' => '1',
'userid' => 1,
'body' => 'Testing the api internal note',
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
];
$data = http_build_query($data, '', '&');
$url = $this->server.'helpdesk/internal-note?token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callPostApi($url, $data);
return $respose;
}
public function trash()
{
$url = $this->server.'helpdesk/trash?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
}
public function myTickets()
{
try {
$url = $this->server.'helpdesk/my-tickets?user_id=1&api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
} catch (\Exception $e) {
$error = $e->getMessage();
$line = $e->getLine();
$file = $e->getFile();
return response()->json(compact('error', 'file', 'line'));
}
}
public function getTicketById()
{
try {
$url = $this->server.'helpdesk/my-tickets?id=1&api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
return $respose;
} catch (\Exception $e) {
$error = $e->getMessage();
$line = $e->getLine();
$file = $e->getFile();
return response()->json(compact('error', 'file', 'line'));
}
}
public function getCustomersWith()
{
try {
//dd($this->server);
$url = $this->server.'helpdesk/customers-custom?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
$_this = new self();
$respose = $_this->callGetApi($url);
dd($respose);
return $respose;
} catch (\Exception $e) {
$error = $e->getMessage();
$line = $e->getLine();
$file = $e->getFile();
return response()->json(compact('error', 'file', 'line'));
}
}
}

View File

@@ -50,7 +50,7 @@ class TokenAuthController extends Controller
//$credentials = $request->only('email', 'password');
try {
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active' => 1])) {
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active'=>1])) {
return response()->json(['error' => 'invalid_credentials', 'status_code' => 401]);
}
} catch (JWTException $e) {

View File

@@ -183,11 +183,9 @@ class AuthController extends Controller
$message12 = '';
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$sms = Plugin::select('status')->where('name', '=', 'SMS')->first();
// Event for login
\Event::fire(new \App\Events\LoginEvent($request));
if ($request_array['email'] != '') {
$var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]);
}
// Event for login
\Event::fire(new \App\Events\LoginEvent($request));
$var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]);
if ($settings->status == 1 || $settings->status == '1') {
if (count($sms) > 0) {
if ($sms->status == 1 || $sms->status == '1') {
@@ -196,7 +194,7 @@ class AuthController extends Controller
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup');
}
} else {
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup');
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail');
}
} else {
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail');

View File

@@ -50,40 +50,44 @@ class PasswordController extends Controller
*/
public function postEmail(Request $request)
{
$date = date('Y-m-d H:i:s');
$this->validate($request, ['email' => 'required']);
\Event::fire('reset.password', []);
$user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first();
if (isset($user)) {
$user1 = $user->email;
try {
$date = date('Y-m-d H:i:s');
$this->validate($request, ['email' => 'required']);
\Event::fire('reset.password', []);
$user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first();
if (isset($user)) {
$user1 = $user->email;
//gen new code and pass
$code = str_random(60);
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
if (isset($password_reset_table)) {
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
if (isset($password_reset_table)) {
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
// $password_reset_table->token = $code;
// $password_reset_table->update(['token' => $code]);
} else {
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
}
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->first_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)], true);
if ($user->mobile != '' && $user->mobile != null) {
if ($user->first_name) {
$name = $user->first_name;
} else {
$name = $user->user_name;
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
}
$value = [
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->first_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)], true);
if ($user->mobile != '' && $user->mobile != null) {
if ($user->first_name) {
$name = $user->first_name;
} else {
$name = $user->user_name;
}
$value = [
'url' => url('password/reset/'.$code),
'name' => $name,
'mobile' => $user->mobile,
'code' => $user->country_code, ];
\Event::fire('reset.password2', [$value]);
}
\Event::fire('reset.password2', [$value]);
}
return redirect()->back()->with('status', Lang::get('lang.we_have_e-mailed_your_password_reset_link'));
} else {
return redirect()->back()->with('fails', Lang::get("lang.we_can't_find_a_user_with_that_e-mail_address"));
return redirect()->back()->with('status', Lang::get('lang.we_have_e-mailed_your_password_reset_link'));
} else {
return redirect()->back()->with('fails', Lang::get("lang.we_can't_find_a_user_with_that_e-mail_address"));
}
} catch (\Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
}

View File

@@ -65,7 +65,7 @@ class FormController extends Controller
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
if (!\Auth::check() && ($settings->status == 1 || $settings->status == '1')) {
return redirect('auth/login')->with(['login_require' => 'Please login to your account for submitting a ticket', 'referer' => 'form']);
return redirect('auth/login')->with(['login_require'=> 'Please login to your account for submitting a ticket', 'referer' => 'form']);
}
$location = GeoIP::getLocation();
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
@@ -179,7 +179,7 @@ class FormController extends Controller
// $priority = $ticket_settings->first()->priority;
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
$user_priority = CommonSettings::select('status')->where('option_name', '=', 'user_priority')->first();
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
if (!($request->input('priority'))) {
$priority = $default_priority->priority_id;
} else {

View File

@@ -12,9 +12,9 @@ use App\User;
class NotificationController extends Controller
{
/**
*********************************************
* ********************************************
* Class Notification Controller
*********************************************
* ********************************************
* This controller is used to generate in app notification
* under the folling occurrence
* 1. Ticket Creation
@@ -111,7 +111,7 @@ class NotificationController extends Controller
public function show()
{
$notifications = $this->getNotifications();
//dd($notifications);
return view('notifications-all', compact('notifications'));
}
@@ -132,6 +132,23 @@ class NotificationController extends Controller
return 1;
}
public function deleteAll()
{
try {
$notifications = new Notification();
if ($notifications->count() > 0) {
foreach ($notifications->get() as $notification) {
$notification->delete();
}
}
$notifications->dummyDelete();
return redirect()->back()->with('success', 'deleted');
} catch (\Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
}
/**
* get the page to list the notifications.
*
@@ -139,17 +156,15 @@ class NotificationController extends Controller
*/
public static function getNotifications()
{
$notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id')
->join('notification_types', 'notifications.type_id', '=', 'notification_types.id')
->where('user_notification.user_id', '=', \Auth::user()->id)
->select('notification_types.id as id', 'notifications.id as notification_id',
'user_notification.user_id as user_id', 'user_notification.is_read as is_read',
'user_notification.created_at as created_at', 'user_notification.updated_at as updated_at', 'notifications.model_id as model_id',
'notifications.userid_created as userid_created',
'notifications.type_id as type_id', 'notification_types.message as message',
'notification_types.type as type', 'notification_types.icon_class as icon_class')
->orderBy('user_notification.created_at', 'desc')
->paginate(10);
$notifications = UserNotification::with([
'notification.type' => function ($query) {
$query->select('id', 'message', 'type');
}, 'users' => function ($query) {
$query->select('id', 'email', 'profile_pic');
}, 'notification.model' => function ($query) {
$query->select('id', 'ticket_number');
},
]);
return $notifications;
}

View File

@@ -50,26 +50,24 @@ class PhpMailController extends Controller
*/
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;
}
$email_id = '';
$emails = Emails::where('department', '=', $dept_id)->first();
$email = Email::find(1);
if ($emails && $emails->sending_status) {
$email_id = $emails->id;
} else {
$email_id = $email->sys_email;
}
return $email_id;
}
public function sendmail($from, $to, $message, $template_variables)
{
$this->setQueue();
$job = new \App\Jobs\SendEmail($from, $to, $message, $template_variables);
$dispatch = $this->dispatch($job);
return $dispatch;
$this->dispatch($job);
}
public function sendEmail($from, $to, $message, $template_variables)

View File

@@ -279,7 +279,7 @@ class SettingsController extends Controller
public function Plugins()
{
return view('themes.default1.admin.helpdesk.settings.plugins', ['info' => 1]);
return view('themes.default1.admin.helpdesk.settings.plugins');
}
public function GetPlugin()
@@ -406,7 +406,7 @@ class SettingsController extends Controller
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
chmod($app, 0644);
$str = "\n\n\t\t\t'App\\Plugins\\$filename"."\\ServiceProvider',";
$line_i_am_looking_for = 187;
$line_i_am_looking_for = 194;
$lines = file($app, FILE_IGNORE_NEW_LINES);
$lines[$line_i_am_looking_for] = $str;
file_put_contents($app, implode("\n", $lines));
@@ -578,7 +578,7 @@ class SettingsController extends Controller
if (!$plug) {
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
$str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',";
$line_i_am_looking_for = 187;
$line_i_am_looking_for = 194;
$lines = file($app, FILE_IGNORE_NEW_LINES);
$lines[$line_i_am_looking_for] = $str;
file_put_contents($app, implode("\n", $lines));
@@ -592,7 +592,7 @@ class SettingsController extends Controller
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
$str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',";
$line_i_am_looking_for = 187;
$line_i_am_looking_for = 194;
$lines = file($app, FILE_IGNORE_NEW_LINES);
$lines[$line_i_am_looking_for] = $str;
file_put_contents($app, implode("\n", $lines));

View File

@@ -3,7 +3,6 @@
namespace App\Http\Middleware;
use Closure;
use Lang;
/**
* CheckRole.
@@ -26,6 +25,6 @@ class CheckRole
return $next($request);
}
return redirect('guest')->with('fails', Lang::get('lang.not-autherised'));
return redirect('guest')->with('fails', 'You are not Autherised');
}
}

View File

@@ -3,7 +3,6 @@
namespace App\Http\Middleware;
use Closure;
use Lang;
/**
* CheckRoleAgent.
@@ -26,6 +25,6 @@ class CheckRoleAgent
return $next($request);
}
return redirect('dashboard')->with('fails', Lang::get('lang.not-autherised'));
return redirect('dashboard')->with('fails', 'You are not Autherised');
}
}

View File

@@ -3,7 +3,6 @@
namespace App\Http\Middleware;
use Closure;
use Lang;
/**
* CheckRoleUser.
@@ -26,6 +25,6 @@ class CheckRoleUser
return $next($request);
}
return redirect('guest')->with('fails', Lang::get('lang.not-autherised'));
return redirect('guest')->with('fails', 'You are not Autherised');
}
}

View File

@@ -36,12 +36,12 @@ class TaskRequest extends Request
public function messages()
{
return [
'fetching-commands.required_if' => 'Please choose your Email Fetching timing',
'notification-commands.required_if' => 'Please choose your Email Notification timing',
'work-commands.required_if' => 'Please choose your Auto-close Workflow timing',
'workflow-dailyAt.required_if' => 'Please enter the time for Auto-close Workflow timing',
'notification-dailyAt.required_if' => 'Please enter the time for Email Notification timing',
'fetching-dailyAt.required_if' => 'Please enter the time for Email Fetching timing',
'fetching-commands.required_if' => 'Please choose your Email Fetching timing',
'notification-commands.required_if'=> 'Please choose your Email Notification timing',
'work-commands.required_if' => 'Please choose your Auto-close Workflow timing',
'workflow-dailyAt.required_if' => 'Please enter the time for Auto-close Workflow timing',
'notification-dailyAt.required_if' => 'Please enter the time for Email Notification timing',
'fetching-dailyAt.required_if' => 'Please enter the time for Email Fetching timing',
];
}

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Http\Requests\helpdesk;
use App\Http\Requests\Request;
use App\Model\helpdesk\Filters\Label;
/**
* AgentUpdate.
*
* @author Ladybird <info@ladybirdweb.com>
*/
class LableUpdate extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$label_data = \Request::segments();
$label = Label::find($label_data[1]);
return [
'title' => 'required|max:10|unique:labels,title,'.$label->id,
'color' => 'required|regex:/#([a-fA-F0-9]{3}){1,2}\b/',
'order' => 'required|integer',
];
}
}

View File

@@ -30,10 +30,10 @@ class MailRequest extends Request
}
$rules = [
'email_address' => $email_address_rule,
'email_name' => 'required',
'password' => 'required',
'sending_protocol' => 'required_if:sending_status,on',
'email_address' => $email_address_rule,
'email_name' => 'required',
'password' => 'required',
'sending_protocol'=> 'required_if:sending_status,on',
];
$driver = $this->input('sending_protocol');
$driver_rules = $this->getDriver($driver);
@@ -61,14 +61,14 @@ class MailRequest extends Request
switch ($short) {
case 'mailgun':
$rules = [
'domain' => 'required',
'secret' => 'required',
'domain'=> 'required',
'secret'=> 'required',
];
return $rules;
case 'mandrill':
$rules = [
'secret' => 'required',
'secret'=> 'required',
];
return $rules;

View File

@@ -30,13 +30,13 @@ class PriorityRequest extends Request
{
return [
'priority' => 'required|max:10',
'status' => 'required',
'priority_desc' => 'required|max:255',
'priority_color' => 'required',
'ispublic' => 'required',
'priority_successfully_updated' => 'priority successfully updated',
'priority_successfully_created!!!' => 'priority successfully created',
'priority' => 'required|max:10',
'status' => 'required',
'priority_desc' => 'required|max:255',
'priority_color' => 'required',
'ispublic' => 'required',
'priority_successfully_updated' => 'priority successfully updated',
'priority_successfully_created!!!'=> 'priority successfully created',
];
}

View File

@@ -33,7 +33,7 @@ class QueueRequest extends Request
{
$rules = [];
if (count($request) > 0) {
foreach ($request as $key => $value) {
foreach ($request as $key=>$value) {
$rules[$key] = 'required';
}
}

View File

@@ -0,0 +1,196 @@
<?php
namespace App\Http\ViewComposers;
use App\Model\helpdesk\Agent\Department;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Ticket\Tickets;
use App\User;
use Auth;
use Illuminate\View\View;
class AgentLayout
{
/**
* The user repository implementation.
*
* @var UserRepository
*/
protected $company;
protected $users;
protected $tickets;
protected $department;
/**
* Create a new profile composer.
*
* @param
*
* @return void
*/
public function __construct(Company $company, User $users, Tickets $tickets, Department $department)
{
$this->company = $company;
$this->auth = Auth::user();
$this->users = $users;
$this->tickets = $tickets;
$this->department = $department;
}
/**
* Bind data to the view.
*
* @param View $view
*
* @return void
*/
public function compose(View $view)
{
$notifications = \App\Http\Controllers\Common\NotificationController::getNotifications();
$view->with([
'company' => $this->company,
'notifications' => $notifications,
'myticket' => $this->myTicket(),
'unassigned' => $this->unassigned(),
'followup_ticket' => $this->followupTicket(),
'deleted' => $this->deleted(),
'tickets' => $this->inbox(),
'department' => $this->departments(),
'overdues' => $this->overdues(),
'due_today' => $this->getDueToday(),
]);
}
public function users()
{
return $this->users->select('id', 'profile_pic');
}
public function tickets()
{
return $this->tickets->select('id', 'ticket_number');
}
public function departments()
{
$array = [];
$tickets = $this->tickets;
if (\Auth::user()->role == 'agent') {
$tickets = $tickets->where('tickets.dept_id', '=', \Auth::user()->primary_dpt);
}
$tickets = $tickets
->leftJoin('department as dep', 'tickets.dept_id', '=', 'dep.id')
->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id')
->select('dep.name as name', 'ticket_status.name as status', \DB::raw('COUNT(ticket_status.name) as count'))
->groupBy('dep.name', 'ticket_status.name')
->get();
$grouped = $tickets->groupBy('name');
$status = [];
foreach ($grouped as $key => $group) {
$status[$key] = $group->keyBy('status');
}
return collect($status);
}
public function myTicket()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('assigned_to', $this->auth->id)
->where('status', '1');
} elseif ($this->auth->role == 'agent') {
return $ticket->where('assigned_to', $this->auth->id)
->where('status', '1');
}
}
public function unassigned()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('assigned_to', '=', null)
->where('status', '=', '1')
->select('id');
} elseif ($this->auth->role == 'agent') {
return $ticket->where('assigned_to', '=', null)
->where('status', '=', '1')
->where('dept_id', '=', $this->auth->primary_dpt)
->select('id');
}
}
public function followupTicket()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('status', '1')->where('follow_up', '1')->select('id');
} elseif ($this->auth->role == 'agent') {
return $ticket->where('status', '1')->where('follow_up', '1')->select('id');
}
}
public function deleted()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('status', '5')->select('id');
} elseif ($this->auth->role == 'agent') {
return $ticket->where('status', '5')->where('dept_id', '=', $this->auth->primary_dpt)
->select('id');
}
}
public function inbox()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->whereIn('status', [1, 7])->select('id');
} elseif ($this->auth->role == 'agent') {
return $ticket->whereIn('status', [1, 7])
->where('dept_id', '=', $this->auth->primary_dpt)
->orWhere('assigned_to', '=', Auth::user()->id)
->select('id');
}
}
public function overdues()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('status', '=', 1)
->where('isanswered', '=', 0)
->whereNotNull('tickets.duedate')
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
->where('tickets.duedate', '<', \Carbon\Carbon::now())
->select('tickets.id');
} elseif ($this->auth->role == 'agent') {
return $ticket->where('status', '=', 1)
->where('isanswered', '=', 0)
->whereNotNull('tickets.duedate')
->where('dept_id', '=', $this->auth->primary_dpt)
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
->where('tickets.duedate', '<', \Carbon\Carbon::now())
->select('tickets.id');
}
}
public function getDueToday()
{
$ticket = $this->tickets();
if ($this->auth->role == 'admin') {
return $ticket->where('status', '=', 1)
->where('status', '=', 1)
->where('isanswered', '=', 0)
->whereNotNull('duedate')
->whereRaw('date(duedate) = ?', [date('Y-m-d')]);
} elseif ($this->auth->role == 'agent') {
return $ticket->where('status', '=', 1)
->where('status', '=', 1)
->where('isanswered', '=', 0)
->whereNotNull('duedate')
->where('dept_id', '=', $this->auth->primary_dpt)
->whereRaw('date(duedate) = ?', [date('Y-m-d')]);
}
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\ViewComposers;
use Auth;
use Illuminate\View\View;
class AuthUser
{
protected $user;
public function __construct()
{
$this->user = Auth::user();
}
public function compose(View $view)
{
$view->with([
'auth_user_role' => $this->user->role,
'auth_user_id' => $this->user->id,
'auth_user_profile_pic' => $this->user->profile_pic,
'auth_name' => $this->user->name(),
'auth_user_active' => $this->user->active,
'auth_user_primary_dept'=> $this->user->primary_dept,
'auth_user_assign_group'=> $this->user->assign_group,
]);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Http\ViewComposers;
use App\Model\Update\BarNotification;
use Illuminate\View\View;
class UpdateNotification
{
public function __construct()
{
}
public function compose(View $view)
{
$notification = new BarNotification();
$notice = $notification->where('value', '!=', '')->select('value')->get();
$view->with(['notification' => $notice]);
}
}

615
app/Http/breadcrumbs.php Normal file
View File

@@ -0,0 +1,615 @@
<?php
Breadcrumbs::register('dashboard', function ($breadcrumbs) {
//$breadcrumbs->parent('/');
$breadcrumbs->push(Lang::get('lang.dashboard'), route('dashboard'));
});
Breadcrumbs::register('notification.list', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push('All Notifications', route('notification.list'));
});
Breadcrumbs::register('notification.settings', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push('Notifications Settings', route('notification.settings'));
});
Breadcrumbs::register('groups.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.groups'), route('groups.index'));
});
Breadcrumbs::register('groups.create', function ($breadcrumbs) {
$breadcrumbs->parent('groups.index');
$breadcrumbs->push(Lang::get('lang.create'), route('groups.create'));
});
Breadcrumbs::register('groups.edit', function ($breadcrumbs) {
$breadcrumbs->parent('groups.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('groups/{groups}/edit'));
});
Breadcrumbs::register('departments.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.departments'), route('departments.index'));
});
Breadcrumbs::register('departments.create', function ($breadcrumbs) {
$breadcrumbs->parent('departments.index');
$breadcrumbs->push(Lang::get('lang.create'), route('departments.create'));
});
Breadcrumbs::register('departments.edit', function ($breadcrumbs) {
$breadcrumbs->parent('departments.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('departments/{departments}/edit'));
});
Breadcrumbs::register('teams.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.teams'), route('teams.index'));
});
Breadcrumbs::register('teams.create', function ($breadcrumbs) {
$breadcrumbs->parent('teams.index');
$breadcrumbs->push(Lang::get('lang.create'), route('teams.create'));
});
Breadcrumbs::register('teams.edit', function ($breadcrumbs) {
$breadcrumbs->parent('teams.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('teams/{teams}/edit'));
});
Breadcrumbs::register('agents.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.agents'), route('agents.index'));
});
Breadcrumbs::register('agents.create', function ($breadcrumbs) {
$breadcrumbs->parent('agents.index');
$breadcrumbs->push(Lang::get('lang.create'), route('agents.create'));
});
Breadcrumbs::register('agents.edit', function ($breadcrumbs) {
$breadcrumbs->parent('agents.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('agents/{agents}/edit'));
});
Breadcrumbs::register('emails.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.emails'), route('emails.index'));
});
Breadcrumbs::register('emails.create', function ($breadcrumbs) {
$breadcrumbs->parent('emails.index');
$breadcrumbs->push(Lang::get('lang.create'), route('emails.create'));
});
Breadcrumbs::register('emails.edit', function ($breadcrumbs) {
$breadcrumbs->parent('emails.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('emails/{emails}/edit'));
});
Breadcrumbs::register('banlist.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.banlists'), route('banlist.index'));
});
Breadcrumbs::register('banlist.create', function ($breadcrumbs) {
$breadcrumbs->parent('banlist.index');
$breadcrumbs->push(Lang::get('lang.add'), route('banlist.create'));
});
Breadcrumbs::register('banlist.edit', function ($breadcrumbs) {
$breadcrumbs->parent('banlist.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('agents/{agents}/edit'));
});
Breadcrumbs::register('template-sets.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push('All Template sets', route('template-sets.index'));
});
Breadcrumbs::register('show.templates', function ($breadcrumbs) {
$page = App\Model\Common\Template::whereId(1)->first();
$breadcrumbs->parent('template-sets.index');
$breadcrumbs->push('All Templates', route('show.templates', $page->id));
});
Breadcrumbs::register('templates.edit', function ($breadcrumbs) {
$page = App\Model\Common\Template::whereId(1)->first();
$breadcrumbs->parent('show.templates');
$breadcrumbs->push('Edit Template', route('templates.edit', $page->id));
});
Breadcrumbs::register('getdiagno', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.email_diagnostic'), route('getdiagno'));
});
Breadcrumbs::register('helptopic.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.help_topics'), route('helptopic.index'));
});
Breadcrumbs::register('helptopic.create', function ($breadcrumbs) {
$breadcrumbs->parent('helptopic.index');
$breadcrumbs->push(Lang::get('lang.create'), route('helptopic.create'));
});
Breadcrumbs::register('helptopic.edit', function ($breadcrumbs) {
$breadcrumbs->parent('helptopic.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('helptopic/{helptopic}/edit'));
});
Breadcrumbs::register('sla.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.sla-plans'), route('sla.index'));
});
Breadcrumbs::register('sla.create', function ($breadcrumbs) {
$breadcrumbs->parent('sla.index');
$breadcrumbs->push(Lang::get('lang.create'), route('sla.create'));
});
Breadcrumbs::register('sla.edit', function ($breadcrumbs) {
$breadcrumbs->parent('sla.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('sla/{sla}/edit'));
});
Breadcrumbs::register('forms.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.forms'), route('forms.index'));
});
Breadcrumbs::register('forms.create', function ($breadcrumbs) {
$breadcrumbs->parent('forms.index');
$breadcrumbs->push(Lang::get('lang.create'), route('forms.create'));
});
Breadcrumbs::register('forms.edit', function ($breadcrumbs) {
$breadcrumbs->parent('forms.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('forms/{forms}/edit'));
});
Breadcrumbs::register('forms.show', function ($breadcrumbs) {
$breadcrumbs->parent('forms.index');
$breadcrumbs->push(Lang::get('lang.view'), url('forms/{forms}'));
});
Breadcrumbs::register('forms.add.child', function ($breadcrumbs) {
$breadcrumbs->parent('forms.index');
$breadcrumbs->push('Add Child', url('forms/add-child/{forms}'));
});
Breadcrumbs::register('get.job.scheder', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.cron-jobs'), route('get.job.scheder'));
});
Breadcrumbs::register('getcompany', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.company_settings'), route('getcompany'));
});
Breadcrumbs::register('getsystem', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.system-settings'), route('getsystem'));
});
Breadcrumbs::register('getticket', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.ticket-setting'), route('getticket'));
});
Breadcrumbs::register('getemail', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.email-settings'), route('getemail'));
});
Breadcrumbs::register('getresponder', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.auto_responce'), route('getresponder'));
});
Breadcrumbs::register('getalert', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.alert_notices_setitngs'), route('getalert'));
});
Breadcrumbs::register('security.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.security_settings'), route('security.index'));
});
// Templates > Upload Templates
Breadcrumbs::register('security.create', function ($breadcrumbs) {
$breadcrumbs->parent('security.index');
$breadcrumbs->push('Upload security', route('security.create'));
});
// Templates > [Templates Name]
Breadcrumbs::register('security.show', function ($breadcrumbs, $photo) {
$breadcrumbs->parent('security.index');
$breadcrumbs->push($photo->title, route('security.show', $photo->id));
});
// Templates > [Templates Name] > Edit Templates
Breadcrumbs::register('security.edit', function ($breadcrumbs, $photo) {
$breadcrumbs->parent('security.show', $photo);
$breadcrumbs->push('Edit security', route('security.edit', $photo->id));
});
Breadcrumbs::register('close-workflow.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.close_ticket_workflow_settings'), route('close-workflow.index'));
});
Breadcrumbs::register('statuss.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.status_settings'), route('statuss.index'));
});
Breadcrumbs::register('statuss.create', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push('Create Status', route('statuss.create'));
});
Breadcrumbs::register('status.edit', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push('Edit Status', url('status/edit/{id}'));
});
Breadcrumbs::register('ratings.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.ratings_settings'), route('ratings.index'));
});
Breadcrumbs::register('rating.create', function ($breadcrumbs) {
$breadcrumbs->parent('ratings.index');
$breadcrumbs->push('Create Ratings', route('rating.create'));
});
Breadcrumbs::register('rating.edit', function ($breadcrumbs) {
$page = App\Model\helpdesk\Ratings\Rating::whereId(1)->first();
$breadcrumbs->parent('ratings.index');
$breadcrumbs->push('Edit Ratings');
});
Breadcrumbs::register('admin-profile', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.profile'), route('admin-profile'));
});
Breadcrumbs::register('widgets', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.widget-settings'), route('widgets'));
});
Breadcrumbs::register('social.buttons', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.social-widget-settings'), route('social.buttons'));
});
Breadcrumbs::register('setting', function ($breadcrumbs) {
$breadcrumbs->push(Lang::get('lang.admin_panel'), route('setting'));
});
Breadcrumbs::register('plugins', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.plugins'), route('plugins'));
});
Breadcrumbs::register('LanguageController', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.language-settings'), route('LanguageController'));
});
Breadcrumbs::register('add-language', function ($breadcrumbs) {
$breadcrumbs->parent('LanguageController');
$breadcrumbs->push(Lang::get('lang.add'), route('add-language'));
});
Breadcrumbs::register('workflow', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.ticket_workflow'), route('workflow'));
});
Breadcrumbs::register('workflow.create', function ($breadcrumbs) {
$breadcrumbs->parent('workflow');
$breadcrumbs->push(Lang::get('lang.create'), route('workflow.create'));
});
Breadcrumbs::register('workflow.edit', function ($breadcrumbs) {
$breadcrumbs->parent('workflow');
$breadcrumbs->push(Lang::get('lang.edit'), url('workflow/edit/{id}'));
});
Breadcrumbs::register('api.settings.get', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.api_settings'), route('api.settings.get'));
});
Breadcrumbs::register('err.debug.settings', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.error-debug-settings'), route('err.debug.settings'));
});
Breadcrumbs::register('closed.approvel.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.approvel_ticket_list'), route('closed.approvel.ticket'));
});
Breadcrumbs::register('user.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.user_directory'), route('user.index'));
});
Breadcrumbs::register('user.create', function ($breadcrumbs) {
$breadcrumbs->parent('user.index');
$breadcrumbs->push(Lang::get('lang.create'), route('user.create'));
});
Breadcrumbs::register('user.edit', function ($breadcrumbs) {
$breadcrumbs->parent('user.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('user/{user}/edit'));
});
Breadcrumbs::register('user.show', function ($breadcrumbs) {
$breadcrumbs->parent('user.index');
$breadcrumbs->push(Lang::get('lang.view-profile'), url('user/{user}'));
});
Breadcrumbs::register('user.export', function ($breadcrumbs) {
$breadcrumbs->parent('user.index');
$breadcrumbs->push('Export', url('user-export'));
});
Breadcrumbs::register('organizations.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.organizations'), route('organizations.index'));
});
Breadcrumbs::register('organizations.create', function ($breadcrumbs) {
$breadcrumbs->parent('organizations.index');
$breadcrumbs->push(Lang::get('lang.create'), route('organizations.create'));
});
Breadcrumbs::register('organizations.edit', function ($breadcrumbs) {
$breadcrumbs->parent('organizations.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('organizations/{organizations}/edit'));
});
Breadcrumbs::register('organizations.show', function ($breadcrumbs) {
$breadcrumbs->parent('organizations.index');
$breadcrumbs->push(Lang::get('lang.view_organization_profile'), url('organizations/{organizations}'));
});
Breadcrumbs::register('canned.list', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.canned_response'), route('canned.list'));
});
Breadcrumbs::register('canned.create', function ($breadcrumbs) {
$breadcrumbs->parent('canned.list');
$breadcrumbs->push(Lang::get('lang.create'), route('canned.create'));
});
Breadcrumbs::register('canned.edit', function ($breadcrumbs) {
$breadcrumbs->parent('canned.list');
$breadcrumbs->push(Lang::get('lang.edit'), url('canned/edit/{id}'));
});
Breadcrumbs::register('profile', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.my_profile'), route('profile'));
});
Breadcrumbs::register('agent-profile-edit', function ($breadcrumbs) {
$breadcrumbs->parent('profile');
$breadcrumbs->push(Lang::get('lang.edit'), url('profile-edit'));
});
Breadcrumbs::register('inbox.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.inbox'), route('inbox.ticket'));
});
Breadcrumbs::register('open.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.open'), route('open.ticket'));
});
Breadcrumbs::register('answered.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.answered'), route('answered.ticket'));
});
Breadcrumbs::register('myticket.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.my_tickets'), route('myticket.ticket'));
});
Breadcrumbs::register('overdue.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.overdue'), route('overdue.ticket'));
});
Breadcrumbs::register('closed.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.closed'), route('closed.ticket'));
});
Breadcrumbs::register('assigned.ticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.assigned'), route('assigned.ticket'));
});
Breadcrumbs::register('newticket', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.create'), route('newticket'));
});
Breadcrumbs::register('ticket.thread', function ($breadcrumbs, $id) {
$breadcrumbs->parent('dashboard');
$ticket_number = App\Model\helpdesk\Ticket\Tickets::where('id', '=', $id)->first();
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.$ticket_number->ticket_number, url('/thread/{id}'));
});
Breadcrumbs::register('get-trash', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.trash'), route('get-trash'));
});
Breadcrumbs::register('unassigned', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.tickets').'&nbsp; > &nbsp;'.Lang::get('lang.unassigned'), route('unassigned'));
});
Breadcrumbs::register('dept.open.ticket', function ($breadcrumbs, $dept) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.department').'&nbsp; > &nbsp;'.$dept.'&nbsp; > &nbsp;'.Lang::get('lang.open_tickets'), url('/{dept}/open'));
});
Breadcrumbs::register('dept.closed.ticket', function ($breadcrumbs, $dept) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.department').'&nbsp; > &nbsp;'.$dept.'&nbsp; > &nbsp;'.Lang::get('lang.closed_tickets'), url('/{dept}/closed'));
});
Breadcrumbs::register('report.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.dashboard'), route('dashboard'));
});
Breadcrumbs::register('home', function ($breadcrumbs) {
$breadcrumbs->push('Home', route('home'));
});
Breadcrumbs::register('/', function ($breadcrumbs) {
$breadcrumbs->push('Home', route('/'));
});
Breadcrumbs::register('form', function ($breadcrumbs) {
$breadcrumbs->push('Create Ticket', route('form'));
});
Breadcrumbs::register('check_ticket', function ($breadcrumbs, $id) {
$page = \App\Model\helpdesk\Ticket\Tickets::whereId(1)->first();
$breadcrumbs->parent('ticket2');
$breadcrumbs->push('Check Ticket');
});
Breadcrumbs::register('show.ticket', function ($breadcrumbs) {
$breadcrumbs->push('Ticket', route('form'));
});
Breadcrumbs::register('client.profile', function ($breadcrumbs) {
$breadcrumbs->push('My Profile');
});
Breadcrumbs::register('ticket2', function ($breadcrumbs) {
$breadcrumbs->push('My Tickets', route('ticket2'));
});
Breadcrumbs::register('client-verify-number', function ($breadcrumbs) {
$breadcrumbs->push('Profile', route('client-verify-number'));
});
Breadcrumbs::register('post-client-verify-number', function ($breadcrumbs) {
$breadcrumbs->push('My Profile', route('post-client-verify-number'));
});
Breadcrumbs::register('error500', function ($breadcrumbs) {
$breadcrumbs->push('500');
});
Breadcrumbs::register('error404', function ($breadcrumbs) {
$breadcrumbs->push('404');
});
Breadcrumbs::register('errordb', function ($breadcrumbs) {
$breadcrumbs->push('Error establishing connection to database');
});
Breadcrumbs::register('unauth', function ($breadcrumbs) {
$breadcrumbs->push('Unauthorized Access');
});
Breadcrumbs::register('board.offline', function ($breadcrumbs) {
$breadcrumbs->push('Board Offline');
});
Breadcrumbs::register('category.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.category'), route('category.index'));
});
Breadcrumbs::register('category.create', function ($breadcrumbs) {
$breadcrumbs->parent('category.index');
$breadcrumbs->push(Lang::get('lang.add'), route('category.create'));
});
Breadcrumbs::register('category.edit', function ($breadcrumbs) {
$breadcrumbs->parent('category.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('category/{category}/edit'));
});
Breadcrumbs::register('category.show', function ($breadcrumbs) {
$breadcrumbs->parent('category.index');
$breadcrumbs->push(Lang::get('lang.view'), url('category/{category}'));
});
Breadcrumbs::register('article.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.article'), route('article.index'));
});
Breadcrumbs::register('article.create', function ($breadcrumbs) {
$breadcrumbs->parent('article.index');
$breadcrumbs->push(Lang::get('lang.add'), route('article.create'));
});
Breadcrumbs::register('article.edit', function ($breadcrumbs) {
$breadcrumbs->parent('article.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('article/{article}/edit'));
});
Breadcrumbs::register('article.show', function ($breadcrumbs) {
$breadcrumbs->parent('article.index');
$breadcrumbs->push(Lang::get('lang.view'), url('article/{article}'));
});
Breadcrumbs::register('settings', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.settings'), route('settings'));
});
Breadcrumbs::register('comment', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.comments'), route('comment'));
});
Breadcrumbs::register('page.index', function ($breadcrumbs) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.pages'), route('page.index'));
});
Breadcrumbs::register('page.create', function ($breadcrumbs) {
$breadcrumbs->parent('page.index');
$breadcrumbs->push(Lang::get('lang.add'), route('page.create'));
});
Breadcrumbs::register('page.edit', function ($breadcrumbs) {
$breadcrumbs->parent('page.index');
$breadcrumbs->push(Lang::get('lang.edit'), url('page/{page}/edit'));
});
Breadcrumbs::register('page.show', function ($breadcrumbs) {
$breadcrumbs->parent('page.index');
$breadcrumbs->push(Lang::get('lang.view'), url('page/{page}'));
});
Breadcrumbs::register('article-list', function ($breadcrumbs) {
$breadcrumbs->push('Article List', route('article-list'));
});
Breadcrumbs::register('search', function ($breadcrumbs) {
$breadcrumbs->push('Knowledge-base', route('home'));
$breadcrumbs->push('Search Result');
});
Breadcrumbs::register('show', function ($breadcrumbs) {
$breadcrumbs->push('Knowledge-base', route('home'));
$breadcrumbs->push('Article List', route('article-list'));
$breadcrumbs->push('Article');
});
Breadcrumbs::register('category-list', function ($breadcrumbs) {
$breadcrumbs->push('Category List', route('category-list'));
});
Breadcrumbs::register('categorylist', function ($breadcrumbs) {
$breadcrumbs->push('Category List', route('category-list'));
$breadcrumbs->push('Category');
});
Breadcrumbs::register('contact', function ($breadcrumbs) {
$breadcrumbs->parent('/');
$breadcrumbs->push(Lang::get('lang.contact'), route('contact'));
});
Breadcrumbs::register('pages', function ($breadcrumbs) {
$breadcrumbs->push('Pages');
});
Breadcrumbs::register('queue', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.queues'), route('queue'));
});
Breadcrumbs::register('queue.edit', function ($breadcrumbs) {
$id = \Input::segment(2);
$breadcrumbs->parent('queue');
$breadcrumbs->push(Lang::get('lang.edit'), route('queue.edit', $id));
});
Breadcrumbs::register('url.settings', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.url'), route('url.settings'));
});
Breadcrumbs::register('social', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.social-media'), route('social'));
});
Breadcrumbs::register('social.media', function ($breadcrumbs) {
$id = \Input::segment(2);
$breadcrumbs->parent('social');
$breadcrumbs->push(Lang::get('lang.settings'), route('social.media', $id));
});
Breadcrumbs::register('priority.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('Ticket Priority'), route('priority.index'));
});
Breadcrumbs::register('priority.create', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('Ticket Priority'), route('priority.index'));
$breadcrumbs->push(Lang::get('lang.create'), route('priority.create'));
});
Breadcrumbs::register('priority.edit', function ($breadcrumbs) {
$breadcrumbs->push(Lang::get('Ticket Priority'), route('priority.index'));
$breadcrumbs->push(Lang::get('Edit'), route('priority.index'));
});
Breadcrumbs::register('dept.inprogress.ticket', function ($breadcrumbs, $dept) {
$breadcrumbs->parent('dashboard');
$breadcrumbs->push(Lang::get('lang.department').'&nbsp; > &nbsp;'.$dept.'&nbsp; > &nbsp;'.Lang::get('lang.assigned_tickets'), url('/{dept}/inprogress'));
});
Breadcrumbs::register('labels.index', function ($breadcrumbs) {
$breadcrumbs->parent('setting');
$breadcrumbs->push(Lang::get('lang.label'), 'labels.index');
});
Breadcrumbs::register('labels.create', function ($breadcrumbs) {
$breadcrumbs->parent('labels.index');
$breadcrumbs->push(Lang::get('lang.create'), 'labels.create');
});
Breadcrumbs::register('labels.edit', function ($breadcrumbs) {
$breadcrumbs->parent('labels.index');
$breadcrumbs->push(Lang::get('lang.edit'), 'labels.edit');
});

View File

@@ -28,12 +28,13 @@ function mime($type)
$type == 'image/jpeg' ||
$type == 'image/jpg' ||
$type == 'image/gif' ||
$type == 'application/octet-stream' ||
// $type == "application/octet-stream" ||
$type == 'image/png' ||
starts_with($type, 'image')) {
return 'image';
}
}
function removeUnderscore($string)
{
if (str_contains($string, '_') === true) {
@@ -42,3 +43,106 @@ function removeUnderscore($string)
return ucfirst($string);
}
function isItil()
{
$check = false;
if (\Schema::hasTable('sd_releases') && \Schema::hasTable('sd_changes') && \Schema::hasTable('sd_problem')) {
$check = true;
}
return $check;
}
function isAsset()
{
$check = false;
if (\Schema::hasTable('sd_assets')) {
$check = true;
}
return $check;
}
function itilEnabled()
{
$check = false;
if (\Schema::hasTable('common_settings')) {
$settings = \DB::table('common_settings')->where('option_name', 'itil')->first();
if ($settings && $settings->status == 1) {
$check = true;
}
}
return $check;
}
function isBill()
{
$check = false;
if (\Schema::hasTable('common_settings')) {
$settings = \DB::table('common_settings')->where('option_name', 'bill')->first();
if ($settings && $settings->status == 1) {
$check = true;
}
}
return $check;
}
function deletePopUp($id, $url, $title = 'Delete', $class = 'btn btn-sm btn-danger', $btn_name = 'Delete', $button_check = true)
{
$button = '';
if ($button_check == true) {
$button = '<a href="#delete" class="'.$class.'" data-toggle="modal" data-target="#delete'.$id.'">'.$btn_name.'</a>';
}
return $button.'<div class="modal fade" id="delete'.$id.'">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">'.$title.'</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<p>Are you sure ?</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="close" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<a href="'.$url.'" class="btn btn-danger">Delete</a>
</div>
</div>
</div>
</div>';
}
function isInstall()
{
$check = false;
$env = base_path('.env');
if (\File::exists($env) && env('DB_INSTALL') == 1) {
$check = true;
}
return $check;
}
function faveotime($date, $hour = 0, $min = 0, $sec = 0)
{
if (is_bool($hour) && $hour == true) {
$hour = $date->hour;
}
if (is_bool($min) && $min == true) {
$min = $date->minute;
}
if (is_bool($sec) && $sec == true) {
$sec = $date->second;
}
$date1 = \Carbon\Carbon::create($date->year, $date->month, $date->day, $hour, $min, $sec);
return $date1->hour($hour)->minute($min)->second($sec);
}

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@ class Condition extends Model
public function checkActiveJob()
{
$result = ['fetching' => '', 'notification' => '', 'work' => '', 'message' => ''];
$result = ['fetching' => '', 'notification' => '', 'work' => '', 'message' => '', 'remind' => ''];
$emails = new \App\Model\helpdesk\Settings\Email();
$email = $emails->find(1);
if ($email) {
@@ -57,17 +57,6 @@ class Condition extends Model
$result['work'] = true;
}
}
if (\Schema::hasTable('sms_notify_setting')) {
$message = new \App\Plugins\SMS\Model\SmsNotify();
$message = $message->select('status')->where('name', '=', 'open_ticket_nofification')->first();
if ($message) {
if ($message->status) {
$result['message'] = true;
} else {
$result['message'] = false;
}
}
}
return $result;
}

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Model\helpdesk\Filters;
use Illuminate\Database\Eloquent\Model;
class Filter extends Model
{
protected $table = 'filters';
protected $fillable = ['ticket_id', 'key', 'value'];
public function getLabelTitle($ticketid)
{
$filter = $this->where('ticket_id', $ticketid)->where('key', 'label')->first();
$output = [];
if ($filter && $filter->value) {
$labelids = explode(',', $filter->value);
$labels = new Label();
$label = $labels->whereIn('title', $labelids)->get();
if ($label->count() > 0) {
foreach ($label as $key=>$l) {
$output[$key] = $l->titleWithColor();
}
}
}
return $output;
}
public function getTagsByTicketId($ticketid)
{
$filter = $this->where('key', 'tag')->where('ticket_id', $ticketid)->lists('value')->toArray();
return $filter;
}
}

View File

@@ -0,0 +1,68 @@
<?php
namespace App\Model\helpdesk\Filters;
use Illuminate\Database\Eloquent\Model;
use Lang;
class Label extends Model
{
protected $table = 'labels';
protected $fillable = ['title', 'color', 'order', 'status'];
public function titleWithColor()
{
$title = $this->title;
$color = $this->color;
if ($title && $color) {
return "<span class='label' style='background-color:".$color."; color: #FFF;'>".$title.'</span>';
} else {
return '--';
}
}
public function status()
{
$status = $this->status;
$output = Lang::get('lang.disabled');
if ($status == 1) {
$output = Lang::get('lang.enabled');
}
return $output;
}
public function isChecked($ticketid)
{
$title = $this->attributes['title'];
$output = '';
$filters = new Filter();
$filter = $filters
->where('ticket_id', $ticketid)
->where('key', 'label')
->where('value', $title)
->first();
if ($filter && $filter->value) {
$output = 'checked';
}
return $output;
}
public function assignedLabels($ticketid)
{
$output = '';
$filters = new Filter();
$filter = $filters->where('ticket_id', $ticketid)->where('key', 'label')->select('value')->get();
if (count($filter) > 0) {
foreach ($filter as $fil) {
$label = $this->where('title', $fil->value)->select('title', 'color')->first();
if ($label) {
$output .= '&nbsp;&nbsp;'.$label->titleWithColor().'&nbsp;&nbsp;';
}
}
}
return $output;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Model\helpdesk\Filters;
use Illuminate\Database\Eloquent\Model;
class Tag extends Model
{
protected $table = 'tags';
protected $fillable = ['name', 'description'];
}

View File

@@ -12,4 +12,12 @@ class Help_topic extends BaseModel
'sla_plan', 'thank_page', 'ticket_num_format', 'internal_notes', 'status', 'type', 'auto_assign',
'auto_response',
];
public function department()
{
$related = 'App\Model\helpdesk\Agent\Department';
$foreignKey = 'department';
return $this->belongsTo($related, $foreignKey);
}
}

View File

@@ -11,4 +11,55 @@ class Notification extends BaseModel
'model_id', 'userid_created', 'type_id',
];
public function type()
{
$related = 'App\Model\helpdesk\Notification\NotificationType';
$id = 'type_id';
return $this->belongsTo($related, $id);
}
public function model()
{
$related = 'App\Model\helpdesk\Ticket\Tickets';
$id = 'model_id';
return $this->belongsTo($related, $id);
}
public function userNotification()
{
$related = 'App\Model\helpdesk\Notification\UserNotification';
$foreignKey = 'notification_id';
return $this->hasMany($related, $foreignKey);
}
public function deleteUserNotification()
{
$user_notifications = $this->userNotification;
if (count($user_notifications) > 0) {
foreach ($user_notifications as $noti) {
$noti->delete();
}
}
}
public function dummyDelete()
{
$user_notifications = UserNotification::get();
if (count($user_notifications) > 0) {
foreach ($user_notifications as $noti) {
$noti->delete();
}
}
}
public function delete()
{
$this->deleteUserNotification();
// $this->dummyDelete();
parent::delete();
}
}

View File

@@ -11,4 +11,25 @@ class UserNotification extends BaseModel
'notification_id', 'user_id', 'is_read',
];
public function notification()
{
$related = 'App\Model\helpdesk\Notification\Notification';
$id = 'notification_id';
return $this->belongsTo($related, $id);
}
public function users()
{
$related = 'App\User';
$id = 'user_id';
return $this->belongsTo($related, $id);
}
// public function delete() {
// //$this->notification()->delete();
// parent::delete();
// }
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Model\helpdesk\Notification;
use App\BaseModel;
class Notification extends BaseModel
{
protected $table = 'notifications';
protected $fillable = [
'model_id', 'userid_created', 'type_id',
];
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Model\helpdesk\Notification;
use App\BaseModel;
class NotificationType extends BaseModel
{
protected $table = 'notification_types';
protected $fillable = [
'message', 'type', 'icon_class',
];
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Model\helpdesk\Notification;
use App\BaseModel;
class UserNotification extends BaseModel
{
protected $table = 'user_notification';
protected $fillable = [
'notification_id', 'user_id', 'is_read',
];
}

View File

@@ -10,4 +10,28 @@ class CommonSettings extends BaseModel
protected $fillable = [
'status', 'option_name', 'option_value', 'optional_field', 'created_at', 'updated_at',
];
public function getStatus($option_name)
{
$status = '';
$schema = $this->where('option_name', $option_name)->first();
if ($schema) {
$status = $schema->status;
}
return $status;
}
public function getOptionValue($option, $field = '')
{
$schema = $this->where('option_name', $option);
if ($field != '') {
$schema = $schema->where('optional_field', $field);
return $schema->first();
}
$value = $schema->get();
return $value;
}
}

View File

@@ -115,12 +115,16 @@ class Ticket_Thread extends Model
public function inlineAttachment($body)
{
if ($this->attach()->where('poster', 'INLINE')->get()->count() > 0) {
$search = $this->attach()->where('poster', 'INLINE')->lists('name')->toArray();
foreach ($this->attach()->where('poster', 'INLINE')->get() as $key => $attach) {
$replace[$key] = "data:$attach->type;base64,".$attach->file;
$attachments = $this->attach;
if ($attachments->count() > 0) {
foreach ($attachments as $key => $attach) {
if ($attach->poster == 'INLINE' || $attach->poster == 'inline') {
$search = $attach->name;
$replace = "data:$attach->type;base64,".$attach->file;
$b = str_replace($search, $replace, $body);
$body = $b;
}
}
$body = str_replace($search, $replace, $body);
}
return $body;
@@ -141,4 +145,12 @@ class Ticket_Thread extends Model
return wordwrap($subject, 70, "<br>\n");
}
public function user()
{
$related = 'App\User';
$foreignKey = 'user_id';
return $this->belongsTo($related, $foreignKey);
}
}

View File

@@ -0,0 +1,151 @@
<?php
namespace App\Model\helpdesk\Ticket;
//use App\BaseModel;
use File;
use Illuminate\Database\Eloquent\Model;
class Ticket_ThreadOld extends Model
{
protected $table = 'ticket_thread';
protected $fillable = [
'id', 'ticket_id', 'staff_id', 'user_id', 'thread_type', 'poster', 'source', 'is_internal', 'title', 'body', 'format', 'ip_address', 'created_at', 'updated_at',
];
public function attach()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_attachments', 'thread_id');
}
public function delete()
{
$this->attach()->delete();
parent::delete();
}
// public function setTitleAttribute($value) {
// $this->attributes['title'] = str_replace('"', "'", $value);
// }
public function getTitleAttribute($value)
{
return str_replace('"', "'", $value);
}
public function thread($content)
{
// $porufi = $this->purify($content);
// dd($content,$porufi);
//return $content;
return $this->purify($content);
}
public function purifyOld($value)
{
require_once base_path('vendor'.DIRECTORY_SEPARATOR.'htmlpurifier'.DIRECTORY_SEPARATOR.'library'.DIRECTORY_SEPARATOR.'HTMLPurifier.auto.php');
$path = base_path('vendor'.DIRECTORY_SEPARATOR.'htmlpurifier'.DIRECTORY_SEPARATOR.'library'.DIRECTORY_SEPARATOR.'HTMLPurifier'.DIRECTORY_SEPARATOR.'DefinitionCache'.DIRECTORY_SEPARATOR.'Serializer');
if (!File::exists($path)) {
File::makeDirectory($path, $mode = 0777, true, true);
}
$config = \HTMLPurifier_Config::createDefault();
$config->set('HTML.Trusted', true);
$config->set('Filter.YouTube', true);
$purifier = new \HTMLPurifier($config);
if ($value != strip_tags($value)) {
$value = $purifier->purify($value);
}
return $value;
}
public function purify()
{
$value = $this->attributes['body'];
$str = str_replace("'", '"', $value);
$html = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $str);
$string = trim(preg_replace('/\s+/', ' ', $html));
$content = $this->inlineAttachment($string);
return $content;
}
public function setTitleAttribute($value)
{
if ($value == '') {
$this->attributes['title'] = 'No available';
} else {
$this->attributes['title'] = $value;
}
}
public function removeScript($html)
{
$doc = new \DOMDocument();
// load the HTML string we want to strip
$doc->loadHTML($html);
// get all the script tags
$script_tags = $doc->getElementsByTagName('script');
$length = $script_tags->length;
// for each tag, remove it from the DOM
for ($i = 0; $i < $length; $i++) {
$script_tags->item($i)->parentNode->removeChild($script_tags->item($i));
}
// get the HTML string back
$no_script_html_string = $doc->saveHTML();
return $no_script_html_string;
}
public function firstContent()
{
$poster = $this->attributes['poster'];
if ($poster == 'client') {
return 'yes';
}
return 'no';
}
public function inlineAttachment($body)
{
if ($this->attach()->where('poster', 'INLINE')->get()->count() > 0) {
$search = $this->attach()->where('poster', 'INLINE')->lists('name')->toArray();
foreach ($this->attach()->where('poster', 'INLINE')->get() as $key => $attach) {
$replace[$key] = "data:$attach->type;base64,".$attach->file;
}
$body = str_replace($search, $replace, $body);
}
return $body;
}
public function getSubject()
{
$subject = $this->attributes['title'];
$array = imap_mime_header_decode($subject);
$title = '';
if (is_array($array) && count($array) > 0) {
foreach ($array as $text) {
$title .= $text->text;
}
return wordwrap($title, 70, "<br>\n");
}
return wordwrap($subject, 70, "<br>\n");
}
public function labels($ticketid)
{
$label = new \App\Model\helpdesk\Filters\Label();
return $label->assignedLabels($ticketid);
}
}

View File

@@ -8,19 +8,31 @@ class Ticket_attachments extends Model
{
protected $table = 'ticket_attachment';
protected $fillable = [
'id', 'thread_id', 'name', 'size', 'type', 'file', 'data', 'poster', 'updated_at', 'created_at',
];
'id', 'thread_id', 'name', 'size', 'type', 'file', 'data', 'poster', 'updated_at', 'created_at',
];
public function setFileAttribute($value)
{
$this->attributes['file'] = base64_encode($value);
if ($value) {
$this->attributes['file'] = base64_encode($value);
} else {
$this->attributes['file'] = $value;
}
}
public function getFileAttribute($value)
{
if (base64_decode($value, true) === false) {
$drive = $this->driver;
$name = $this->name;
$root = $this->path;
if (($drive == 'database' || !$drive) && $value && base64_decode($value, true) === false) {
$value = base64_encode($value);
}
if ($drive && $drive !== 'database') {
$storage = new \App\FaveoStorage\Controllers\StorageController();
$content = $storage->getFile($drive, $name);
$value = base64_encode($content);
}
return $value;
}
@@ -28,19 +40,22 @@ class Ticket_attachments extends Model
public function getFile()
{
$size = $this->size;
$drive = $this->driver;
$name = $this->name;
$root = $this->path;
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$power = $size > 0 ? floor(log($size, 1024)) : 0;
$value = number_format($size / pow(1024, $power), 2, '.', ',').' '.$units[$power];
if ($this->poster == 'ATTACHMENT') {
if (mime($this->type) == true) {
if (mime($this->type) == 'image') {
$var = '<a href="'.\URL::route('image', ['image_id' => $this->id]).'" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,'.$this->file.'"/></a>';
return '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">'.$var.'</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">'.$this->name.'</b><br/><p>'.$value.'</p></div></li>';
return '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">'.$var.'</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">'.$this->name.'</b><br/><p>'.$value.'</p></div></li>';
} else {
//$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:'.$attachment->type.';base64,' . base64_encode($data) . '"/></a>';
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.\URL::route('image', ['image_id' => $this->id]).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff; font-size:18px;">'.strtoupper($this->type).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$this->name.'</b><br/><p>'.$value.'</p></span></div></a>';
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.\URL::route('image', ['image_id' => $this->id]).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff; font-size:18px;">'.strtoupper(str_limit($this->type, 15)).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$this->name.'</b><br/><p>'.$value.'</p></span></div></a>';
return '<li style="background-color:#f4f4f4;">'.$var.'</li>';
return '<li style="background-color:#f4f4f4;">'.$var.'</li>';
}
}
}

View File

@@ -7,7 +7,7 @@ use App\BaseModel;
class Tickets extends BaseModel
{
protected $table = 'tickets';
protected $fillable = ['id', 'ticket_number', 'num_sequence', 'user_id', 'priority_id', 'sla', 'help_topic_id', 'max_open_ticket', 'captcha', 'status', 'lock_by', 'lock_at', 'source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'is_transfer', 'transfer_at', 'reopened_at', 'duedate', 'closed_at', 'last_message_at', 'last_response_at', 'created_at', 'updated_at'];
protected $fillable = ['id', 'ticket_number', 'num_sequence', 'user_id', 'priority_id', 'sla', 'help_topic_id', 'max_open_ticket', 'captcha', 'status', 'lock_by', 'lock_at', 'source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'is_transfer', 'transfer_at', 'reopened_at', 'duedate', 'closed_at', 'last_message_at', 'last_response_at', 'created_at', 'updated_at', 'assigned_to'];
// public function attach(){
// return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_attachments',);
@@ -23,6 +23,14 @@ class Tickets extends BaseModel
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Collaborator', 'ticket_id');
}
public function helptopic()
{
$related = 'App\Model\helpdesk\Manage\Help_topic';
$foreignKey = 'help_topic_id';
return $this->belongsTo($related, $foreignKey);
}
public function formdata()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Form_Data', 'ticket_id');
@@ -63,4 +71,33 @@ class Tickets extends BaseModel
$this->formdata()->delete();
parent::delete();
}
public function setAssignedToAttribute($value)
{
if (!$value) {
$this->attributes['assigned_to'] = null;
} else {
$this->attributes['assigned_to'] = $value;
}
}
public function getAssignedTo()
{
$agentid = $this->attributes['assigned_to'];
if ($agentid) {
$users = new \App\User();
$user = $users->where('id', $agentid)->first();
if ($user) {
return $user;
}
}
}
public function user()
{
$related = "App\User";
$foreignKey = 'user_id';
return $this->belongsTo($related, $foreignKey);
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ComposerServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
view()->composer(
[
'themes.default1.agent.layout.agent',
'themes.default1.agent.helpdesk.dashboard.dashboard',
], 'App\Http\ViewComposers\AgentLayout'
);
view()->composer(
[
'themes.default1.update.notification',
], 'App\Http\ViewComposers\UpdateNotification'
);
view()->composer(
[
'themes.default1.agent.layout.agent',
'themes.default1.admin.layout.admin',
], 'App\Http\ViewComposers\AuthUser'
);
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -28,7 +28,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $fillable = ['user_name', 'email', 'password', 'active', 'first_name', 'last_name', 'ban', 'ext', 'mobile', 'profile_pic',
'phone_number', 'company', 'agent_sign', 'account_type', 'account_status',
'assign_group', 'primary_dpt', 'agent_tzone', 'daylight_save', 'limit_access',
'directory_listing', 'vacation_mode', 'role', 'internal_note', 'country_code', ];
'directory_listing', 'vacation_mode', 'role', 'internal_note', 'country_code', 'not_accept_ticket', 'is_delete', ];
/**
* The attributes excluded from the model's JSON form.
@@ -39,22 +39,29 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
public function getProfilePicAttribute($value)
{
$info = $this->getExtraInfo();
$info = $this->avatar();
$pic = null;
if (count($info) > 0) {
if ($info) {
$pic = $this->checkArray('avatar', $info);
}
if (!$pic) {
$pic = asset('uploads/profilepic/'.$value);
}
if ($this->endsWith($pic, 'profilepic')) {
if (!$value) {
$pic = \Gravatar::src($this->attributes['email']);
}
return $pic;
}
public function avatar()
{
$related = 'App\UserAdditionalInfo';
$foreignKey = 'owner';
return $this->hasMany($related, $foreignKey)->select('value')->where('key', 'avatar')->first();
}
public function getOrganizationRelation()
{
$related = "App\Model\helpdesk\Agent_panel\User_org";
@@ -141,36 +148,34 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $html;
}
/**
*@category accessor function to return full name
*
*@param null
*
*@return $string
*/
public function name()
{
$first_name = $this->first_name;
$last_name = $this->last_name;
$name = $this->user_name;
if ($first_name !== '' && $first_name !== null) {
if ($last_name !== '' && $last_name !== null) {
$name = $first_name.' '.$last_name;
} else {
$name = $first_name;
}
}
return $name;
}
public function getFullNameAttribute()
{
if ($this->first_name) {
return ucfirst($this->first_name).' '.ucfirst($this->last_name);
}
return $this->user_name;
return $this->name();
}
/**
* @category function to check profile pic source srting ends with profilepic or not
*
* @param string $haystack, $needle
*
* @return bool true/false
*/
public function endsWith($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
return true;
}
// public function save() {
// dd($this->id);
// parent::save();
// }
return substr($haystack, -$length) === $needle;
}
// public function save(array $options = array()) {
// parent::save($options);
// dd($this->where('id',$this->id)->select('first_name','last_name','user_name','email')->get()->toJson());
// }
}

View File

@@ -15,17 +15,13 @@
"bugsnag/bugsnag-laravel": "1.*",
"filp/whoops": "~1.0",
"thomaswelton/laravel-gravatar": "~1.0",
"php-imap/php-imap": "~2.0",
"neitanod/forceutf8": "dev-master",
"nicolaslopezj/searchable": "1.*",
"chumper/datatable": "dev-develop",
"chumper/zipper": "0.6.x",
"phpmailer/phpmailer": "^5.2",
"unisharp/laravel-filemanager": "^1.1",
"tymon/jwt-auth": "0.5.*",
"php": ">=5.5.9",
"davejamesmiller/laravel-breadcrumbs": "^3.0",
"torann/geoip": "1.0.*",
"davibennun/laravel-push-notification": "dev-laravel5",
"brozot/laravel-fcm": "^1.0",
"barryvdh/laravel-debugbar": "^2.2",
@@ -35,8 +31,11 @@
"maatwebsite/excel": "~2.1.0",
"laravelcollective/bus": "^5.2",
"laravel/socialite": "^2.0",
"tedivm/fetch": "0.6.*",
"unisharp/laravel-filemanager": "^1.6",
"unisharp/laravel-ckeditor": "^4.5",
"tedivm/fetch": "0.6.*"
"torann/geoip": "^1.0",
"yajra/laravel-datatables-oracle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",

393
composer.lock generated
View File

@@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f0d25300aea06d3f8f01b956096ac641",
"content-hash": "0501535d018ba0aa2cd290c8be4bcb93",
"hash": "54d9928ad997149e5b4bb04b565d4fec",
"content-hash": "056f3d8f0edac014bba44beacb93bd3f",
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.19.23",
"version": "3.19.16",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "fbfb87734e5d298b40354ac7fb3f95d0f72ad16e"
"reference": "5161b8956e0c0f8e4260edbfe36c1a78392e4934"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fbfb87734e5d298b40354ac7fb3f95d0f72ad16e",
"reference": "fbfb87734e5d298b40354ac7fb3f95d0f72ad16e",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5161b8956e0c0f8e4260edbfe36c1a78392e4934",
"reference": "5161b8956e0c0f8e4260edbfe36c1a78392e4934",
"shasum": ""
},
"require": {
@@ -85,7 +85,7 @@
"s3",
"sdk"
],
"time": "2016-11-03 20:28:28"
"time": "2016-10-17 20:08:45"
},
{
"name": "barryvdh/laravel-debugbar",
@@ -776,16 +776,16 @@
},
{
"name": "giggsey/libphonenumber-for-php",
"version": "7.7.3",
"version": "7.7.2",
"source": {
"type": "git",
"url": "https://github.com/giggsey/libphonenumber-for-php.git",
"reference": "e55e956a7a8211af3dfbd9dd5372ccc5eb79e495"
"reference": "245324b87d59fe122945f5cf4521c75af2bd472a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/e55e956a7a8211af3dfbd9dd5372ccc5eb79e495",
"reference": "e55e956a7a8211af3dfbd9dd5372ccc5eb79e495",
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/245324b87d59fe122945f5cf4521c75af2bd472a",
"reference": "245324b87d59fe122945f5cf4521c75af2bd472a",
"shasum": ""
},
"require": {
@@ -834,20 +834,20 @@
"phonenumber",
"validation"
],
"time": "2016-10-26 13:35:16"
"time": "2016-10-06 13:02:39"
},
{
"name": "giggsey/locale",
"version": "1.1.1",
"version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/giggsey/Locale.git",
"reference": "8238764fa3f2c5bd8bdf981e2e019401d49229e3"
"reference": "d936229da2187025f693f25724c5af2a090f5e7c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/giggsey/Locale/zipball/8238764fa3f2c5bd8bdf981e2e019401d49229e3",
"reference": "8238764fa3f2c5bd8bdf981e2e019401d49229e3",
"url": "https://api.github.com/repos/giggsey/Locale/zipball/d936229da2187025f693f25724c5af2a090f5e7c",
"reference": "d936229da2187025f693f25724c5af2a090f5e7c",
"shasum": ""
},
"require": {
@@ -883,7 +883,7 @@
}
],
"description": "Locale functions required by libphonenumber-for-php",
"time": "2016-10-24 20:49:55"
"time": "2016-10-05 20:26:22"
},
{
"name": "guzzle/guzzle",
@@ -1568,16 +1568,16 @@
},
{
"name": "laravel/socialite",
"version": "v2.0.20",
"version": "v2.0.18",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
"reference": "aca8de9a93a28a119714e289c8bc599bd81aa88d"
"reference": "76ee5397fcdea5a062361392abca4eb397e519a3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/socialite/zipball/aca8de9a93a28a119714e289c8bc599bd81aa88d",
"reference": "aca8de9a93a28a119714e289c8bc599bd81aa88d",
"url": "https://api.github.com/repos/laravel/socialite/zipball/76ee5397fcdea5a062361392abca4eb397e519a3",
"reference": "76ee5397fcdea5a062361392abca4eb397e519a3",
"shasum": ""
},
"require": {
@@ -1618,7 +1618,7 @@
"laravel",
"oauth"
],
"time": "2016-11-01 18:49:10"
"time": "2016-06-22 12:40:16"
},
{
"name": "laravelcollective/bus",
@@ -1666,22 +1666,76 @@
"time": "2015-12-23 07:43:33"
},
{
"name": "league/flysystem",
"version": "1.0.32",
"name": "laravelcollective/html",
"version": "v5.2.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "1b5c4a0031697f46e779a9d1b309c2e1b24daeab"
"url": "https://github.com/LaravelCollective/html.git",
"reference": "3a312d39ffe37da0f57b602618b61fd07c1fcec5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1b5c4a0031697f46e779a9d1b309c2e1b24daeab",
"reference": "1b5c4a0031697f46e779a9d1b309c2e1b24daeab",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/3a312d39ffe37da0f57b602618b61fd07c1fcec5",
"reference": "3a312d39ffe37da0f57b602618b61fd07c1fcec5",
"shasum": ""
},
"require": {
"illuminate/http": "5.2.*",
"illuminate/routing": "5.2.*",
"illuminate/session": "5.2.*",
"illuminate/support": "5.2.*",
"illuminate/view": "5.2.*",
"php": ">=5.5.9"
},
"require-dev": {
"illuminate/database": "5.2.*",
"mockery/mockery": "~0.9",
"phpunit/phpunit": "~4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Collective\\Html\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
},
{
"name": "Adam Engebretson",
"email": "adam@laravelcollective.com"
}
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "http://laravelcollective.com",
"time": "2016-01-27 22:29:54"
},
{
"name": "league/flysystem",
"version": "1.0.28",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "a9663643ff2d16d7f66ed1e0d3212c5491bc9044"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a9663643ff2d16d7f66ed1e0d3212c5491bc9044",
"reference": "a9663643ff2d16d7f66ed1e0d3212c5491bc9044",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
},
@@ -1746,7 +1800,70 @@
"sftp",
"storage"
],
"time": "2016-10-19 20:38:46"
"time": "2016-10-07 12:20:37"
},
{
"name": "league/fractal",
"version": "0.14.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/fractal.git",
"reference": "56ad8933fbb40328ca3321c84143b2c16186eebf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/fractal/zipball/56ad8933fbb40328ca3321c84143b2c16186eebf",
"reference": "56ad8933fbb40328ca3321c84143b2c16186eebf",
"shasum": ""
},
"require": {
"php": ">=5.4"
},
"require-dev": {
"illuminate/contracts": "~5.0",
"mockery/mockery": "~0.9",
"pagerfanta/pagerfanta": "~1.0.0",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~1.5",
"zendframework/zend-paginator": "~2.3"
},
"suggest": {
"illuminate/pagination": "The Illuminate Pagination component.",
"pagerfanta/pagerfanta": "Pagerfanta Paginator",
"zendframework/zend-paginator": "Zend Framework Paginator"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.13-dev"
}
},
"autoload": {
"psr-4": {
"League\\Fractal\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Phil Sturgeon",
"email": "me@philsturgeon.uk",
"homepage": "http://philsturgeon.uk/",
"role": "Developer"
}
],
"description": "Handle the output of complex data structures ready for API output.",
"homepage": "http://fractal.thephpleague.com/",
"keywords": [
"api",
"json",
"league",
"rest"
],
"time": "2016-07-21 09:56:14"
},
{
"name": "league/oauth1-client",
@@ -2469,110 +2586,6 @@
"homepage": "https://github.com/PhenX/php-font-lib",
"time": "2014-02-01 15:22:28"
},
{
"name": "php-imap/php-imap",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/barbushin/php-imap.git",
"reference": "949826c9b109113ec93a5214e85afce31cba000c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barbushin/php-imap/zipball/949826c9b109113ec93a5214e85afce31cba000c",
"reference": "949826c9b109113ec93a5214e85afce31cba000c",
"shasum": ""
},
"require": {
"ext-imap": "*",
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpImap\\": "src/PhpImap/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD 3-Clause"
],
"authors": [
{
"name": "Sergey Barbushin",
"email": "barbushin@gmail.com",
"homepage": "http://linkedin.com/in/barbushin"
}
],
"description": "PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension",
"homepage": "https://github.com/barbushin/php-imap",
"keywords": [
"imap",
"mail",
"php"
],
"time": "2016-08-13 15:39:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v5.2.16",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a",
"reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a",
"shasum": ""
},
"require": {
"php": ">=5.0.0"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "*",
"phpunit/phpunit": "4.7.*"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"type": "library",
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2016-06-06 09:09:37"
},
{
"name": "phpoffice/phpexcel",
"version": "1.8.1",
@@ -3183,7 +3196,7 @@
},
{
"name": "symfony/css-selector",
"version": "v3.1.6",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@@ -3293,16 +3306,16 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v3.1.6",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc"
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/28b0832b2553ffb80cabef6a7a812ff1e670c0bc",
"reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
"shasum": ""
},
"require": {
@@ -3349,7 +3362,7 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2016-10-13 06:28:43"
"time": "2016-07-19 10:45:57"
},
{
"name": "symfony/finder",
@@ -3537,7 +3550,7 @@
},
{
"name": "symfony/options-resolver",
"version": "v3.1.6",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
@@ -4546,6 +4559,66 @@
],
"time": "2015-03-20 13:30:34"
},
{
"name": "yajra/laravel-datatables-oracle",
"version": "v6.17.0",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "66186a1275156b922e5968a4d65bbc5966bbee5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/66186a1275156b922e5968a4d65bbc5966bbee5d",
"reference": "66186a1275156b922e5968a4d65bbc5966bbee5d",
"shasum": ""
},
"require": {
"dompdf/dompdf": "^0.6.1",
"illuminate/database": "~5.0",
"illuminate/filesystem": "~5.0",
"illuminate/http": "~5.0",
"illuminate/support": "~5.0",
"illuminate/view": "~5.0",
"laravelcollective/html": "~5.0",
"league/fractal": "~0.12",
"maatwebsite/excel": "^2.0",
"php": ">=5.5.9"
},
"require-dev": {
"mockery/mockery": "~0.9",
"phpunit/phpunit": "~4.0"
},
"suggest": {
"barryvdh/laravel-snappy": "Allows exporting of dataTable to PDF using the print view."
},
"type": "library",
"autoload": {
"psr-4": {
"Yajra\\Datatables\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Arjay Angeles",
"email": "aqangeles@gmail.com"
}
],
"description": "jQuery DataTables API for Laravel 4|5",
"keywords": [
"datatable",
"datatables",
"datatables jquery plugin",
"laravel",
"laravel4",
"laravel5"
],
"time": "2016-08-10 00:31:22"
},
{
"name": "zendframework/zend-escaper",
"version": "2.5.2",
@@ -4741,31 +4814,31 @@
},
{
"name": "zendframework/zend-stdlib",
"version": "3.1.0",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-stdlib.git",
"reference": "debedcfc373a293f9250cc9aa03cf121428c8e78"
"reference": "8bafa58574204bdff03c275d1d618aaa601588ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78",
"reference": "debedcfc373a293f9250cc9aa03cf121428c8e78",
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae",
"reference": "8bafa58574204bdff03c275d1d618aaa601588ae",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
"php": "^5.5 || ^7.0"
},
"require-dev": {
"athletic/athletic": "~0.1",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "^2.6.2"
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev",
"dev-develop": "3.2-dev"
"dev-master": "3.0-dev",
"dev-develop": "3.1-dev"
}
},
"autoload": {
@@ -4782,7 +4855,7 @@
"stdlib",
"zf2"
],
"time": "2016-09-13 14:38:50"
"time": "2016-04-12 21:19:36"
},
{
"name": "zendframework/zend-uri",
@@ -6110,16 +6183,16 @@
},
{
"name": "symfony/dom-crawler",
"version": "v3.1.6",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "59eee3c76eb89f21857798620ebdad7a05ad14f4"
"reference": "bb7395e8b1db3654de82b9f35d019958276de4d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/59eee3c76eb89f21857798620ebdad7a05ad14f4",
"reference": "59eee3c76eb89f21857798620ebdad7a05ad14f4",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/bb7395e8b1db3654de82b9f35d019958276de4d7",
"reference": "bb7395e8b1db3654de82b9f35d019958276de4d7",
"shasum": ""
},
"require": {
@@ -6162,20 +6235,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2016-10-18 15:46:07"
"time": "2016-08-05 08:37:39"
},
{
"name": "symfony/yaml",
"version": "v3.1.6",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27"
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27",
"reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27",
"url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3",
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3",
"shasum": ""
},
"require": {
@@ -6211,7 +6284,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-10-24 18:41:13"
"time": "2016-09-25 08:27:07"
},
{
"name": "webmozart/assert",

View File

@@ -33,7 +33,7 @@ return [
| This tells about aplication current version.
|
*/
'version' => 'Community 1.0.8.0 RC',
'version' => 'Community 1.9.0',
/*
|--------------------------------------------------------------------------
| Application Name
@@ -167,6 +167,7 @@ return [
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\ComposerServiceProvider',
'Propaganistas\LaravelPhone\LaravelPhoneServiceProvider',
'Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider',
'Vsmoraes\Pdf\PdfServiceProvider',
@@ -174,7 +175,7 @@ return [
'Chumper\Datatable\DatatableServiceProvider',
'Chumper\Zipper\ZipperServiceProvider',
'Tymon\JWTAuth\Providers\JWTAuthServiceProvider',
'Torann\GeoIP\GeoIPServiceProvider',
\Torann\GeoIP\GeoIPServiceProvider::class,
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Unisharp\Ckeditor\ServiceProvider::class,
@@ -184,6 +185,8 @@ return [
Maatwebsite\Excel\ExcelServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
App\FaveoLog\LaravelLogViewerServiceProvider::class,
App\FaveoStorage\StorageServiceProvider::class,
Yajra\Datatables\DatatablesServiceProvider::class,
],
/*
@@ -251,6 +254,7 @@ return [
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
'UnAuth' => 'App\Http\Controllers\Client\helpdesk\UnAuthController',
'Finder' => App\Helper\Finder::class,
'Datatables' => Yajra\Datatables\Facades\Datatables::class,
],

View File

@@ -30,7 +30,7 @@ return [
| Supported: string
|
*/
'id' => '',
'id' => 'chumper',
/*
|--------------------------------------------------------------------------
| DataTable options

86
config/datatables.php Normal file
View File

@@ -0,0 +1,86 @@
<?php
return [
/*
* DataTables search options.
*/
'search' => [
/*
* Smart search will enclose search keyword with wildcard string "%keyword%".
* SQL: column LIKE "%keyword%"
*/
'smart' => true,
/*
* Case insensitive will search the keyword in lower case format.
* SQL: LOWER(column) LIKE LOWER(keyword)
*/
'case_insensitive' => true,
/*
* Wild card will add "%" in between every characters of the keyword.
* SQL: column LIKE "%k%e%y%w%o%r%d%"
*/
'use_wildcards' => false,
],
/*
* DataTables fractal configurations.
*/
'fractal' => [
/*
* Request key name to parse includes on fractal.
*/
'includes' => 'include',
/*
* Default fractal serializer.
*/
'serializer' => 'League\Fractal\Serializer\DataArraySerializer',
],
/*
* DataTables script view template.
*/
'script_template' => 'datatables::script',
/*
* DataTables internal index id response column name.
*/
'index_column' => 'DT_Row_Index',
/*
* Namespaces used by the generator.
*/
'namespace' => [
/*
* Base namespace/directory to create the new file.
* This is appended on default Laravel namespace.
*
* Usage: php artisan datatables:make User
* Output: App\DataTables\UserDataTable
* With Model: App\User (default model)
* Export filename: users_timestamp
*/
'base' => 'DataTables',
/*
* Base namespace/directory where your model's are located.
* This is appended on default Laravel namespace.
*
* Usage: php artisan datatables:make Post --model
* Output: App\DataTables\PostDataTable
* With Model: App\Post
* Export filename: posts_timestamp
*/
'model' => '',
],
/*
* PDF generator to be used when converting the table to pdf.
* Available generators: excel, snappy
* Snappy package: barryvdh/laravel-snappy
* Excel package: maatwebsite/excel
*/
'pdf_generator' => 'excel',
];

View File

@@ -41,7 +41,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path().'/app',
'root' => storage_path().'/app/attachments',
],
's3' => [
'driver' => 's3',

View File

@@ -16,7 +16,7 @@ return [
|
*/
'default' => 'null',
'default' => 'sync',
/*
|--------------------------------------------------------------------------
| Queue Connections

View File

@@ -22,6 +22,7 @@ class CreateUsersTable extends Migration
$table->boolean('ban');
$table->string('password', 60);
$table->integer('active');
$table->boolean('is_delete')->default(0);
$table->string('ext');
$table->integer('country_code');
$table->string('phone_number');

View File

@@ -18,12 +18,16 @@ class Version1079table extends Migration
if ($settings_system != null) {
DB::table('settings_system')->insert(['version' => $current_version]);
DB::table('common_settings')
->insert(
['option_name' => 'enable_rtl', 'option_value' => ''],
['option_name' => 'user_set_ticket_status', 'status' => 1],
['option_name' => 'send_otp', 'status' => 0],
['option_name' => 'email_mandatory', 'status' => 1]
);
->insert(
['option_name' => 'enable_rtl', 'option_value' => ''], ['option_name' => 'user_set_ticket_status', 'status' => 1], ['option_name' => 'send_otp', 'status' => 0], ['option_name' => 'email_mandatory', 'status' => 1]
);
}
if (Schema::hasTable('common_settings')) {
$settings = DB::table('common_settings')->where('option_name', 'itil')->first();
if (!$settings) {
DB::table('common_settings')->insert(['option_name'=>'itil', 'status'=>'0']);
}
}
}
}

View File

@@ -21,11 +21,11 @@ class CreateMailServicesTable extends Migration
});
$mail = new MailService();
$services = ['smtp' => 'SMTP', 'mail' => 'Php Mail', 'sendmail' => 'Send Mail', 'mailgun' => 'Mailgun', 'mandrill' => 'Mandrill', 'log' => 'Log file'];
foreach ($services as $key => $value) {
$services = ['smtp'=>'SMTP', 'mail'=>'Php Mail', 'sendmail'=>'Send Mail', 'mailgun'=>'Mailgun', 'mandrill'=>'Mandrill', 'log'=>'Log file'];
foreach ($services as $key=>$value) {
$mail->create([
'name' => $value,
'short_name' => $key,
'name' => $value,
'short_name'=> $key,
]);
}
}

View File

@@ -22,12 +22,12 @@ class CreateQueueServicesTable extends Migration
});
$queue = new QueueService();
$services = ['sync' => 'Sync', 'database' => 'Database', 'beanstalkd' => 'Beanstalkd', 'sqs' => 'SQS', 'iron' => 'Iron', 'redis' => 'Redis'];
foreach ($services as $key => $value) {
$services = ['sync'=>'Sync', 'database'=>'Database', 'beanstalkd'=>'Beanstalkd', 'sqs'=>'SQS', 'iron'=>'Iron', 'redis'=>'Redis'];
foreach ($services as $key=>$value) {
$queue->create([
'name' => $value,
'short_name' => $key,
'status' => 0,
'name' => $value,
'short_name'=> $key,
'status' => 0,
]);
}
$q = $queue->where('short_name', 'sync')->first();

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,42 @@
<?php
use App\Model\MailJob\MailService;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateMailServicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mail_services', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('short_name');
$table->timestamps();
});
$mail = new MailService();
$services = ['smtp'=>'SMTP', 'mail'=>'Php Mail', 'sendmail'=>'Send Mail', 'mailgun'=>'Mailgun', 'mandrill'=>'Mandrill', 'log'=>'Log file'];
foreach ($services as $key=>$value) {
$mail->create([
'name' => $value,
'short_name'=> $key,
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('mail_services');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use App\Model\MailJob\QueueService;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateQueueServicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('queue_services', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('short_name');
$table->integer('status');
$table->timestamps();
});
$queue = new QueueService();
$services = ['database'=>'Local Database', 'beanstalkd'=>'Beanstalkd', 'sqs'=>'SQS', 'iron'=>'Iron', 'redis'=>'Redis'];
$status = 0;
foreach ($services as $key=>$value) {
if ($key === 'database') {
$status = 1;
}
$queue->create([
'name' => $value,
'short_name'=> $key,
'status' => $status,
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('queue_services');
}
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterTicketSourceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasColumn('ticket_source', 'css_class')) {
Schema::table('ticket_source', function (Blueprint $table) {
$table->string('css_class');
});
}
DB::table('ticket_source')->delete();
$values = $this->values();
foreach ($values as $value) {
DB::table('ticket_source')->insert($value);
}
}
public function values()
{
return[
['name' => 'web', 'value' => 'Web', 'css_class' => 'fa fa-internet-explorer'],
['name' => 'email', 'value' => 'E-mail', 'css_class' => 'fa fa-envelope'],
['name' => 'agent', 'value' => 'Agent Panel', 'css_class' => 'fa fa-envelope'],
['name' => 'facebook', 'value' => 'Facebook', 'css_class' => 'fa fa-facebook'],
['name' => 'twitter', 'value' => 'Twitter', 'css_class' => 'fa fa-twitter'],
];
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_source', function (Blueprint $table) {
//
});
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterTicketSourceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasColumn('ticket_source', 'css_class')) {
Schema::table('ticket_source', function (Blueprint $table) {
$table->string('css_class');
});
}
DB::table('ticket_source')->delete();
$values = $this->values();
foreach ($values as $value) {
DB::table('ticket_source')->insert($value);
}
}
public function values()
{
return[
['name' => 'web', 'value' => 'Web', 'css_class' => 'fa fa-internet-explorer'],
['name' => 'email', 'value' => 'E-mail', 'css_class' => 'fa fa-envelope'],
['name' => 'agent', 'value' => 'Agent Panel', 'css_class' => 'fa fa-envelope'],
['name' => 'facebook', 'value' => 'Facebook', 'css_class' => 'fa fa-facebook'],
['name' => 'twitter', 'value' => 'Twitter', 'css_class' => 'fa fa-twitter'],
];
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ticket_source', function (Blueprint $table) {
//
});
}
}

View File

@@ -11,11 +11,9 @@ use App\Model\helpdesk\Manage\Sla_plan;
use App\Model\helpdesk\Notification\NotificationType;
use App\Model\helpdesk\Ratings\Rating;
use App\Model\helpdesk\Settings\Alert;
use App\Model\helpdesk\Settings\Approval;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Settings\Followup;
use App\Model\helpdesk\Settings\Responder;
use App\Model\helpdesk\Settings\Security;
use App\Model\helpdesk\Settings\System;
@@ -215,16 +213,10 @@ class DatabaseSeeder extends Seeder
Ticket_status::create(['name' => 'Request Approval', 'state' => 'unverified', 'mode' => '3', 'message' => 'Approval requested by', 'flags' => '0', 'sort' => '7', 'properties' => 'Ticket will be approve after Admin verifies this ticket']);
/* Ticket priority */
Ticket_priority::create(['priority' => 'Low', 'status' => 1, 'priority_desc' => 'Low', 'priority_color' => '#00a65a', 'priority_urgency' => '4', 'ispublic' => 1, 'is_default' => 0]);
Ticket_priority::create(['priority' => 'Normal', 'status' => 1, 'priority_desc' => 'Normal', 'priority_color' => '#00bfef', 'priority_urgency' => '3', 'ispublic' => 1, 'is_default' => 1]);
Ticket_priority::create(['priority' => 'High', 'status' => 1, 'priority_desc' => 'High', 'priority_color' => '#f39c11', 'priority_urgency' => '2', 'ispublic' => 1, 'is_default' => 0]);
Ticket_priority::create(['priority' => 'Emergency', 'status' => 1, 'priority_desc' => 'Emergency', 'priority_color' => '#dd4b38', 'priority_urgency' => '1', 'ispublic' => 1, 'is_default' => 0]);
/* Approval */
Approval::create(['name' => 'approval', 'status' => '0']);
/*Followup*/
Followup::create(['name' => 'followup']);
Ticket_priority::create(['priority' => 'Low', 'status' => 1, 'priority_desc' => 'Low', 'priority_color' => '#00a65a', 'priority_urgency' => '4', 'ispublic' => '1']);
Ticket_priority::create(['priority' => 'Normal', 'status' => 1, 'priority_desc' => 'Normal', 'priority_color' => '#00bfef', 'priority_urgency' => '3', 'ispublic' => '1', 'is_default' => '1']);
Ticket_priority::create(['priority' => 'High', 'status' => 1, 'priority_desc' => 'High', 'priority_color' => '#f39c11', 'priority_urgency' => '2', 'ispublic' => '1']);
Ticket_priority::create(['priority' => 'Emergency', 'status' => 1, 'priority_desc' => 'Emergency', 'priority_color' => '#dd4b38', 'priority_urgency' => '1', 'ispublic' => '1']);
/* SLA Plans */
Sla_plan::create(['name' => 'Sla 1', 'grace_period' => '6 Hours', 'status' => '1']);

View File

@@ -3,7 +3,7 @@
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>pro-fork</name>
<name>Faveo-Helpdesk-Pro-bhanu-fork</name>
</data>
</configuration>
</project>

37
public/css/close-button.css vendored Normal file
View File

@@ -0,0 +1,37 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : 14 Oct, 2016, 9:55:14 AM
Author : vijaysebastian
*/
/* Common */
/* Close Button */
[class*='close-'] {
color: #777;
font: 14px/100% arial, sans-serif;
position: absolute;
right: 5px;
text-decoration: none;
text-shadow: 0 1px 0 #fff;
top: 5px;
}
.close-classic:after {
content: 'X'; /* ANSI X letter */
}
.close-thin:after {
content: '×'; /* UTF-8 symbol */
}
.close-thik:after {
content: '✖'; /* UTF-8 symbol */
}

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