From 073a49a8af2f3ee38ef4303020f1e94764e55f99 Mon Sep 17 00:00:00 2001 From: sujitprasad Date: Tue, 16 Feb 2016 22:42:08 +0530 Subject: [PATCH] update v1.0.6 --- .env | 2 +- README.md | 2 +- app/Exceptions/Handler.php | 132 +- .../Admin/helpdesk/AgentController.php | 416 +- .../Admin/helpdesk/BanlistController.php | 270 +- .../Admin/helpdesk/DepartmentController.php | 406 +- .../Admin/helpdesk/EmailsController.php | 312 +- .../Admin/helpdesk/FormController.php | 101 +- .../Admin/helpdesk/GroupController.php | 309 +- .../Admin/helpdesk/HelptopicController.php | 376 +- .../Admin/helpdesk/HomeController.php | 34 +- .../Admin/helpdesk/LanguageController.php | 194 +- .../Admin/helpdesk/ProfileController.php | 196 +- .../Admin/helpdesk/SettingsController.php | 805 +-- .../Admin/helpdesk/SlaController.php | 311 +- .../Admin/helpdesk/TeamController.php | 276 +- .../Admin/helpdesk/TemplateController.php | 468 +- .../Admin/helpdesk/ThreadController.php | 44 +- .../Controllers/Agent/DashboardController.php | 92 - .../Controllers/Agent/dashboard.blade.php | 234 - .../Agent/helpdesk/CannedController.php | 243 +- .../Agent/helpdesk/DashboardController.php | 107 +- .../Agent/helpdesk/MailController.php | 417 +- .../Agent/helpdesk/NotificationController.php | 264 +- .../Agent/helpdesk/OrganizationController.php | 403 +- .../Agent/helpdesk/Ticket2Controller.php | 117 +- .../Agent/helpdesk/TicketController.php | 4205 ++++++------ .../Agent/helpdesk/UserController.php | 672 +- .../Agent/kb/ArticleController.php | 431 +- .../Agent/kb/CategoryController.php | 321 +- .../Controllers/Agent/kb/PageController.php | 267 +- .../Agent/kb/SettingsController.php | 460 +- app/Http/Controllers/Api/v1/ApiController.php | 24 +- .../Api/v1/InstallerApiController.php | 227 +- .../Controllers/Api/v1/TestController.php | 128 +- .../Controllers/Api/v1/TicketController.php | 20 +- .../Api/v1/TokenAuthController.php | 29 +- app/Http/Controllers/Auth/AuthController.php | 276 +- .../Controllers/Auth/PasswordController.php | 83 +- app/Http/Controllers/Auth/UserController.php | 638 +- .../helpdesk/ClientTicketController.php | 102 +- .../Client/helpdesk/EmailController.php | 47 +- .../Client/helpdesk/FormController.php | 279 +- .../Client/helpdesk/GuestController.php | 481 +- .../Client/helpdesk/WelcomepageController.php | 44 +- .../Controllers/Client/kb/UserController.php | 508 +- .../Controllers/Common/SettingsController.php | 139 +- app/Http/Controllers/Controller.php | 5 +- .../Controllers/Error/ErrorController.php | 20 +- app/Http/Controllers/HomeController.php | 69 +- .../Installer/helpdesk/InstallController.php | 546 +- app/Http/Controllers/PhpMailController.php | 119 - app/Http/Kernel.php | 61 +- app/Http/Middleware/Authenticate.php | 69 +- app/Http/Middleware/CheckRole.php | 31 +- app/Http/Middleware/CheckRoleAgent.php | 31 +- app/Http/Middleware/CheckRoleUser.php | 31 +- app/Http/Middleware/LanguageMiddleware.php | 14 +- .../Middleware/RedirectIfAuthenticated.php | 60 +- app/Http/Middleware/VerifyCsrfToken.php | 4 +- app/Http/Requests/Request.php | 8 +- app/Http/Requests/helpdesk/AgentRequest.php | 63 +- app/Http/Requests/helpdesk/AgentUpdate.php | 61 +- app/Http/Requests/helpdesk/ArticleRequest.php | 43 +- app/Http/Requests/helpdesk/BanRequest.php | 43 +- app/Http/Requests/helpdesk/BanlistRequest.php | 43 +- app/Http/Requests/helpdesk/CannedRequest.php | 43 +- .../Requests/helpdesk/CannedUpdateRequest.php | 43 +- app/Http/Requests/helpdesk/CheckTicket.php | 43 +- app/Http/Requests/helpdesk/ClientRequest.php | 47 +- app/Http/Requests/helpdesk/CommentRequest.php | 47 +- app/Http/Requests/helpdesk/CompanyRequest.php | 47 +- app/Http/Requests/helpdesk/ContactRequest.php | 47 +- .../Requests/helpdesk/CreateTicketRequest.php | 55 +- .../Requests/helpdesk/DepartmentRequest.php | 47 +- .../Requests/helpdesk/DepartmentUpdate.php | 45 +- app/Http/Requests/helpdesk/DiagnoRequest.php | 47 +- app/Http/Requests/helpdesk/EmailRequest.php | 39 +- .../Requests/helpdesk/EmailsEditRequest.php | 67 +- app/Http/Requests/helpdesk/EmailsRequest.php | 65 +- app/Http/Requests/helpdesk/FormRequest.php | 47 +- app/Http/Requests/helpdesk/GroupRequest.php | 41 +- .../Requests/helpdesk/HelptopicRequest.php | 53 +- .../Requests/helpdesk/HelptopicUpdate.php | 51 +- .../Requests/helpdesk/InstallerRequest.php | 51 +- app/Http/Requests/helpdesk/LoginRequest.php | 43 +- app/Http/Requests/helpdesk/MessageRequest.php | 47 +- .../Requests/helpdesk/OrganizationRequest.php | 45 +- .../Requests/helpdesk/OrganizationUpdate.php | 43 +- .../Requests/helpdesk/ProfilePassword.php | 45 +- app/Http/Requests/helpdesk/ProfileRequest.php | 43 +- .../Requests/helpdesk/RegisterRequest.php | 47 +- app/Http/Requests/helpdesk/SlaRequest.php | 43 +- app/Http/Requests/helpdesk/SlaUpdate.php | 41 +- app/Http/Requests/helpdesk/SmtpRequest.php | 51 +- .../Requests/helpdesk/Sys_userRequest.php | 45 +- app/Http/Requests/helpdesk/Sys_userUpdate.php | 45 +- app/Http/Requests/helpdesk/SystemRequest.php | 43 +- app/Http/Requests/helpdesk/TeamRequest.php | 43 +- app/Http/Requests/helpdesk/TeamUpdate.php | 39 +- .../Requests/helpdesk/TemplateRequest.php | 47 +- app/Http/Requests/helpdesk/TemplateUdate.php | 45 +- .../Requests/helpdesk/TicketEditRequest.php | 49 +- app/Http/Requests/helpdesk/TicketForm.php | 47 +- app/Http/Requests/helpdesk/TicketRequest.php | 45 +- app/Http/Requests/kb/ArticleRequest.php | 46 +- app/Http/Requests/kb/ArticleUpdate.php | 46 +- app/Http/Requests/kb/CategoryRequest.php | 45 +- app/Http/Requests/kb/CategoryUpdate.php | 45 +- app/Http/Requests/kb/CommentRequest.php | 46 +- app/Http/Requests/kb/ContactRequest.php | 46 +- app/Http/Requests/kb/FooterRequest.php | 43 +- app/Http/Requests/kb/InstallerRequest.php | 51 +- app/Http/Requests/kb/PageRequest.php | 45 +- app/Http/Requests/kb/PageUpdate.php | 45 +- app/Http/Requests/kb/ProfilePassword.php | 46 +- app/Http/Requests/kb/ProfileRequest.php | 44 +- app/Http/Requests/kb/SearchRequest.php | 40 +- app/Http/Requests/kb/SettingsRequests.php | 42 +- app/Http/Requests/kb/SocialRequest.php | 68 +- app/Http/routes.php | 670 +- app/Model/helpdesk/Agent/Agents.php | 23 +- .../helpdesk/Agent/Assign_team_agent.php | 9 +- app/Model/helpdesk/Agent/Department.php | 23 +- .../Agent/Group_assign_department.php | 9 +- app/Model/helpdesk/Agent/Groups.php | 27 +- app/Model/helpdesk/Agent/Teams.php | 19 +- app/Model/helpdesk/Agent_panel/Canned.php | 12 +- .../helpdesk/Agent_panel/Organization.php | 12 +- app/Model/helpdesk/Agent_panel/User_org.php | 12 +- .../helpdesk/Agent_panel/User_org_head.php | 12 +- app/Model/helpdesk/Email/Banlist.php | 12 +- app/Model/helpdesk/Email/Emails.php | 27 +- app/Model/helpdesk/Email/Smtp.php | 17 +- app/Model/helpdesk/Email/Template.php | 12 +- app/Model/helpdesk/Form/Fields.php | 21 +- app/Model/helpdesk/Form/Form_details.php | 12 +- app/Model/helpdesk/Form/Form_name.php | 12 +- app/Model/helpdesk/Form/Form_value.php | 12 +- app/Model/helpdesk/Form/Forms.php | 17 +- app/Model/helpdesk/Guest/Guest_note.php | 12 +- app/Model/helpdesk/Manage/Forms.php | 14 +- app/Model/helpdesk/Manage/Help_topic.php | 23 +- app/Model/helpdesk/Manage/Sla_plan.php | 19 +- app/Model/helpdesk/Settings/Access.php | 21 +- app/Model/helpdesk/Settings/Alert.php | 29 +- app/Model/helpdesk/Settings/Company.php | 21 +- app/Model/helpdesk/Settings/Email.php | 19 +- app/Model/helpdesk/Settings/Plugin.php | 8 +- app/Model/helpdesk/Settings/Responder.php | 17 +- app/Model/helpdesk/Settings/System.php | 16 +- app/Model/helpdesk/Settings/Ticket.php | 19 +- app/Model/helpdesk/Theme/Footer.php | 9 +- app/Model/helpdesk/Theme/Footer2.php | 9 +- app/Model/helpdesk/Theme/Footer3.php | 8 +- app/Model/helpdesk/Theme/Footer4.php | 8 +- app/Model/helpdesk/Theme/Widgets.php | 9 +- app/Model/helpdesk/Ticket/Ticket_Status.php | 18 +- app/Model/helpdesk/Ticket/Ticket_Thread.php | 27 +- app/Model/helpdesk/Ticket/Tickets.php | 39 +- app/Model/helpdesk/Utility/Date_format.php | 12 +- .../helpdesk/Utility/Date_time_format.php | 12 +- app/Model/helpdesk/Utility/Email.php | 19 +- app/Model/helpdesk/Utility/Form_type.php | 13 +- .../helpdesk/Utility/Form_visibility.php | 13 +- app/Model/helpdesk/Utility/Languages.php | 12 +- app/Model/helpdesk/Utility/Limit_Login.php | 9 +- .../helpdesk/Utility/Log_notification.php | 9 +- app/Model/helpdesk/Utility/Logs.php | 12 +- .../helpdesk/Utility/MailboxProtocol.php | 12 +- app/Model/helpdesk/Utility/Priority.php | 16 +- app/Model/helpdesk/Utility/Ticket_thread.php | 12 +- app/Model/helpdesk/Utility/Time_format.php | 12 +- app/Model/helpdesk/Utility/Version_Check.php | 10 +- app/Model/kb/Article.php | 39 +- app/Model/kb/Category.php | 8 +- app/Model/kb/Comment.php | 8 +- app/Model/kb/Contact.php | 8 +- app/Model/kb/Country.php | 8 +- app/Model/kb/DateFormat.php | 8 +- app/Model/kb/Faq.php | 8 +- app/Model/kb/Footer.php | 9 +- app/Model/kb/Footer2.php | 8 +- app/Model/kb/Footer3.php | 8 +- app/Model/kb/Footer4.php | 8 +- app/Model/kb/Options.php | 8 +- app/Model/kb/Page.php | 8 +- app/Model/kb/Relationship.php | 12 +- app/Model/kb/Settings.php | 17 +- app/Model/kb/Side1.php | 9 +- app/Model/kb/Side2.php | 9 +- app/Model/kb/Social.php | 8 +- app/Model/kb/Timezone.php | 8 +- app/Model/kb/Zone.php | 11 +- app/Plugins/ServiceProvider.php | 47 +- app/Providers/AppServiceProvider.php | 42 +- app/Providers/BusServiceProvider.php | 49 +- app/Providers/ConfigServiceProvider.php | 33 +- app/Providers/EventServiceProvider.php | 45 +- app/Providers/RouteServiceProvider.php | 67 +- app/Services/Registrar.php | 58 +- app/User.php | 50 +- bootstrap/app.php | 65 +- bootstrap/autoload.php | 51 +- composer.json | 6 +- composer.lock | 739 ++- config/app.php | 13 +- config/auth.php | 115 +- config/bugsnag.php | 4 +- config/cache.php | 133 +- config/chumper.datatable.php | 192 +- config/compile.php | 64 +- config/database.php | 248 +- config/filesystems.php | 120 +- config/gravatar.php | 36 +- config/languages.php | 275 +- config/liebigCron.php | 11 +- config/mail.php | 219 +- config/queue.php | 159 +- config/services.php | 58 +- config/session.php | 272 +- config/testing/database.php | 225 +- config/view.php | 51 +- ...2016_01_25_075608_create_banlist_table.php | 36 - ...25_075608_create_canned_response_table.php | 36 - ...075608_create_custom_form_fields_table.php | 39 - ...01_25_075608_create_custom_forms_table.php | 34 - ..._01_25_075608_create_date_format_table.php | 33 - ...5_075608_create_date_time_format_table.php | 33 - ...6_01_25_075608_create_department_table.php | 46 - .../2016_01_25_075608_create_emails_table.php | 58 - ...8_create_group_assign_department_table.php | 35 - .../2016_01_25_075608_create_groups_table.php | 48 - ...6_01_25_075608_create_help_topic_table.php | 47 - ...8_create_kb_article_relationship_table.php | 35 - ...6_01_25_075608_create_kb_article_table.php | 38 - ..._01_25_075608_create_kb_category_table.php | 38 - ...6_01_25_075608_create_kb_comment_table.php | 39 - ...016_01_25_075608_create_kb_pages_table.php | 38 - ..._01_25_075608_create_kb_settings_table.php | 34 - ...16_01_25_075608_create_languages_table.php | 34 - ...5_075608_create_log_notification_table.php | 34 - ...5_075608_create_mailbox_protocol_table.php | 34 - ...01_25_075608_create_organization_table.php | 39 - ...25_075608_create_password_resets_table.php | 34 - ...2016_01_25_075608_create_plugins_table.php | 36 - ...16_01_25_075608_create_send_mail_table.php | 39 - ...608_create_settings_alert_notice_table.php | 62 - ...08_create_settings_auto_response_table.php | 38 - ...5_075608_create_settings_company_table.php | 42 - ..._25_075608_create_settings_email_table.php | 45 - ...25_075608_create_settings_system_table.php | 47 - ...25_075608_create_settings_ticket_table.php | 49 - ...016_01_25_075608_create_sla_plan_table.php | 39 - ..._075608_create_team_assign_agent_table.php | 35 - .../2016_01_25_075608_create_teams_table.php | 38 - ...016_01_25_075608_create_template_table.php | 38 - ..._075608_create_ticket_attachment_table.php | 39 - ...75608_create_ticket_collaborator_table.php | 37 - ...5_075608_create_ticket_form_data_table.php | 36 - ...25_075608_create_ticket_priority_table.php | 37 - ...1_25_075608_create_ticket_source_table.php | 34 - ...1_25_075608_create_ticket_status_table.php | 40 - ...1_25_075608_create_ticket_thread_table.php | 42 - ...2016_01_25_075608_create_tickets_table.php | 62 - ..._01_25_075608_create_time_format_table.php | 33 - ...016_01_25_075608_create_timezone_table.php | 34 - ..._create_user_assign_organization_table.php | 35 - .../2016_01_25_075608_create_users_table.php | 59 - ...1_25_075608_create_version_check_table.php | 35 - ...2016_01_25_075608_create_widgets_table.php | 36 - ..._foreign_keys_to_canned_response_table.php | 35 - ...2_add_foreign_keys_to_department_table.php | 37 - ...75612_add_foreign_keys_to_emails_table.php | 39 - ..._keys_to_group_assign_department_table.php | 37 - ...2_add_foreign_keys_to_help_topic_table.php | 45 - ..._keys_to_kb_article_relationship_table.php | 37 - ...2_add_foreign_keys_to_kb_comment_table.php | 35 - ...add_foreign_keys_to_organization_table.php | 35 - ..._foreign_keys_to_settings_system_table.php | 41 - ...oreign_keys_to_team_assign_agent_table.php | 37 - ...075612_add_foreign_keys_to_teams_table.php | 35 - ...oreign_keys_to_ticket_attachment_table.php | 35 - ...eign_keys_to_ticket_collaborator_table.php | 37 - ...foreign_keys_to_ticket_form_data_table.php | 35 - ...dd_foreign_keys_to_ticket_thread_table.php | 39 - ...5612_add_foreign_keys_to_tickets_table.php | 51 - ...keys_to_user_assign_organization_table.php | 37 - ...075612_add_foreign_keys_to_users_table.php | 37 - .../2016_02_01_052219_settings_ratings.php | 52 - database/seeds/DatabaseSeeder.php | 501 +- nbproject/project.properties | 7 - nbproject/project.xml | 9 - public/downloads/en.zip | Bin 10145 -> 9494 bytes public/lb-faveo/css/load-styles.css | 4 +- public/lb-faveo/css/style.css | 130 + public/lb-faveo/css/wc-setup.css | 2 +- public/lb-faveo/dist/css/jquery.rating.css | 12 - public/lb-faveo/dist/images/delete.gif | Bin 752 -> 0 bytes public/lb-faveo/dist/images/star.gif | Bin 815 -> 0 bytes public/lb-faveo/dist/images/stars.png | Bin 3945 -> 0 bytes public/lb-faveo/dist/js/jquery.rating.pack.js | 9 - .../datatables/dataTables.bootstrap.js | 4 +- public/uploads/de.zip | Bin 10088 -> 0 bytes public/uploads/en.zip | Bin 9770 -> 9494 bytes resources/lang/en/lang.php | 1348 ++-- resources/lang/en/pagination.php | 25 +- resources/lang/en/passwords.php | 31 +- resources/lang/en/validation.php | 197 +- resources/views/auth/login.blade.php | 98 +- resources/views/auth/password.blade.php | 54 +- resources/views/auth/register.blade.php | 136 +- resources/views/auth/reset.blade.php | 94 +- resources/views/emails/Admin_mail.blade.php | 14 - .../views/emails/Ticket_Create.blade.php | 25 - resources/views/emails/Ticket_Reply.blade.php | 4 - .../views/emails/Ticket_assign.blade.php | 9 - resources/views/emails/check_ticket.blade.php | 9 - resources/views/emails/close_ticket.blade.php | 7 - .../views/emails/default/Admin_mail.blade.php | 14 - .../emails/default/Ticket_Create.blade.php | 25 - .../emails/default/Ticket_Reply.blade.php | 4 - .../emails/default/Ticket_assign.blade.php | 9 - .../emails/default/check_ticket.blade.php | 9 - .../emails/default/close_ticket.blade.php | 7 - .../emails/default/email_reply.blade.php | 13 - resources/views/emails/default/pass.blade.php | 14 - .../emails/default/password.blade (2).php | 1 - .../views/emails/default/password.blade.php | 14 - .../views/emails/default/report.blade.php | 1 - .../emails/default/ticket_re-reply.blade.php | 11 - resources/views/emails/email_reply.blade.php | 13 - .../emails/notifications/admin.blade.php | 201 +- resources/views/emails/pass.blade.php | 14 - resources/views/emails/password.blade (2).php | 1 - resources/views/emails/password.blade.php | 14 - .../views/emails/random/Admin_mail.blade.php | 14 - .../emails/random/Ticket_Create.blade.php | 25 - .../emails/random/Ticket_Reply.blade.php | 4 - .../emails/random/Ticket_assign.blade.php | 9 - .../emails/random/check_ticket.blade.php | 9 - .../emails/random/close_ticket.blade.php | 7 - .../views/emails/random/email_reply.blade.php | 13 - resources/views/emails/random/pass.blade.php | 14 - .../emails/random/password.blade (2).php | 1 - .../views/emails/random/password.blade.php | 14 - .../views/emails/random/report.blade.php | 1 - .../emails/random/ticket_re-reply.blade.php | 11 - resources/views/emails/report.blade.php | 1 - .../views/emails/ticket_re-reply.blade.php | 11 - .../agent/agents/agent-profile.blade.php | 102 +- .../helpdesk/agent/agents/create.blade.php | 248 +- .../helpdesk/agent/agents/edit.blade.php | 336 +- .../helpdesk/agent/agents/index.blade.php | 154 +- .../agent/departments/create.blade.php | 4 +- .../helpdesk/agent/departments/edit.blade.php | 27 +- .../helpdesk/agent/groups/create.blade.php | 4 +- .../helpdesk/agent/groups/edit.blade.php | 4 +- .../helpdesk/agent/teams/create.blade.php | 80 +- .../admin/helpdesk/agent/teams/edit.blade.php | 82 +- .../helpdesk/agent/teams/index.blade.php | 142 +- .../helpdesk/emails/banlist/create.blade.php | 4 +- .../helpdesk/emails/banlist/edit.blade.php | 4 +- .../helpdesk/emails/emails/create.blade.php | 128 +- .../helpdesk/emails/emails/edit.blade.php | 75 +- .../helpdesk/emails/emails/index.blade.php | 39 +- .../emails/template/listtemplates.blade.php | 64 +- .../emails/template/readtemplates.blade.php | 48 +- .../admin/helpdesk/language/index.blade.php | 4 +- .../manage/helptopic/create.blade.php | 8 +- .../helpdesk/manage/helptopic/edit.blade.php | 8 +- .../helpdesk/manage/sla/create.blade.php | 4 +- .../admin/helpdesk/manage/sla/edit.blade.php | 4 +- .../default1/admin/helpdesk/setting.blade.php | 25 +- .../admin/helpdesk/settings/email.blade.php | 18 +- .../admin/helpdesk/settings/ratings.blade.php | 171 - .../admin/helpdesk/settings/system.blade.php | 4 +- .../admin/helpdesk/settings/ticket.blade.php | 29 +- .../helpdesk/dashboard/dashboard.blade.php | 273 +- .../agent/helpdesk/ticket/new.blade.php | 7 +- .../agent/helpdesk/ticket/timeline.blade.php | 127 +- .../agent/helpdesk/user/create.blade.php | 4 +- .../agent/helpdesk/user/edit.blade.php | 8 +- .../helpdesk/user/profile-edit.blade.php | 4 +- .../agent/kb/article/create.blade.php | 345 +- .../default1/agent/kb/article/edit.blade.php | 359 +- .../default1/agent/kb/category/edit.blade.php | 4 +- .../default1/agent/layout/agent.blade.php | 39 +- .../client/helpdesk/ckeckticket.blade.php | 13 +- .../client/kb/article-list/home.blade.php | 20 +- .../client/kb/article-list/show.blade.php | 2 + .../default1/client/layout/client.blade.php | 4 +- .../installer/helpdesk/view1.blade.php | 10 +- .../installer/helpdesk/view2.blade.php | 31 +- .../installer/helpdesk/view3.blade.php | 33 +- .../installer/helpdesk/view4.blade.php | 40 +- .../installer/helpdesk/view4b.blade.php | 2 +- .../installer/helpdesk/view5.blade.php | 48 +- .../installer/helpdesk/view6.blade.php | 8 +- .../installer/layout/installer.blade.php | 9 +- vendor/autoload.php | 2 +- vendor/bin/phpspec | 8 +- vendor/bin/phpunit | 8 +- vendor/bugsnag/bugsnag-laravel/CHANGELOG.md | 9 + vendor/bugsnag/bugsnag-laravel/README.md | 39 +- .../BugsnagExceptionHandler.php | 6 +- .../BugsnagLaravelServiceProvider.php | 2 +- .../BugsnagLumenServiceProvider.php | 2 +- vendor/bugsnag/bugsnag/.travis.yml | 1 + vendor/bugsnag/bugsnag/CHANGELOG.md | 9 + vendor/bugsnag/bugsnag/build/bugsnag.phar | Bin 55587 -> 55691 bytes vendor/bugsnag/bugsnag/composer.json | 2 +- .../bugsnag/src/Bugsnag/Configuration.php | 2 +- vendor/bugsnag/bugsnag/src/Bugsnag/Error.php | 14 +- .../bugsnag/bugsnag/src/Bugsnag/Request.php | 2 +- .../bugsnag/tests/Bugsnag/ClientTest.php | 20 +- .../bugsnag/tests/Bugsnag/ErrorTest.php | 6 + vendor/composer/ClassLoader.php | 8 +- vendor/composer/autoload_classmap.php | 1 - vendor/composer/autoload_files.php | 25 +- vendor/composer/autoload_namespaces.php | 7 +- vendor/composer/autoload_psr4.php | 7 + vendor/composer/autoload_real.php | 22 +- vendor/composer/installed.json | 5841 +++++++++-------- .../METADATA-VERSION.txt | 2 +- .../giggsey/libphonenumber-for-php/README.md | 23 +- .../GeneratePhonePrefixDataCommand.php | 6 +- .../buildtools/GeneratePhonePrefixData.php | 14 +- .../libphonenumber-for-php/composer.json | 4 +- .../src/libphonenumber/PhoneNumberUtil.php | 2 - .../libphonenumber/carrier/data/en/225.php | 1 + .../libphonenumber/carrier/data/en/234.php | 16 +- .../libphonenumber/carrier/data/en/235.php | 1 + .../libphonenumber/carrier/data/en/251.php | 7 +- .../libphonenumber/carrier/data/en/506.php | 1 + .../libphonenumber/carrier/data/en/599.php | 2 + .../src/libphonenumber/carrier/data/en/61.php | 1 + .../libphonenumber/carrier/data/en/675.php | 3 + .../src/libphonenumber/carrier/data/en/91.php | 1 + .../libphonenumber/carrier/data/en/993.php | 1 + .../data/PhoneNumberMetadata_AG.php | 3 +- .../data/PhoneNumberMetadata_AI.php | 3 +- .../data/PhoneNumberMetadata_AS.php | 3 +- .../data/PhoneNumberMetadata_AU.php | 2 +- .../data/PhoneNumberMetadata_BB.php | 5 +- .../data/PhoneNumberMetadata_BM.php | 3 +- .../data/PhoneNumberMetadata_BR.php | 4 +- .../data/PhoneNumberMetadata_BS.php | 3 +- .../data/PhoneNumberMetadata_BW.php | 5 +- .../data/PhoneNumberMetadata_CA.php | 5 +- .../data/PhoneNumberMetadata_CC.php | 2 +- .../data/PhoneNumberMetadata_CI.php | 5 +- .../data/PhoneNumberMetadata_CK.php | 9 +- .../data/PhoneNumberMetadata_CR.php | 10 +- .../data/PhoneNumberMetadata_CW.php | 13 +- .../data/PhoneNumberMetadata_CX.php | 2 +- .../data/PhoneNumberMetadata_DM.php | 3 +- .../data/PhoneNumberMetadata_DO.php | 3 +- .../data/PhoneNumberMetadata_ET.php | 5 +- .../data/PhoneNumberMetadata_GD.php | 3 +- .../data/PhoneNumberMetadata_GM.php | 7 +- .../data/PhoneNumberMetadata_GU.php | 3 +- .../data/PhoneNumberMetadata_HN.php | 2 +- .../data/PhoneNumberMetadata_IN.php | 4 +- .../data/PhoneNumberMetadata_JM.php | 3 +- .../data/PhoneNumberMetadata_KN.php | 3 +- .../data/PhoneNumberMetadata_KR.php | 14 +- .../data/PhoneNumberMetadata_KY.php | 3 +- .../data/PhoneNumberMetadata_LC.php | 3 +- .../data/PhoneNumberMetadata_MP.php | 3 +- .../data/PhoneNumberMetadata_MS.php | 3 +- .../data/PhoneNumberMetadata_NA.php | 6 +- .../data/PhoneNumberMetadata_NG.php | 59 +- .../data/PhoneNumberMetadata_PG.php | 2 +- .../data/PhoneNumberMetadata_PR.php | 3 +- .../data/PhoneNumberMetadata_SE.php | 92 +- .../data/PhoneNumberMetadata_SI.php | 4 +- .../data/PhoneNumberMetadata_SK.php | 45 +- .../data/PhoneNumberMetadata_SX.php | 3 +- .../data/PhoneNumberMetadata_TC.php | 3 +- .../data/PhoneNumberMetadata_TD.php | 2 +- .../data/PhoneNumberMetadata_TM.php | 2 +- .../data/PhoneNumberMetadata_TT.php | 3 +- .../data/PhoneNumberMetadata_TV.php | 13 +- .../data/PhoneNumberMetadata_US.php | 3 +- .../data/PhoneNumberMetadata_VC.php | 3 +- .../data/PhoneNumberMetadata_VG.php | 3 +- .../data/PhoneNumberMetadata_VI.php | 3 +- .../data/PhoneNumberMetadata_WF.php | 12 +- .../data/ShortNumberMetadata_FR.php | 5 +- .../data/ShortNumberMetadata_HR.php | 10 +- .../data/ShortNumberMetadata_HU.php | 40 +- .../data/ShortNumberMetadata_IT.php | 5 +- .../data/ShortNumberMetadata_KR.php | 22 +- .../data/ShortNumberMetadata_LV.php | 7 +- .../data/ShortNumberMetadata_PT.php | 36 +- .../data/ShortNumberMetadata_TV.php | 11 +- .../src/libphonenumber/geocoding/data/Map.php | 1068 +-- .../libphonenumber/geocoding/data/en/46.php | 15 + vendor/jeremeamia/SuperClosure/phpunit.xml | 19 - .../SuperClosure/src/hash_equals.php | 59 - .../src/Illuminate/Foundation/Application.php | 2 +- .../framework/src/Illuminate/View/Factory.php | 2 + .../framework/src/Illuminate/View/View.php | 684 +- vendor/league/flysystem/README.md | 101 - vendor/mtdowling/cron-expression/README.md | 13 +- .../mtdowling/cron-expression/composer.json | 2 +- .../cron-expression/phpunit.xml.dist | 17 - .../src/Cron/AbstractField.php | 39 + .../src/Cron/CronExpression.php | 60 +- .../src/Cron/DayOfWeekField.php | 5 +- .../cron-expression/src/Cron/HoursField.php | 50 +- .../cron-expression/src/Cron/MinutesField.php | 39 +- .../tests/Cron/CronExpressionTest.php | 36 + .../tests/Cron/HoursFieldTest.php | 36 + .../tests/Cron/MonthFieldTest.php | 19 + vendor/nesbot/carbon/.editorconfig | 14 - vendor/nicolaslopezj/searchable/README.md | 8 +- .../searchable/src/SearchableTrait.php | 18 +- vendor/php-imap/php-imap/README.md | 2 +- vendor/php-imap/php-imap/composer.json | 7 +- .../php-imap/src/PhpImap/IncomingMail.php | 1 + .../php-imap/php-imap/src/PhpImap/Mailbox.php | 21 +- vendor/phpspec/phpspec/CHANGES.md | 11 + vendor/phpspec/phpspec/appveyor.yml | 1 + vendor/phpspec/phpspec/behat.yml.dist | 6 +- vendor/phpspec/phpspec/bin/phpspec | 2 +- .../developer_generates_method.feature | 61 + vendor/phpspec/phpspec/phpspec.yml | 1 - .../TokenizedTypeHintRewriterSpec.php | 33 + .../PhpSpec/Locator/PSR0/PSR0LocatorSpec.php | 6 +- .../PhpSpec/Locator/PSR0/PSR0ResourceSpec.php | 14 + .../PhpSpec/Util/ClassFileAnalyserSpec.php | 30 + .../TokenizedTypeHintRewriter.php | 24 +- .../Writer/TokenizedCodeWriter.php | 4 +- .../Console/Assembler/PresenterAssembler.php | 3 +- .../PhpSpec/Console/ContainerAssembler.php | 6 + .../PhpSpec/Formatter/ConsoleFormatter.php | 2 +- .../src/PhpSpec/Locator/PSR0/PSR0Locator.php | 54 +- .../src/PhpSpec/Locator/PSR0/PSR0Resource.php | 9 + .../Process/ReRunner/PassthruReRunner.php | 3 +- .../src/PhpSpec/Util/ClassFileAnalyser.php | 48 +- vendor/phpunit/phpunit/CODE_OF_CONDUCT.md | 26 +- vendor/phpunit/phpunit/ChangeLog-4.8.md | 15 + vendor/phpunit/phpunit/LICENSE | 2 +- vendor/phpunit/phpunit/phpunit.xsd | 1 + .../phpunit/src/Framework/TestCase.php | 4 +- vendor/phpunit/phpunit/src/Runner/Version.php | 8 +- .../phpunit/src/Util/Configuration.php | 3 + .../phpunit/phpunit/src/Util/PHP/Default.php | 2 +- .../phpunit/src/Util/PHP/eval-stdin.php | 2 +- vendor/phpunit/phpunit/src/Util/XML.php | 11 + .../phpunit/tests/Util/ConfigurationTest.php | 1 + vendor/phpunit/phpunit/tests/Util/XMLTest.php | 27 + .../phpunit/tests/_files/configuration.xml | 3 + vendor/propaganistas/laravel-phone/README.md | 10 +- .../laravel-phone/src/PhoneValidator.php | 41 +- .../laravel-phone/src/helpers.php | 21 +- .../tests/PhoneValidatorTest.php | 37 +- .../tests/TestPhoneValidator.php | 168 - vendor/services.json | 12 +- .../EventSubscriberInterface.php | 2 +- vendor/symfony/event-dispatcher/LICENSE | 2 +- vendor/symfony/filesystem/Filesystem.php | 6 +- vendor/symfony/filesystem/LICENSE | 2 +- vendor/symfony/filesystem/LockHandler.php | 6 +- .../Symfony/Component/HttpKernel/Kernel.php | 6 +- vendor/symfony/polyfill-php56/LICENSE | 2 +- vendor/symfony/polyfill-php56/README.md | 4 +- vendor/symfony/polyfill-php56/composer.json | 2 +- vendor/symfony/polyfill-util/LICENSE | 2 +- vendor/symfony/polyfill-util/README.md | 6 +- vendor/symfony/polyfill-util/TestListener.php | 3 + vendor/symfony/polyfill-util/composer.json | 2 +- .../Core/Tests/Util/SecureRandomTest.php | 201 - .../Security/Core/Util/SecureRandom.php | 87 +- .../Component/Security/Core/composer.json | 3 +- vendor/symfony/yaml/Escaper.php | 4 +- vendor/symfony/yaml/Inline.php | 12 +- vendor/symfony/yaml/LICENSE | 2 +- vendor/symfony/yaml/Parser.php | 37 +- vendor/symfony/yaml/Tests/DumperTest.php | 14 +- .../Fixtures/YtsSpecificationExamples.yml | 4 +- .../yaml/Tests/Fixtures/YtsTypeTransfers.yml | 4 +- vendor/symfony/yaml/Tests/ParserTest.php | 138 +- vendor/symfony/yaml/Unescaper.php | 2 +- vendor/symfony/yaml/Yaml.php | 7 +- 587 files changed, 21487 insertions(+), 22766 deletions(-) delete mode 100644 app/Http/Controllers/Agent/DashboardController.php delete mode 100644 app/Http/Controllers/Agent/dashboard.blade.php delete mode 100644 app/Http/Controllers/PhpMailController.php delete mode 100644 database/migrations/2016_01_25_075608_create_banlist_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_canned_response_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_custom_form_fields_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_custom_forms_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_date_format_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_date_time_format_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_department_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_emails_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_group_assign_department_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_groups_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_help_topic_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_article_relationship_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_article_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_category_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_comment_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_pages_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_kb_settings_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_languages_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_log_notification_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_mailbox_protocol_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_organization_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_password_resets_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_plugins_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_send_mail_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_alert_notice_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_auto_response_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_company_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_email_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_system_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_settings_ticket_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_sla_plan_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_team_assign_agent_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_teams_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_template_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_attachment_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_collaborator_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_form_data_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_priority_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_source_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_status_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_ticket_thread_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_tickets_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_time_format_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_timezone_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_user_assign_organization_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_users_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_version_check_table.php delete mode 100644 database/migrations/2016_01_25_075608_create_widgets_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_canned_response_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_department_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_emails_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_group_assign_department_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_help_topic_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_kb_article_relationship_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_kb_comment_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_organization_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_settings_system_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_team_assign_agent_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_teams_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_ticket_attachment_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_ticket_collaborator_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_ticket_form_data_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_ticket_thread_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_tickets_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_user_assign_organization_table.php delete mode 100644 database/migrations/2016_01_25_075612_add_foreign_keys_to_users_table.php delete mode 100644 database/migrations/2016_02_01_052219_settings_ratings.php delete mode 100644 nbproject/project.properties delete mode 100644 nbproject/project.xml delete mode 100644 public/lb-faveo/dist/css/jquery.rating.css delete mode 100644 public/lb-faveo/dist/images/delete.gif delete mode 100644 public/lb-faveo/dist/images/star.gif delete mode 100644 public/lb-faveo/dist/images/stars.png delete mode 100644 public/lb-faveo/dist/js/jquery.rating.pack.js delete mode 100644 public/uploads/de.zip delete mode 100644 resources/views/emails/Admin_mail.blade.php delete mode 100644 resources/views/emails/Ticket_Create.blade.php delete mode 100644 resources/views/emails/Ticket_Reply.blade.php delete mode 100644 resources/views/emails/Ticket_assign.blade.php delete mode 100644 resources/views/emails/check_ticket.blade.php delete mode 100644 resources/views/emails/close_ticket.blade.php delete mode 100644 resources/views/emails/default/Admin_mail.blade.php delete mode 100644 resources/views/emails/default/Ticket_Create.blade.php delete mode 100644 resources/views/emails/default/Ticket_Reply.blade.php delete mode 100644 resources/views/emails/default/Ticket_assign.blade.php delete mode 100644 resources/views/emails/default/check_ticket.blade.php delete mode 100644 resources/views/emails/default/close_ticket.blade.php delete mode 100644 resources/views/emails/default/email_reply.blade.php delete mode 100644 resources/views/emails/default/pass.blade.php delete mode 100644 resources/views/emails/default/password.blade (2).php delete mode 100644 resources/views/emails/default/password.blade.php delete mode 100644 resources/views/emails/default/report.blade.php delete mode 100644 resources/views/emails/default/ticket_re-reply.blade.php delete mode 100644 resources/views/emails/email_reply.blade.php delete mode 100644 resources/views/emails/pass.blade.php delete mode 100644 resources/views/emails/password.blade (2).php delete mode 100644 resources/views/emails/password.blade.php delete mode 100644 resources/views/emails/random/Admin_mail.blade.php delete mode 100644 resources/views/emails/random/Ticket_Create.blade.php delete mode 100644 resources/views/emails/random/Ticket_Reply.blade.php delete mode 100644 resources/views/emails/random/Ticket_assign.blade.php delete mode 100644 resources/views/emails/random/check_ticket.blade.php delete mode 100644 resources/views/emails/random/close_ticket.blade.php delete mode 100644 resources/views/emails/random/email_reply.blade.php delete mode 100644 resources/views/emails/random/pass.blade.php delete mode 100644 resources/views/emails/random/password.blade (2).php delete mode 100644 resources/views/emails/random/password.blade.php delete mode 100644 resources/views/emails/random/report.blade.php delete mode 100644 resources/views/emails/random/ticket_re-reply.blade.php delete mode 100644 resources/views/emails/report.blade.php delete mode 100644 resources/views/emails/ticket_re-reply.blade.php delete mode 100644 resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php delete mode 100644 vendor/jeremeamia/SuperClosure/phpunit.xml delete mode 100644 vendor/jeremeamia/SuperClosure/src/hash_equals.php delete mode 100644 vendor/league/flysystem/README.md delete mode 100644 vendor/mtdowling/cron-expression/phpunit.xml.dist delete mode 100644 vendor/nesbot/carbon/.editorconfig delete mode 100644 vendor/phpspec/phpspec/phpspec.yml delete mode 100644 vendor/propaganistas/laravel-phone/tests/TestPhoneValidator.php delete mode 100644 vendor/symfony/security-core/Symfony/Component/Security/Core/Tests/Util/SecureRandomTest.php diff --git a/.env b/.env index 77619ceb1..2f19f896f 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString DB_HOST=localhost -DB_DATABASE=fav222222 +DB_DATABASE=faveo1.0.6 DB_USERNAME=root DB_PASSWORD= CACHE_DRIVER=file diff --git a/README.md b/README.md index 5227c3de9..9160abe65 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

About Faveo

-
  
+
 

Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.

The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions. diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3af418ac9..568c4364e 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -1,95 +1,93 @@ -isHttpException($e) && $e->getStatusCode() == 404) { - return response()->view('errors.404', []); - } else { - if(\Config::get('database.install') == 1) { - // if(\Config::get('app.ErrorLog') == '%1%') { - // \App\Http\Controllers\Common\SettingsController::smtp(); - // \Mail::send('errors.report', array('e' => $e), function ($message) { - // $message->to('', '')->subject('Faveo HELPDESK Pro ERROR'); - // }); - // } - } - return response()->view('errors.500', []); - } - } - return parent::render($request, $e); + /** + * Render an exception into an HTTP response. + * + * @param \Illuminate\Http\Request $request + * @param \Exception $e + * @return \Illuminate\Http\Response + */ + public function render($request, Exception $e) { - if ($this->isHttpException($e)) - { + if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) { + return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]); + //dd($e); + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) { + return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]); + } + + // if (config('app.debug') == false) { + // if ($this->isHttpException($e) && $e->getStatusCode() == 404) { + // return response()->view('errors.404', []); + // } else { + // if (\Config::get('database.install') == 1) { + // // if(\Config::get('app.ErrorLog') == '%1%') { + // // \App\Http\Controllers\Common\SettingsController::smtp(); + // // $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => '', 'email' => ''], $message = ['subject' => '', 'scenario'=>'error-report'], $template_variables = ['e' =>$e ]); + // // } + // } + // return response()->view('errors.500', []); + // } + // } + // return parent::render($request, $e); + + if ($this->isHttpException($e)) { return $this->renderHttpException($e); } - if (config('app.debug')) - { + if (config('app.debug')) { return $this->renderExceptionWithWhoops($e); } return parent::render($request, $e); - - } - + } - - protected function renderExceptionWithWhoops(Exception $e) - { + protected function renderExceptionWithWhoops(Exception $e) { $whoops = new \Whoops\Run; $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler()); return new \Illuminate\Http\Response( - $whoops->handleException($e), - $e->getStatusCode(), - $e->getHeaders() + $whoops->handleException($e), $e->getStatusCode(), $e->getHeaders() ); } - } diff --git a/app/Http/Controllers/Admin/helpdesk/AgentController.php b/app/Http/Controllers/Admin/helpdesk/AgentController.php index 30b3924b1..d2158967a 100644 --- a/app/Http/Controllers/Admin/helpdesk/AgentController.php +++ b/app/Http/Controllers/Admin/helpdesk/AgentController.php @@ -1,13 +1,14 @@ -PhpMailController = $PhpMailController; + SettingsController::smtp(); + // checking authentication + $this->middleware('auth'); + // checking admin roles + $this->middleware('roles'); + } - /** - * Create a new controller instance. - * constructor to check - * 1. authentication - * 2. user roles - * 3. roles must be agent - * @return void - */ - public function __construct() { - SettingsController::smtp(); - // checking authentication - $this->middleware('auth'); - // checking admin roles - $this->middleware('roles'); - } + /** + * Get all agent list page + * @param type User $user + * @return type Response + */ + public function index() { + try { + return view('themes.default1.admin.helpdesk.agent.agents.index'); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Get all agent list page - * @param type User $user - * @return type Response - */ - public function index() { - try { - return view('themes.default1.admin.helpdesk.agent.agents.index'); - } catch (Exception $e) { - return view('404'); - } - } + /** + * creating a new agent + * @param type Assign_team_agent $team_assign_agent + * @param type Timezones $timezone + * @param type Groups $group + * @param type Department $department + * @param type Teams $team + * @return type view + */ + public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) { + try { + $team = $team->get(); + $timezones = $timezone->get(); + $groups = $group->get(); + $departments = $department->get(); + $teams = $team->lists('id', 'name'); + return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * creating a new agent - * @param type Assign_team_agent $team_assign_agent - * @param type Timezones $timezone - * @param type Groups $group - * @param type Department $department - * @param type Teams $team - * @return type view - */ - public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) { - try { - $team = $team->get(); - $timezones = $timezone->get(); - $groups = $group->get(); - $departments = $department->get(); - $teams = $team->lists('id', 'name'); - return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * store a new agent + * @param type User $user + * @param type AgentRequest $request + * @param type Assign_team_agent $team_assign_agent + * @return type Response + */ + public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) { - /** - * store a new agent - * @param type User $user - * @param type AgentRequest $request - * @param type Assign_team_agent $team_assign_agent - * @return type Response - */ - public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) { - - /* Insert to user table */ - $user->role = 'agent'; - $user->fill($request->input())->save(); - $password = $this->generateRandomString(); - $user->password = Hash::make($password); - $requests = $request->input('team_id'); - $id = $user->id; - // insert team - foreach ($requests as $req) { - DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]); - } - /* Succes And Failure condition */ - if ($user->save() == true) { - $name = $user->user_name; - $email = $user->email; - $from = $this->company(); - // send mail on registration - try{ - Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from, 'emailadd' => $email], function ($message) use ($email, $name) { - $message->to($email, $name)->subject('[password]'); - }); - } catch (Exception $e) { - return redirect('agents')->with('fails', 'Some error occuren while sending mail to the agent. Please check email settings'.'

  • '.$e->errorInfo[2].'
  • '); - } - return redirect('agents')->with('success', 'Agent Created sucessfully'); - } else { - return redirect('agents')->with('fails', 'Agent can not Create'); - } - } + // dd($this->system_mail()); - /** - * Editing a selected agent - * @param type int $id - * @param type User $user - * @param type Assign_team_agent $team_assign_agent - * @param type Timezones $timezone - * @param type Groups $group - * @param type Department $department - * @param type Teams $team - * @return type Response - */ - public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) { - try { - $user = $user->whereId($id)->first(); - $team = $team->get(); - $teams1 = $team->lists('name', 'id'); - $timezones = $timezone->get(); - $groups = $group->get(); - $departments = $department->get(); - $table = $team_assign_agent->where('agent_id', $id)->first(); - $teams = $team->lists('id', 'name'); - $assign = $team_assign_agent->where('agent_id', $id)->lists('team_id'); - return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted')); - } catch (Exception $e) { - return redirect('agents')->with('fail', 'No such file'); - } - } + /* Insert to user table */ + $user->role = 'agent'; + $user->fill($request->input())->save(); + $password = $this->generateRandomString(); + $user->password = Hash::make($password); + $requests = $request->input('team_id'); + $id = $user->id; + // insert team + foreach ($requests as $req) { + // DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]); + } + /* Succes And Failure condition */ + if ($user->save() == true) { + $name = $user->user_name; + $email = $user->email; + $system_from = $this->company(); + try { + // send mail on registration + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); + } catch (Exception $e) { + return redirect('agents')->with('fails', 'Some error occured while sending mail to the agent. Please check email settings and try again'); + } + return redirect('agents')->with('success', 'Agent Created sucessfully'); + } else { + return redirect('agents')->with('fails', 'Agent can not Create'); + } + } - /** - * Update the specified agent in storage. - * @param type int $id - * @param type User $user - * @param type AgentUpdate $request - * @param type Assign_team_agent $team_assign_agent - * @return type Response - */ - public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent) { + /** + * Editing a selected agent + * @param type int $id + * @param type User $user + * @param type Assign_team_agent $team_assign_agent + * @param type Timezones $timezone + * @param type Groups $group + * @param type Department $department + * @param type Teams $team + * @return type Response + */ + public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) { + try { + $user = $user->whereId($id)->first(); + $team = $team->get(); + $teams1 = $team->lists('name', 'id'); + $timezones = $timezone->get(); + $groups = $group->get(); + $departments = $department->get(); + $table = $team_assign_agent->where('agent_id', $id)->first(); + $teams = $team->lists('id', 'name'); + $assign = $team_assign_agent->where('agent_id', $id)->lists('team_id'); + return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted')); + } catch (Exception $e) { + return redirect('agents')->with('fail', 'No such file'); + } + } - // storing all the details - $user = $user->whereId($id)->first(); - $daylight_save = $request->input('daylight_save'); - $limit_access = $request->input('limit_access'); - $directory_listing = $request->input('directory_listing'); - $vocation_mode = $request->input('vocation_mode'); - //============================================== - $table = $team_assign_agent->where('agent_id', $id); - $table->delete(); - $requests = $request->input('team_id'); - // inserting team details - foreach ($requests as $req) { - DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]); - } - //Todo For success and failure conditions - try { - $user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save(); - return redirect('agents')->with('success', 'Agent Updated sucessfully'); - } catch (Exception $e) { - return redirect('agents')->with('fails', 'Agent did not update'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified agent in storage. + * @param type int $id + * @param type User $user + * @param type AgentUpdate $request + * @param type Assign_team_agent $team_assign_agent + * @return type Response + */ + public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent) { - /** - * Remove the specified agent from storage. - * @param type int $id - * @param type User $user - * @param type Assign_team_agent $team_assign_agent - * @return type Response - */ - public function destroy($id, User $user, Assign_team_agent $team_assign_agent) { - /* Becouse of foreign key we delete team_assign_agent first */ - error_reporting(E_ALL & ~E_NOTICE); - $team_assign_agent = $team_assign_agent->where('agent_id', $id); - $team_assign_agent->delete(); - $user = $user->whereId($id)->first(); - try { - $error = 'This staff is related to some tickets'; - $user->id; - $user->delete(); - throw new \Exception($error); - return redirect('agents')->with('success', 'Agent Deleted sucessfully'); - } catch (\Exception $e) { - dd($e->errorInfo); - return redirect('agents')->with('fails', $error); - } - } + // storing all the details + $user = $user->whereId($id)->first(); + $daylight_save = $request->input('daylight_save'); + $limit_access = $request->input('limit_access'); + $directory_listing = $request->input('directory_listing'); + $vocation_mode = $request->input('vocation_mode'); + //============================================== + $table = $team_assign_agent->where('agent_id', $id); + $table->delete(); + $requests = $request->input('team_id'); + // inserting team details + foreach ($requests as $req) { + DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]); + } + //Todo For success and failure conditions + try { + $user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save(); + return redirect('agents')->with('success', 'Agent Updated sucessfully'); + } catch (Exception $e) { + return redirect('agents')->with('fails', 'Agent did not update' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + /** + * Remove the specified agent from storage. + * @param type int $id + * @param type User $user + * @param type Assign_team_agent $team_assign_agent + * @return type Response + */ + public function destroy($id, User $user, Assign_team_agent $team_assign_agent) { + /* Becouse of foreign key we delete team_assign_agent first */ + error_reporting(E_ALL & ~E_NOTICE); + $team_assign_agent = $team_assign_agent->where('agent_id', $id); + $team_assign_agent->delete(); + $user = $user->whereId($id)->first(); + try { + $error = 'This staff is related to some tickets'; + $user->id; + $user->delete(); + throw new \Exception($error); + return redirect('agents')->with('success', 'Agent Deleted sucessfully'); + } catch (\Exception $e) { + dd($e->errorInfo); + return redirect('agents')->with('fails', $error); + } + } - /** - * Generate a random string for password - * @param type $length - * @return type string - */ - public function generateRandomString($length = 10) { - $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - $charactersLength = strlen($characters); - $randomString = ''; - for ($i = 0; $i < $length; $i++) { - $randomString .= $characters[rand(0, $charactersLength - 1)]; - } - return $randomString; - } + /** + * Generate a random string for password + * @param type $length + * @return type string + */ + public function generateRandomString($length = 10) { + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $charactersLength = strlen($characters); + $randomString = ''; + for ($i = 0; $i < $length; $i++) { + $randomString .= $characters[rand(0, $charactersLength - 1)]; + } + return $randomString; + } - /** - * Fetching comapny name to send mail - * @return type - */ - public function company() { - $company = Company::Where('id','=','1')->first(); - if($company->company_name == null){ - $company = "Support Center"; - }else{ - $company = $company->company_name; - } - return $company; - } - - // public function agent_profile($id) { - // $agent = User::where('id','=',$id)->first(); - // return \View::make('themes.default1.admin.helpdesk.agent.agents.agent-profile',compact('agent')); - // } + /** + * Fetching comapny name to send mail + * @return type + */ + public function company() { + $company = Company::Where('id', '=', '1')->first(); + if ($company->company_name == null) { + $company = "Support Center"; + } else { + $company = $company->company_name; + } + return $company; + } + /** + * System default email + */ + // public function system_mail() { + // $emails = Emails::all(); + // $count_emails = $emails->count(); + // if($count_emails > 1) { + // dd($emails); + // } + // $email = Email::where('id', '=', '1')->first(); + // return $email->sys_email; + // } } diff --git a/app/Http/Controllers/Admin/helpdesk/BanlistController.php b/app/Http/Controllers/Admin/helpdesk/BanlistController.php index 226f45642..ae7c32730 100644 --- a/app/Http/Controllers/Admin/helpdesk/BanlistController.php +++ b/app/Http/Controllers/Admin/helpdesk/BanlistController.php @@ -1,15 +1,15 @@ -middleware('auth'); - // checking admin roles - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * constructor to check + * 1. authentication + * 2. user roles + * 3. roles must be agent + * @return void + */ + public function __construct() { + // checking authentication + $this->middleware('auth'); + // checking admin roles + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Banlist $ban - * @return type Response - */ - public function index() { - try { - $bans = User::where('ban','=',1)->get(); - return view('themes.default1.admin.helpdesk.emails.banlist.index', compact('bans')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Banlist $ban + * @return type Response + */ + public function index() { + try { + $bans = User::where('ban', '=', 1)->get(); + return view('themes.default1.admin.helpdesk.emails.banlist.index', compact('bans')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Show the form for creating a new resource. - * @return type Response - */ - public function create() { - try { - return view('themes.default1.admin.helpdesk.emails.banlist.create'); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for creating a new resource. + * @return type Response + */ + public function create() { + try { + return view('themes.default1.admin.helpdesk.emails.banlist.create'); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type banlist $ban - * @param type BanRequest $request - * @param type User $user - * @return type Response - */ - public function store(BanRequest $request, User $user) { - // dd($request); - try { - //adding field to user whether it is banned or not - $adban = $request->input('email'); - $use = $user->where('email', $adban)->first(); - if ($use != null) { - $use->ban = $request->input('ban'); - $use->internal_note = $request->input('internal_note'); - $use->save(); - // $user->create($request->input())->save(); - return redirect('banlist')->with('success', 'Email Banned sucessfully'); - } else { - $user = new User; - $user->email = $adban; - $user->ban = $request->input('ban'); - $user->internal_note = $request->input('internal_note'); - $user->save(); - return redirect('banlist')->with('success', 'Email Banned sucessfully'); - } - } catch (Exception $e) { - return redirect('banlist')->with('fails', 'Email can not Ban'); - } - } + /** + * Store a newly created resource in storage. + * @param type banlist $ban + * @param type BanRequest $request + * @param type User $user + * @return type Response + */ + public function store(BanRequest $request, User $user) { + // dd($request); + try { + //adding field to user whether it is banned or not + $adban = $request->input('email'); + $use = $user->where('email', $adban)->first(); + if ($use != null) { + $use->ban = $request->input('ban'); + $use->internal_note = $request->input('internal_note'); + $use->save(); + // $user->create($request->input())->save(); + return redirect('banlist')->with('success', 'Email Banned sucessfully'); + } else { + $user = new User; + $user->email = $adban; + $user->ban = $request->input('ban'); + $user->internal_note = $request->input('internal_note'); + $user->save(); + return redirect('banlist')->with('success', 'Email Banned sucessfully'); + } + } catch (Exception $e) { + return redirect('banlist')->with('fails', 'Email can not Ban'); + } + } - /** - * Display the specified resource. - * - * @param int $id - * @return Response - */ - public function show($id) { - // - } + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) { + // + } - /** - * Show the form for editing the specified resource. - * @param type int $id - * @param type Banlist $ban - * @return type Response - */ - public function edit($id, User $ban) { - try { - $bans = $ban->whereId($id)->first(); - return view('themes.default1.admin.helpdesk.emails.banlist.edit', compact('bans')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for editing the specified resource. + * @param type int $id + * @param type Banlist $ban + * @return type Response + */ + public function edit($id, User $ban) { + try { + $bans = $ban->whereId($id)->first(); + return view('themes.default1.admin.helpdesk.emails.banlist.edit', compact('bans')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Banlist $ban - * @param type BanlistRequest $request - * @return type Response - */ - public function update($id, User $ban, BanlistRequest $request) { - try { - $bans = $ban->whereId($id)->first(); - $bans->internal_note = $request->input('internal_note'); - $bans->ban = $request->input('ban'); - // dd($request->input('ban')); - if ($bans->save()) { - return redirect('banlist')->with('success', 'Banned Email Updated sucessfully'); - } else { - return redirect('banlist')->with('fails', 'Banned Email not Updated'); - } - } catch (Exception $e) { - return redirect('banlist')->with('fails', 'Banned Email not Updated'); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Banlist $ban + * @param type BanlistRequest $request + * @return type Response + */ + public function update($id, User $ban, BanlistRequest $request) { + try { + $bans = $ban->whereId($id)->first(); + $bans->internal_note = $request->input('internal_note'); + $bans->ban = $request->input('ban'); + // dd($request->input('ban')); + if ($bans->save()) { + return redirect('banlist')->with('success', 'Banned Email Updated sucessfully'); + } else { + return redirect('banlist')->with('fails', 'Banned Email not Updated'); + } + } catch (Exception $e) { + return redirect('banlist')->with('fails', 'Banned Email not Updated'); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Banlist $ban - * @return type Response - */ - // public function destroy($id, Banlist $ban) { - // $bans = $ban->whereId($id)->first(); - // dd($bans); - // /* Success and Falure condition */ - // try{ - // $bans->delete(); - // return redirect('banlist')->with('success', 'Banned Email Deleted sucessfully'); - // } catch (Exception $e) { - // return redirect('banlist')->with('fails', 'Banned Email can not Delete'.'
  • '.$e->errorInfo[2].'
  • '); - // } - // } + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Banlist $ban + * @return type Response + */ + // public function destroy($id, Banlist $ban) { + // $bans = $ban->whereId($id)->first(); + // dd($bans); + // /* Success and Falure condition */ + // try{ + // $bans->delete(); + // return redirect('banlist')->with('success', 'Banned Email Deleted sucessfully'); + // } catch (Exception $e) { + // return redirect('banlist')->with('fails', 'Banned Email can not Delete'.'
  • '.$e->errorInfo[2].'
  • '); + // } + // } } diff --git a/app/Http/Controllers/Admin/helpdesk/DepartmentController.php b/app/Http/Controllers/Admin/helpdesk/DepartmentController.php index dae7fd057..b6122cb21 100644 --- a/app/Http/Controllers/Admin/helpdesk/DepartmentController.php +++ b/app/Http/Controllers/Admin/helpdesk/DepartmentController.php @@ -1,4 +1,7 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return void + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Get index page - * @param type Department $department - * @return type Response - */ - public function index(Department $department) { - try { - $departments = $department->get(); - return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Get index page + * @param type Department $department + * @return type Response + */ + public function index(Department $department) { + try { + $departments = $department->get(); + return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Show the form for creating a new resource. - * @param type User $user - * @param type Group_assign_department $group_assign_department - * @param type Department $department - * @param type Sla_plan $sla - * @param type Template $template - * @param type Emails $email - * @param type Groups $group - * @return type Response - */ - 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(); - $user = $user->where('role', 'agent')->get(); - $emails = $email->get(); - $templates = $template->get(); - $department = $department->get(); - $groups = $group->lists('id', 'name'); - return view('themes.default1.admin.helpdesk.agent.departments.create', compact('department', 'templates', 'slas', 'user', 'emails', 'groups')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for creating a new resource. + * @param type User $user + * @param type Group_assign_department $group_assign_department + * @param type Department $department + * @param type Sla_plan $sla + * @param type Template $template + * @param type Emails $email + * @param type Groups $group + * @return type Response + */ + 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(); + $user = $user->where('role', 'agent')->get(); + $emails = $email->get(); + $templates = $template->get(); + $department = $department->get(); + $groups = $group->lists('id', 'name'); + return view('themes.default1.admin.helpdesk.agent.departments.create', compact('department', 'templates', 'slas', 'user', 'emails', 'groups')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type Department $department - * @param type DepartmentRequest $request - * @return type Response - */ - public function store(Department $department, DepartmentRequest $request) { - try { - $department->fill($request->except('group_id','manager'))->save(); - $requests = $request->input('group_id'); - $id = $department->id; - if($request->manager) { - $department->manager = $request->input('manager'); - } else { - $department->manager = null; - } - // foreach ($requests as $req) { - // DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]); - // } - /* Succes And Failure condition */ - /* Check Whether the function Success or Fail */ - if ($department->save() == true) { - return redirect('departments')->with('success', 'Department Created sucessfully'); - } else { - return redirect('departments')->with('fails', 'Department can not Create'); - } - } catch (Exception $e) { - return redirect('departments')->with('fails', 'Department can not Create'); - } - } + /** + * Store a newly created resource in storage. + * @param type Department $department + * @param type DepartmentRequest $request + * @return type Response + */ + public function store(Department $department, DepartmentRequest $request) { + try { + $department->fill($request->except('group_id', 'manager'))->save(); + $requests = $request->input('group_id'); + $id = $department->id; + if ($request->manager) { + $department->manager = $request->input('manager'); + } else { + $department->manager = null; + } + // foreach ($requests as $req) { + // DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]); + // } + /* Succes And Failure condition */ + /* Check Whether the function Success or Fail */ + if ($department->save() == true) { + return redirect('departments')->with('success', 'Department Created sucessfully'); + } else { + return redirect('departments')->with('fails', 'Department can not Create'); + } + } catch (Exception $e) { + return redirect('departments')->with('fails', 'Department can not Create'); + } + } - /** - * Show the form for editing the specified resource. - * @param type int $id - * @param type User $user - * @param type Group_assign_department $group_assign_department - * @param type Template $template - * @param type Teams $team - * @param type Department $department - * @param type Sla_plan $sla - * @param type Emails $email - * @param type Groups $group - * @return type Response - */ - public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) { - try { - $slas = $sla->get(); - $user = $user->where('role', 'agent')->get(); - $emails = $email->get(); - $templates = $template->get(); - $departments = $department->whereId($id)->first(); - $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')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for editing the specified resource. + * @param type int $id + * @param type User $user + * @param type Group_assign_department $group_assign_department + * @param type Template $template + * @param type Teams $team + * @param type Department $department + * @param type Sla_plan $sla + * @param type Emails $email + * @param type Groups $group + * @return type Response + */ + public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) { + try { + $slas = $sla->get(); + $user = $user->where('role', 'agent')->get(); + $emails = $email->get(); + $templates = $template->get(); + $departments = $department->whereId($id)->first(); + $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')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Group_assign_department $group_assign_department - * @param type Department $department - * @param type DepartmentUpdate $request - * @return type Response - */ - public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) { - // dd($id); - try { - $table = $group_assign_department->where('department_id', $id); - $table->delete(); - $requests = $request->input('group_id'); - // foreach ($requests as $req) { - // DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]); - // } - $departments = $department->whereId($id)->first(); + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Group_assign_department $group_assign_department + * @param type Department $department + * @param type DepartmentUpdate $request + * @return type Response + */ + public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) { + // dd($id); + try { + $table = $group_assign_department->where('department_id', $id); + $table->delete(); + $requests = $request->input('group_id'); + // foreach ($requests as $req) { + // DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]); + // } + $departments = $department->whereId($id)->first(); - if($request->manager) { - $departments->manager = $request->input('manager'); - } else { - $departments->manager = null; - } - $departments->save(); + if ($request->manager) { + $departments->manager = $request->input('manager'); + } else { + $departments->manager = null; + } + $departments->save(); - if ($departments->fill($request->except('group_access','manager'))->save()) { - return redirect('departments')->with('success', 'Department Updated sucessfully'); - } else { - return redirect('departments')->with('fails', 'Department not Updated'); - } - } catch (Exception $e) { - return redirect('departments')->with('fails', 'Department not Updated'); - } - } + if ($departments->fill($request->except('group_access', 'manager'))->save()) { + return redirect('departments')->with('success', 'Department Updated sucessfully'); + } else { + return redirect('departments')->with('fails', 'Department not Updated'); + } + } catch (Exception $e) { + return redirect('departments')->with('fails', 'Department not Updated'); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Department $department - * @param type Group_assign_department $group_assign_department - * @return type Response - */ - public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) { - // try { - $system = $system->where('id','=','1')->first(); - if($system->department == $id) { - return redirect('departments')->with('fails', 'You cannot delete default department'); - } else { - $tickets = DB::table('tickets')->where('dept_id','=',$id)->update(['dept_id' => $system->department]); - if($tickets > 0){ - if($tickets > 1){ - $text_tickets = "Tickets"; - } else { - $text_tickets = "Ticket"; - } - $ticket = '
  • '.$tickets.' '.$text_tickets.' have been moved to default department
  • '; - } else { - $ticket = ""; - } - $users = DB::table('users')->where('primary_dpt','=',$id)->update(['primary_dpt' => $system->department]); - if($users > 0){ - if($users > 1){ - $text_user = "Users"; - } else { - $text_user = "User"; - } - $user = '
  • '.$users.' '.$text_user.' have been moved to default department
  • '; - } else { - $user = ""; - } - $emails = DB::table('emails')->where('department','=',$id)->update(['department' => $system->department]); - if($emails > 0){ - if($emails > 1){ - $text_emails = "Emails"; - } else { - $text_emails = "Email"; - } - $email = '
  • '.$emails.' System '.$text_emails.' have been moved to default department
  • '; - } else { - $email = ""; - } - $helptopic = DB::table('help_topic')->where('department','=',$id)->update(['department' => null],['status' => '1']); - if($helptopic > 0){ - $helptopic = '
  • The associated helptopic has been deactivated
  • '; - } else { - $helptopic = ""; - } - $message = $ticket.$user.$email.$helptopic; - /* Becouse of foreign key we delete group_assign_department first */ - $group_assign_department = $group_assign_department->where('department_id', $id); - $group_assign_department->delete(); - $departments = $department->whereId($id)->first(); - /* Check the function is Success or Fail */ - if ($departments->delete() == true) { - return redirect('departments')->with('success', 'Department Deleted sucessfully'.$message); - } else { - return redirect('departments')->with('fails', 'Department can not Delete'); - } - - } - } + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Department $department + * @param type Group_assign_department $group_assign_department + * @return type Response + */ + public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) { + // try { + $system = $system->where('id', '=', '1')->first(); + if ($system->department == $id) { + return redirect('departments')->with('fails', 'You cannot delete default department'); + } else { + $tickets = DB::table('tickets')->where('dept_id', '=', $id)->update(['dept_id' => $system->department]); + if ($tickets > 0) { + if ($tickets > 1) { + $text_tickets = "Tickets"; + } else { + $text_tickets = "Ticket"; + } + $ticket = '
  • ' . $tickets . ' ' . $text_tickets . ' have been moved to default department
  • '; + } else { + $ticket = ""; + } + $users = DB::table('users')->where('primary_dpt', '=', $id)->update(['primary_dpt' => $system->department]); + if ($users > 0) { + if ($users > 1) { + $text_user = "Users"; + } else { + $text_user = "User"; + } + $user = '
  • ' . $users . ' ' . $text_user . ' have been moved to default department
  • '; + } else { + $user = ""; + } + $emails = DB::table('emails')->where('department', '=', $id)->update(['department' => $system->department]); + if ($emails > 0) { + if ($emails > 1) { + $text_emails = "Emails"; + } else { + $text_emails = "Email"; + } + $email = '
  • ' . $emails . ' System ' . $text_emails . ' have been moved to default department
  • '; + } else { + $email = ""; + } + $helptopic = DB::table('help_topic')->where('department', '=', $id)->update(['department' => null], ['status' => '1']); + if ($helptopic > 0) { + $helptopic = '
  • The associated helptopic has been deactivated
  • '; + } else { + $helptopic = ""; + } + $message = $ticket . $user . $email . $helptopic; + /* Becouse of foreign key we delete group_assign_department first */ + $group_assign_department = $group_assign_department->where('department_id', $id); + $group_assign_department->delete(); + $departments = $department->whereId($id)->first(); + /* Check the function is Success or Fail */ + if ($departments->delete() == true) { + return redirect('departments')->with('success', 'Department Deleted sucessfully' . $message); + } else { + return redirect('departments')->with('fails', 'Department can not Delete'); + } + } + } } diff --git a/app/Http/Controllers/Admin/helpdesk/EmailsController.php b/app/Http/Controllers/Admin/helpdesk/EmailsController.php index 1b6ff2035..c8259403c 100644 --- a/app/Http/Controllers/Admin/helpdesk/EmailsController.php +++ b/app/Http/Controllers/Admin/helpdesk/EmailsController.php @@ -1,4 +1,7 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Emails $emails - * @return type Response - */ - public function index(Emails $emails) { - try { - $emails = $emails->get(); - return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Emails $emails + * @return type Response + */ + public function index(Emails $emails) { + try { + $emails = $emails->get(); + return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * 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 $priority, MailboxProtocol $mailbox_protocol) { - try { - $departments = $department->get(); - $helps = $help->get(); - $priority = $priority->get(); - $mailbox_protocols = $mailbox_protocol->get(); - return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * 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 $priority, MailboxProtocol $mailbox_protocol) { + try { + $departments = $department->get(); + $helps = $help->get(); + $priority = $priority->get(); + $mailbox_protocols = $mailbox_protocol->get(); + return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type Emails $email - * @param type EmailsRequest $request - * @return type Response - */ - public function store(Emails $email, EmailsRequest $request) { - try { - $password = $request->input('password'); - $encrypted = Crypt::encrypt($password); - $email->password = $encrypted; - if ($email->fill($request->except('password'))->save() == true) { - return redirect('emails')->with('success', 'Email Created sucessfully'); - } else { - return redirect('emails')->with('fails', 'Email can not Create'); - } - } catch (Exception $e) { - return redirect('emails')->with('fails', 'Email can not Create'); - } - } + /** + * Store a newly created resource in storage. + * @param type Emails $email + * @param type EmailsRequest $request + * @return type Response + */ + public function store(Emails $email, EmailsRequest $request) { + try { + $password = $request->input('password'); + $encrypted = Crypt::encrypt($password); + $department = $request->input('department'); + $priority = $request->input('priority'); + $help_topic = $request->input('help_topic'); - /** - * Display the specified resource. - * - * @param int $id - * @return Response - */ - public function show($id) { - // - } + if ($email->fill($request->except('password', 'department', 'priority', 'help_topic'))->save() == true) { + if ($request->input('department')) { + $email->department = $request->input('department'); + } else { + $email->department = null; + } + if ($request->input('priority')) { + $email->priority = $request->input('priority'); + } else { + $email->priority = null; + } + if ($request->input('help_topic')) { + $email->help_topic = $request->input('help_topic'); + } else { + $email->help_topic = null; + } + $email->password = $encrypted; + $email->save(); - /** - * 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 $priority, MailboxProtocol $mailbox_protocol) { - try { - $emails = $email->whereId($id)->first(); - $departments = $department->get(); - $helps = $help->get(); - $priority = $priority->get(); - $mailbox_protocols = $mailbox_protocol->get(); - return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails')); - } catch (Exception $e) { - return view('404'); - } - } + return redirect('emails')->with('success', 'Email Created sucessfully'); + } else { + return redirect('emails')->with('fails', 'Email can not Create'); + } + } catch (Exception $e) { + return redirect('emails')->with('fails', 'Email can not Create'); + } + } - /** - * Update the specified resource in storage. - * @param type $id - * @param type Emails $email - * @param type EmailsEditRequest $request - * @return type Response - */ - public function update($id, Emails $email, EmailsEditRequest $request) { - $password = $request->input('password'); - $encrypted = Crypt::encrypt($password); - //echo $encrypted; - //$value = Crypt::decrypt($encrypted); - //echo $value; - try { - $emails = $email->whereId($id)->first(); - $emails->password = $encrypted; - $emails->fill($request->except('password'))->save(); - return redirect('emails')->with('success', 'Email Updated sucessfully'); - } catch (Exception $e) { - return redirect('emails')->with('fails', 'Email not updated'); - } - } + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) { + // + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Emails $email - * @return type Response - */ - public function destroy($id, Emails $email) { - try { - $emails = $email->whereId($id)->first(); - if ($emails->delete() == true) { - return redirect('emails')->with('success', 'Email Deleted sucessfully'); - } else { - return redirect('emails')->with('fails', 'Email can not Delete '); - } - } catch (Exception $e) { - return redirect('emails')->with('fails', 'Email can not Delete '); - } - } + /** + * 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 $priority, MailboxProtocol $mailbox_protocol) { + try { + $emails = $email->whereId($id)->first(); + $departments = $department->get(); + $helps = $help->get(); + $priority = $priority->get(); + $mailbox_protocols = $mailbox_protocol->get(); + return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails')); + } catch (Exception $e) { + return view('404'); + } + } + + /** + * Update the specified resource in storage. + * @param type $id + * @param type Emails $email + * @param type EmailsEditRequest $request + * @return type Response + */ + public function update($id, Emails $email, EmailsEditRequest $request) { + $password = $request->input('password'); + $encrypted = Crypt::encrypt($password); + //echo $encrypted; + //$value = Crypt::decrypt($encrypted); + //echo $value; + try { + $emails = $email->whereId($id)->first(); + // $emails->password = $encrypted; + $emails->fill($request->except('password', 'department', 'priority', 'help_topic'))->save(); + if ($request->input('department')) { + $emails->department = $request->input('department'); + } else { + $emails->department = null; + } + if ($request->input('priority')) { + $emails->priority = $request->input('priority'); + } else { + $emails->priority = null; + } + if ($request->input('help_topic')) { + $emails->help_topic = $request->input('help_topic'); + } else { + $emails->help_topic = null; + } + $emails->password = $encrypted; + $emails->save(); + return redirect('emails')->with('success', 'Email Updated sucessfully'); + } catch (Exception $e) { + return redirect('emails')->with('fails', 'Email not updated'); + } + } + + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Emails $email + * @return type Response + */ + public function destroy($id, Emails $email) { + $default_system_email = Email::where('id', '=', '1')->first(); + if ($default_system_email->id) { + if ($id == $default_system_email->id) { + return redirect('emails')->with('fails', 'You cannot delete system default Email'); + } + } + try { + $emails = $email->whereId($id)->first(); + if ($emails->delete() == true) { + return redirect('emails')->with('success', 'Email Deleted sucessfully'); + } else { + return redirect('emails')->with('fails', 'Email can not Delete '); + } + } catch (Exception $e) { + return redirect('emails')->with('fails', 'Email can not Delete '); + } + } } diff --git a/app/Http/Controllers/Admin/helpdesk/FormController.php b/app/Http/Controllers/Admin/helpdesk/FormController.php index 5f8640ed3..4aa013c55 100644 --- a/app/Http/Controllers/Admin/helpdesk/FormController.php +++ b/app/Http/Controllers/Admin/helpdesk/FormController.php @@ -1,16 +1,15 @@ - */ class FormController extends Controller { - private $fields; + + private $fields; private $forms; - - public function __construct(Fields $fields,Forms $forms) { + public function __construct(Fields $fields, Forms $forms) { $this->fields = $fields; $this->forms = $forms; - // $this->middleware('auth'); + // $this->middleware('auth'); } /** * home * @return type */ - public function home() { + public function home() { return view('forms.home'); } @@ -49,7 +48,7 @@ class FormController extends Controller { * @return Response */ public function index(Forms $forms) { - return view('themes.default1.admin.helpdesk.manage.form.index',compact('forms')); + return view('themes.default1.admin.helpdesk.manage.form.index', compact('forms')); } /** @@ -61,70 +60,64 @@ class FormController extends Controller { } /** - * Display the specified resource. - * @param int $id - * @return Response - */ + * Display the specified resource. + * @param int $id + * @return Response + */ public function show($id) { - return view('themes.default1.admin.helpdesk.manage.form.preview',compact('id')); + return view('themes.default1.admin.helpdesk.manage.form.preview', compact('id')); } - + /** * Store a newly created resource in storage. * * @return Response */ - public function store(Forms $forms) { - if(!Input::get('formname')) { - return Redirect::back()->with('fails','Please fill Form name'); + public function store(Forms $forms) { + if (!Input::get('formname')) { + return Redirect::back()->with('fails', 'Please fill Form name'); + } + $required = Input::get('required'); + $count = count($required); + $require = array(); + for ($i = 2; $i < $count + 2; $i++) { + for ($j = 0; $j < 1; $j++) { + array_push($require, $required[$i][$j]); + } } - $required = Input::get('required'); - $count = count($required); - $require = array(); - for($i=2;$i<$count+2;$i++) { - for($j=0;$j<1;$j++) { - array_push($require,$required[$i][$j]); - } - } $forms->formname = Input::get('formname'); $forms->save(); - $count = count(Input::get('name')); + $count = count(Input::get('name')); $fields = array(); - for($i=0; $i<=$count; $i++) { - if(!empty(Input::get('name')[$i])) { - array_push($fields, array( - 'forms_id' => $forms->id, - 'label' => Input::get('label')[$i], - 'name' => Input::get('name')[$i], - 'type' => Input::get('type')[$i], - 'value' => Input::get('value')[$i], - 'required'=>$require[$i], - )); - } - } + for ($i = 0; $i <= $count; $i++) { + if (!empty(Input::get('name')[$i])) { + array_push($fields, array( + 'forms_id' => $forms->id, + 'label' => Input::get('label')[$i], + 'name' => Input::get('name')[$i], + 'type' => Input::get('type')[$i], + 'value' => Input::get('value')[$i], + 'required' => $require[$i], + )); + } + } Fields::insert($fields); - return Redirect::back()->with('success','Successfully created Form'); + return Redirect::back()->with('success', 'Successfully created Form'); } - - - public function delete($id,Forms $forms, Fields $field, Help_topic $help_topic) { - $fields = $field->where('forms_id',$id)->get(); - $help_topics = $help_topic->where('custom_form','=',$id)->get(); - foreach($help_topics as $help_topic) { + public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic) { + $fields = $field->where('forms_id', $id)->get(); + $help_topics = $help_topic->where('custom_form', '=', $id)->get(); + foreach ($help_topics as $help_topic) { $help_topic->custom_form = null; $help_topic->save(); } - foreach($fields as $field) { + foreach ($fields as $field) { $field->delete(); } - $forms = $forms->where('id',$id)->first(); + $forms = $forms->where('id', $id)->first(); $forms->delete(); return redirect()->back()->with('success', 'Deleted Successfully'); - } + } - } - - - diff --git a/app/Http/Controllers/Admin/helpdesk/GroupController.php b/app/Http/Controllers/Admin/helpdesk/GroupController.php index cec707098..139b55b54 100644 --- a/app/Http/Controllers/Admin/helpdesk/GroupController.php +++ b/app/Http/Controllers/Admin/helpdesk/GroupController.php @@ -1,4 +1,7 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type void + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Groups $group - * @param type Department $department - * @param type Group_assign_department $group_assign_department - * @return type Response - */ - public function index(Groups $group, Department $department, Group_assign_department $group_assign_department) { - try { - $groups = $group->get(); - $departments = $department->lists('id'); - return view('themes.default1.admin.helpdesk.agent.groups.index', compact('departments', 'group_assign_department', 'groups')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Groups $group + * @param type Department $department + * @param type Group_assign_department $group_assign_department + * @return type Response + */ + public function index(Groups $group, Department $department, Group_assign_department $group_assign_department) { + try { + $groups = $group->get(); + $departments = $department->lists('id'); + return view('themes.default1.admin.helpdesk.agent.groups.index', compact('departments', 'group_assign_department', 'groups')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Show the form for creating a new resource. - * @return type Response - */ - public function create() { - try { - return view('themes.default1.admin.helpdesk.agent.groups.create'); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for creating a new resource. + * @return type Response + */ + public function create() { + try { + return view('themes.default1.admin.helpdesk.agent.groups.create'); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type Groups $group - * @param type GroupRequest $request - * @return type Response - */ - public function store(Groups $group, GroupRequest $request) { - try { - /* Check Whether function success or not */ - $group->fill($request->input())->save(); - return redirect('groups')->with('success', 'Group Created Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('groups')->with('fails', 'Groups can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Store a newly created resource in storage. + * @param type Groups $group + * @param type GroupRequest $request + * @return type Response + */ + public function store(Groups $group, GroupRequest $request) { + try { + /* Check Whether function success or not */ + $group->fill($request->input())->save(); + return redirect('groups')->with('success', 'Group Created Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('groups')->with('fails', 'Groups can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Show the form for editing the specified resource. - * @param type int $id - * @param type Groups $group - * @return type Response - */ - public function edit($id, Groups $group) { - try { - $groups = $group->whereId($id)->first(); - return view('themes.default1.admin.helpdesk.agent.groups.edit', compact('groups')); - } catch (Exception $e) { - return redirect('groups')->with('fails', 'Groups can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Show the form for editing the specified resource. + * @param type int $id + * @param type Groups $group + * @return type Response + */ + public function edit($id, Groups $group) { + try { + $groups = $group->whereId($id)->first(); + return view('themes.default1.admin.helpdesk.agent.groups.edit', compact('groups')); + } catch (Exception $e) { + return redirect('groups')->with('fails', 'Groups can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Groups $group - * @param type Request $request - * @return type Response - */ - public function update($id, Groups $group, Request $request) { - $var = $group->whereId($id)->first(); - //Updating Status - $status = $request->Input('group_status'); - $var->group_status = $status; - //Updating can_create_ticket field - $createTicket = $request->Input('can_create_ticket'); - $var->can_create_ticket = $createTicket; - //Updating can_edit_ticket field - $editTicket = $request->Input('can_edit_ticket'); - $var->can_edit_ticket = $editTicket; - //Updating can_post_ticket field - $postTicket = $request->Input('can_post_ticket'); - $var->can_post_ticket = $postTicket; - //Updating can_close_ticket field - $closeTicket = $request->Input('can_close_ticket'); - $var->can_close_ticket = $closeTicket; - //Updating can_assign_ticket field - $assignTicket = $request->Input('can_assign_ticket'); - $var->can_assign_ticket = $assignTicket; - //Updating can_trasfer_ticket field - $trasferTicket = $request->Input('can_trasfer_ticket'); - $var->can_trasfer_ticket = $trasferTicket; - //Updating can_delete_ticket field - $deleteTicket = $request->Input('can_delete_ticket'); - $var->can_delete_ticket = $deleteTicket; - //Updating can_ban_email field - $banEmail = $request->Input('can_ban_email'); - $var->can_ban_email = $banEmail; - //Updating can_manage_canned field - $manageCanned = $request->Input('can_manage_canned'); - $var->can_manage_canned = $manageCanned; - //Updating can_manage_faq field - $manageFaq = $request->Input('can_manage_faq'); - $var->can_manage_faq = $manageFaq; - //Updating can_view_agent_stats field - $viewAgentStats = $request->Input('can_view_agent_stats'); - $var->can_view_agent_stats = $viewAgentStats; - //Updating department_access field - $departmentAccess = $request->Input('department_access'); - $var->department_access = $departmentAccess; - //Updating admin_notes field - $adminNotes = $request->Input('admin_notes'); - $var->admin_notes = $adminNotes; - /* Check whether function success or not */ - try { - $var->save(); - /* redirect to Index page with Success Message */ - return redirect('groups')->with('success', 'Group Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('groups')->with('fails', 'Groups can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Groups $group + * @param type Request $request + * @return type Response + */ + public function update($id, Groups $group, Request $request) { + $var = $group->whereId($id)->first(); + //Updating Status + $status = $request->Input('group_status'); + $var->group_status = $status; + //Updating can_create_ticket field + $createTicket = $request->Input('can_create_ticket'); + $var->can_create_ticket = $createTicket; + //Updating can_edit_ticket field + $editTicket = $request->Input('can_edit_ticket'); + $var->can_edit_ticket = $editTicket; + //Updating can_post_ticket field + $postTicket = $request->Input('can_post_ticket'); + $var->can_post_ticket = $postTicket; + //Updating can_close_ticket field + $closeTicket = $request->Input('can_close_ticket'); + $var->can_close_ticket = $closeTicket; + //Updating can_assign_ticket field + $assignTicket = $request->Input('can_assign_ticket'); + $var->can_assign_ticket = $assignTicket; + //Updating can_trasfer_ticket field + $trasferTicket = $request->Input('can_trasfer_ticket'); + $var->can_trasfer_ticket = $trasferTicket; + //Updating can_delete_ticket field + $deleteTicket = $request->Input('can_delete_ticket'); + $var->can_delete_ticket = $deleteTicket; + //Updating can_ban_email field + $banEmail = $request->Input('can_ban_email'); + $var->can_ban_email = $banEmail; + //Updating can_manage_canned field + $manageCanned = $request->Input('can_manage_canned'); + $var->can_manage_canned = $manageCanned; + //Updating can_manage_faq field + $manageFaq = $request->Input('can_manage_faq'); + $var->can_manage_faq = $manageFaq; + //Updating can_view_agent_stats field + $viewAgentStats = $request->Input('can_view_agent_stats'); + $var->can_view_agent_stats = $viewAgentStats; + //Updating department_access field + $departmentAccess = $request->Input('department_access'); + $var->department_access = $departmentAccess; + //Updating admin_notes field + $adminNotes = $request->Input('admin_notes'); + $var->admin_notes = $adminNotes; + /* Check whether function success or not */ + try { + $var->save(); + /* redirect to Index page with Success Message */ + return redirect('groups')->with('success', 'Group Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('groups')->with('fails', 'Groups can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Groups $group + * @param type Group_assign_department $group_assign_department + * @return type Response + */ + public function destroy($id, Groups $group, Group_assign_department $group_assign_department) { + $users = User::where('assign_group', '=', $id)->first(); + if ($users) { + $user = '
  • There are agents assigned to this group. Please unassign them from this group to delete
  • '; + return redirect('groups')->with('fails', 'Group cannot Delete ' . $user); + } + $group_assign_department->where('group_id', $id)->delete(); + $groups = $group->whereId($id)->first(); + /* Check whether function success or not */ + try { + $groups->delete(); + /* redirect to Index page with Success Message */ + return redirect('groups')->with('success', 'Group Deleted Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('groups')->with('fails', 'Groups cannot Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Groups $group - * @param type Group_assign_department $group_assign_department - * @return type Response - */ - public function destroy($id, Groups $group, Group_assign_department $group_assign_department) { - $users = User::where('assign_group', '=', $id)->first(); - if($users){ - $user = '
  • There are agents assigned to this group. Please unassign them from this group to delete
  • '; - return redirect('groups')->with('fails', 'Group cannot Delete ' . $user); - } - $group_assign_department->where('group_id', $id)->delete(); - $groups = $group->whereId($id)->first(); - /* Check whether function success or not */ - try { - $groups->delete(); - /* redirect to Index page with Success Message */ - return redirect('groups')->with('success', 'Group Deleted Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('groups')->with('fails', 'Groups cannot Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } } diff --git a/app/Http/Controllers/Admin/helpdesk/HelptopicController.php b/app/Http/Controllers/Admin/helpdesk/HelptopicController.php index e79e011a8..c223b8965 100644 --- a/app/Http/Controllers/Admin/helpdesk/HelptopicController.php +++ b/app/Http/Controllers/Admin/helpdesk/HelptopicController.php @@ -1,4 +1,7 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type vodi + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Help_topic $topic - * @return type Response - */ - public function index(Help_topic $topic) { - try { - $topics = $topic->get(); - return view('themes.default1.admin.helpdesk.manage.helptopic.index', compact('topics')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Help_topic $topic + * @return type Response + */ + public function index(Help_topic $topic) { + try { + $topics = $topic->get(); + return view('themes.default1.admin.helpdesk.manage.helptopic.index', compact('topics')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Show the form for creating a new resource. - * @param type Priority $priority - * @param type Department $department - * @param type Help_topic $topic - * @param type Form_name $form - * @param type Agents $agent - * @param type Sla_plan $sla - * @return type Response - */ - /* - ================================================ - | Route to Create view file passing Model Values - | 1.Department Model - | 2.Help_topic Model - | 3.Agents Model - | 4.Sla_plan Model - | 5.Forms Model - ================================================ - */ - public function create(Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, User $agent, Sla_plan $sla) { - try { - $departments = $department->get(); - $topics = $topic->get(); - $forms = $form->get(); - $agents = $agent->where('role','=','agent')->get(); - $slas = $sla->get(); - $priority = $priority->get(); - return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for creating a new resource. + * @param type Priority $priority + * @param type Department $department + * @param type Help_topic $topic + * @param type Form_name $form + * @param type Agents $agent + * @param type Sla_plan $sla + * @return type Response + */ + /* + ================================================ + | Route to Create view file passing Model Values + | 1.Department Model + | 2.Help_topic Model + | 3.Agents Model + | 4.Sla_plan Model + | 5.Forms Model + ================================================ + */ + public function create(Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, User $agent, Sla_plan $sla) { + try { + $departments = $department->get(); + $topics = $topic->get(); + $forms = $form->get(); + $agents = $agent->where('role', '=', 'agent')->get(); + $slas = $sla->get(); + $priority = $priority->get(); + return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type Help_topic $topic - * @param type HelptopicRequest $request - * @return type Response - */ - public function store(Help_topic $topic, HelptopicRequest $request) { - try { - if($request->custom_form){ - $custom_form = $request->custom_form; - } else { - $custom_form = null; - } - if($request->auto_assign){ - $auto_assign = $request->auto_assign; - } else { - $auto_assign = null; - } - /* Check whether function success or not */ - $topic->fill($request->except('custom_form','auto_assign'))->save(); - // $topics->fill($request->except('custom_form','auto_assign'))->save(); - /* redirect to Index page with Success Message */ - return redirect('helptopic')->with('success', 'Helptopic Created Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('helptopic')->with('fails', 'Helptopic can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Store a newly created resource in storage. + * @param type Help_topic $topic + * @param type HelptopicRequest $request + * @return type Response + */ + public function store(Help_topic $topic, HelptopicRequest $request) { + try { + if ($request->custom_form) { + $custom_form = $request->custom_form; + } else { + $custom_form = null; + } + if ($request->auto_assign) { + $auto_assign = $request->auto_assign; + } else { + $auto_assign = null; + } + /* Check whether function success or not */ + $topic->fill($request->except('custom_form', 'auto_assign'))->save(); + // $topics->fill($request->except('custom_form','auto_assign'))->save(); + /* redirect to Index page with Success Message */ + return redirect('helptopic')->with('success', 'Helptopic Created Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('helptopic')->with('fails', 'Helptopic can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Show the form for editing the specified resource. - * @param type $id - * @param type Priority $priority - * @param type Department $department - * @param type Help_topic $topic - * @param type Form_name $form - * @param type Agents $agent - * @param type Sla_plan $sla - * @return type Response - */ - public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla) { - try { - $agents = User::where('role','=','agent')->get(); - $departments = $department->get(); - $topics = $topic->whereId($id)->first(); - $forms = $form->get(); - $slas = $sla->get(); - $priority = $priority->get(); - return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas')); - } catch (Exception $e) { - return redirect('helptopic')->with('fails', '
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Show the form for editing the specified resource. + * @param type $id + * @param type Priority $priority + * @param type Department $department + * @param type Help_topic $topic + * @param type Form_name $form + * @param type Agents $agent + * @param type Sla_plan $sla + * @return type Response + */ + public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla) { + try { + $agents = User::where('role', '=', 'agent')->get(); + $departments = $department->get(); + $topics = $topic->whereId($id)->first(); + $forms = $form->get(); + $slas = $sla->get(); + $priority = $priority->get(); + return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas')); + } catch (Exception $e) { + return redirect('helptopic')->with('fails', '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type $id - * @param type Help_topic $topic - * @param type HelptopicUpdate $request - * @return type Response - */ - public function update($id, Help_topic $topic, HelptopicUpdate $request) { - // dd($request); - try { - $topics = $topic->whereId($id)->first(); - if($request->custom_form){ - $custom_form = $request->custom_form; - } else { - $custom_form = null; - } - if($request->auto_assign){ - $auto_assign = $request->auto_assign; - } else { - $auto_assign = null; - } - /* Check whether function success or not */ - $topics->fill($request->except('custom_form','auto_assign'))->save(); - $topics->custom_form = $custom_form; - $topics->auto_assign = $auto_assign; - $topics->save(); - /* redirect to Index page with Success Message */ - return redirect('helptopic')->with('success', 'Helptopic Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('helptopic')->with('fails', 'Helptopic can not Update'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified resource in storage. + * @param type $id + * @param type Help_topic $topic + * @param type HelptopicUpdate $request + * @return type Response + */ + public function update($id, Help_topic $topic, HelptopicUpdate $request) { + // dd($request); + try { + $topics = $topic->whereId($id)->first(); + if ($request->custom_form) { + $custom_form = $request->custom_form; + } else { + $custom_form = null; + } + if ($request->auto_assign) { + $auto_assign = $request->auto_assign; + } else { + $auto_assign = null; + } + /* Check whether function success or not */ + $topics->fill($request->except('custom_form', 'auto_assign'))->save(); + $topics->custom_form = $custom_form; + $topics->auto_assign = $auto_assign; + $topics->save(); + /* redirect to Index page with Success Message */ + return redirect('helptopic')->with('success', 'Helptopic Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('helptopic')->with('fails', 'Helptopic can not Update' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Help_topic $topic - * @return type Response - */ - public function destroy($id, Help_topic $topic, Ticket $ticket_setting) { - $ticket_settings = $ticket_setting->where('id','=','1')->first(); - if($ticket_settings->help_topic == $id) { - return redirect('departments')->with('fails', 'You cannot delete default department'); - } else { + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Help_topic $topic + * @return type Response + */ + public function destroy($id, Help_topic $topic, Ticket $ticket_setting) { + $ticket_settings = $ticket_setting->where('id', '=', '1')->first(); + if ($ticket_settings->help_topic == $id) { + return redirect('departments')->with('fails', 'You cannot delete default department'); + } else { - $tickets = DB::table('tickets')->where('help_topic_id','=',$id)->update(['help_topic_id' => $ticket_settings->help_topic]); + $tickets = DB::table('tickets')->where('help_topic_id', '=', $id)->update(['help_topic_id' => $ticket_settings->help_topic]); - if($tickets > 0){ - if($tickets > 1){ - $text_tickets = "Tickets"; - } else { - $text_tickets = "Ticket"; - } - $ticket = '
  • '.$tickets.' '.$text_tickets.' have been moved to default Help Topic
  • '; - } else { - $ticket = ""; - } + if ($tickets > 0) { + if ($tickets > 1) { + $text_tickets = "Tickets"; + } else { + $text_tickets = "Ticket"; + } + $ticket = '
  • ' . $tickets . ' ' . $text_tickets . ' have been moved to default Help Topic
  • '; + } else { + $ticket = ""; + } - $emails = DB::table('emails')->where('help_topic','=',$id)->update(['help_topic' => $ticket_settings->help_topic]); + $emails = DB::table('emails')->where('help_topic', '=', $id)->update(['help_topic' => $ticket_settings->help_topic]); - if($emails > 0){ - if($emails > 1){ - $text_emails = "Emails"; - } else { - $text_emails = "Email"; - } - $email = '
  • '.$emails.' System '.$text_emails.' have been moved to default Help Topic
  • '; - } else { - $email = ""; - } + if ($emails > 0) { + if ($emails > 1) { + $text_emails = "Emails"; + } else { + $text_emails = "Email"; + } + $email = '
  • ' . $emails . ' System ' . $text_emails . ' have been moved to default Help Topic
  • '; + } else { + $email = ""; + } - $message = $ticket.$email; + $message = $ticket . $email; + + $topics = $topic->whereId($id)->first(); + /* Check whether function success or not */ + try { + $topics->delete(); + /* redirect to Index page with Success Message */ + return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully' . $message); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('helptopic')->with('fails', 'Helptopic can not Delete' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + } - $topics = $topic->whereId($id)->first(); - /* Check whether function success or not */ - try{ - $topics->delete(); - /* redirect to Index page with Success Message */ - return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully'.$message); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('helptopic')->with('fails', 'Helptopic can not Delete'.'
  • '.$e->errorInfo[2].'
  • '); - } - } - } } diff --git a/app/Http/Controllers/Admin/helpdesk/HomeController.php b/app/Http/Controllers/Admin/helpdesk/HomeController.php index b28af7b62..7a2744c8d 100644 --- a/app/Http/Controllers/Admin/helpdesk/HomeController.php +++ b/app/Http/Controllers/Admin/helpdesk/HomeController.php @@ -1,4 +1,6 @@ -middleware('auth'); - } + /** + * Create a new controller instance. + * @return void + */ + public function __construct() { + $this->middleware('auth'); + } - /** - * Show the application dashboard to the user. - * - * @return Response - */ - public function index() { - return view('themes/default1/admin/dashboard'); - } + /** + * Show the application dashboard to the user. + * + * @return Response + */ + public function index() { + return view('themes/default1/admin/dashboard'); + } } diff --git a/app/Http/Controllers/Admin/helpdesk/LanguageController.php b/app/Http/Controllers/Admin/helpdesk/LanguageController.php index 520d754f5..c7a178bdd 100644 --- a/app/Http/Controllers/Admin/helpdesk/LanguageController.php +++ b/app/Http/Controllers/Admin/helpdesk/LanguageController.php @@ -1,4 +1,7 @@ -setLocale($lang); + //if(Cache::has('language')) + //{ + // return Cache::get('language'); + //} else return 'false'; + // Cache::put('language',$) + $path = '../resources/lang'; // Path to check available language packages + if (array_key_exists($lang, Config::get('languages')) && in_array($lang, scandir($path))) { + // dd(array_key_exists($lang, Config::get('languages'))); + // app()->setLocale($lang); - Cache::forever('language', $lang); - // dd(Cache::get('language')); - // dd() - } else { - return Redirect::back()->with('fails', Lang::get("lang.language-error")); - } - return Redirect::back(); + Cache::forever('language', $lang); + // dd(Cache::get('language')); + // dd() + } else { + return Redirect::back()->with('fails', Lang::get("lang.language-error")); } - - + return Redirect::back(); + } /** - *Shows language page - *@return type response + * Shows language page + * @return type response */ - public function index(){ + public function index() { return view('themes.default1.admin.helpdesk.language.index'); } - /** - *Shows Language upload form - *@return type response + * Shows Language upload form + * @return type response */ - public function getForm(){ + public function getForm() { return view('themes.default1.admin.helpdesk.language.create'); } - /** - *Provide language datatable to language page - *@return type + * Provide language datatable to language page + * @return type */ - public function getLanguages() - { + public function getLanguages() { $path = '../resources/lang'; $values = scandir($path); //Extracts names of directories present in lang directory $values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..' return \Datatable::collection(new Collection($values)) - - ->addColumn('language', function($model){ - return Config::get('languages.'.$model); - }) - - ->addColumn('id', function($model){ - return $model; - }) - - ->addColumn('status',function($model){ - if(Lang::getLocale()===$model){return "".Lang::trans("lang.active").""; } else return "".Lang::trans("lang.inactive").""; - }) - - ->addColumn('Action', function($model){ - if(Lang::getLocale()===$model){ - return " - ". Lang::trans("lang.delete").""; - } else { - return " - ". Lang::trans("lang.delete").""; - } - }) - ->searchColumns('language','id') - - ->make(); + ->addColumn('language', function($model) { + return Config::get('languages.' . $model); + }) + ->addColumn('id', function($model) { + return $model; + }) + ->addColumn('status', function($model) { + if (Lang::getLocale() === $model) { + return "" . Lang::trans("lang.active") . ""; + } else + return "" . Lang::trans("lang.inactive") . ""; + }) + ->addColumn('Action', function($model) { + if (Lang::getLocale() === $model) { + return " + " . Lang::trans("lang.delete") . ""; + } else { + return " + " . Lang::trans("lang.delete") . ""; + } + }) + ->searchColumns('language', 'id') + ->make(); } - /** - *handle language file uploading - *@return response + * handle language file uploading + * @return response */ public function postForm() { // getting all of the post data $file = array( - 'File' => Input::file('File'), - 'language-name' => Input::input('language-name'), - 'iso-code' => Input::input('iso-code') - ); - + 'File' => Input::file('File'), + 'language-name' => Input::input('language-name'), + 'iso-code' => Input::input('iso-code') + ); + // setting up rules - $rules = array( - 'File' => 'required|mimes:zip|max:30000', - 'language-name' => 'required', - 'iso-code' => 'required|max:2' - ); // and for max size - + $rules = array( + 'File' => 'required|mimes:zip|max:30000', + 'language-name' => 'required', + 'iso-code' => 'required|max:2' + ); // and for max size // doing the validation, passing post data, rules and the messages $validator = Validator::make($file, $rules); if ($validator->fails()) { - + // send back to the page with the input data and errors return Redirect::back()->withInput()->withErrors($validator); - } else { - - + + //Checking if package already exists or not in lang folder $path = '../resources/lang'; if (in_array(strtolower(Input::get('iso-code')), scandir($path))) { - + //sending back with error message Session::flash('fails', Lang::get('lang.package_exist')); - Session::flash('link',"change-language/".strtolower(Input::get('iso-code'))); + Session::flash('link', "change-language/" . strtolower(Input::get('iso-code'))); return Redirect::back()->withInput(); - - } elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))){//Checking Valid ISO code form Languages.php - + } elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php //sending back with error message Session::flash('fails', Lang::get('lang.iso-code-error')); return Redirect::back()->withInput(); - } else { - + // checking file is valid. if (Input::file('File')->isValid()) { $name = Input::file('File')->getClientOriginalName(); //uploaded file's original name $destinationPath = '../public/uploads/'; // defining uploading path - $extractpath = '../resources/lang/'.strtolower(Input::get('iso-code'));//defining extracting path + $extractpath = '../resources/lang/' . strtolower(Input::get('iso-code')); //defining extracting path mkdir($extractpath); //creating directroy for extracting uploadd file //mkdir($destinationPath); Input::file('File')->move($destinationPath, $name); // uploading file to given path - \Zipper::make($destinationPath.'/'.$name)->extractTo($extractpath);//extracting file to give path - + \Zipper::make($destinationPath . '/' . $name)->extractTo($extractpath); //extracting file to give path //check if Zip extract foldercontains any subfolder $directories = File::directories($extractpath); //$directories = glob($extractpath. '/*' , GLOB_ONLYDIR); - if(!empty($directories)){ //if extract folder contains subfolder + if (!empty($directories)) { //if extract folder contains subfolder $success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang //$success2 = File::delete($destinationPath.'/'.$name); - if($success){ + if ($success) { //sending back with error message Session::flash('fails', Lang::get('lang.zipp-error')); - Session::flash('link2',"http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages"); - return Redirect::back()->withInput(); - } + Session::flash('link2', "http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages"); + return Redirect::back()->withInput(); + } } else { - // sending back with success message - Session::flash('success', Lang::get("lang.upload-success")); - Session::flash('link',"change-language/".strtolower(Input::get('iso-code'))); - return Redirect::route('LanguageController'); + // sending back with success message + Session::flash('success', Lang::get("lang.upload-success")); + Session::flash('link', "change-language/" . strtolower(Input::get('iso-code'))); + return Redirect::route('LanguageController'); } } else { // sending back with error message. @@ -204,8 +193,8 @@ class LanguageController extends Controller { } /** - *allow user to download language template file - *@return type + * allow user to download language template file + * @return type */ Public function download() { return response()->download('../public/downloads/en.zip'); @@ -216,23 +205,24 @@ class LanguageController extends Controller { * @param type $lang * @return type response */ - public function deleteLanguage($lang){ - if($lang !== App::getLocale()){ - $deletePath = '../resources/lang/'.$lang; //define file path to delete + public function deleteLanguage($lang) { + if ($lang !== App::getLocale()) { + $deletePath = '../resources/lang/' . $lang; //define file path to delete $success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang - if($success) { + if ($success) { //sending back with success message Session::flash('success', Lang::get('lang.delete-success')); - return Redirect::back(); + return Redirect::back(); } else { //sending back with error message Session::flash('fails', Lang::get('lang.lang-doesnot-exist')); - return Redirect::back(); + return Redirect::back(); } } else { //sending back with error message Session::flash('fails', Lang::get('lang.active-lang-error')); - return redirect('languages'); + return redirect('languages'); } } + } diff --git a/app/Http/Controllers/Admin/helpdesk/ProfileController.php b/app/Http/Controllers/Admin/helpdesk/ProfileController.php index 157d97209..cb34fb0eb 100644 --- a/app/Http/Controllers/Admin/helpdesk/ProfileController.php +++ b/app/Http/Controllers/Admin/helpdesk/ProfileController.php @@ -1,4 +1,7 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type void + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Get profile page - * @return type Response - */ - public function getProfile() { - try { - $user = Auth::user(); - if ($user) { - return view('themes.default1.agent.helpdesk.user.profile', compact('user')); - } else { - return redirect('404'); - } - } catch (Exception $e) { - return redirect('404'); - } - } + /** + * Get profile page + * @return type Response + */ + public function getProfile() { + try { + $user = Auth::user(); + if ($user) { + return view('themes.default1.agent.helpdesk.user.profile', compact('user')); + } else { + return redirect('404'); + } + } catch (Exception $e) { + return redirect('404'); + } + } - /** - * Get profile Edit page - * @return type Response - */ - public function getProfileedit() { - try { - $user = Auth::user(); - if ($user) { - return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')); - } else { - return redirect('404'); - } - } catch (Exception $e) { - return redirect('404'); - } - } + /** + * Get profile Edit page + * @return type Response + */ + public function getProfileedit() { + try { + $user = Auth::user(); + if ($user) { + return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')); + } else { + return redirect('404'); + } + } catch (Exception $e) { + return redirect('404'); + } + } - /** - * Post profile page - * @param type int $id - * @param type ProfileRequest $request - * @return type Response - */ - public function postProfile($id, ProfileRequest $request) { - $user = Auth::user(); - $user->gender = $request->input('gender'); - $user->save(); - if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') { - if ($request->input('gender') == 1) { - $name = 'avatar5.png'; - $destinationPath = 'lb-faveo/profilepic'; - $user->profile_pic = $name; - } elseif ($request->input('gender') == 0) { - $name = 'avatar2.png'; - $destinationPath = 'lb-faveo/profilepic'; - $user->profile_pic = $name; - } - } - if (Input::file('profile_pic')) { - //$extension = Input::file('profile_pic')->getClientOriginalExtension(); - $name = Input::file('profile_pic')->getClientOriginalName(); - $destinationPath = 'lb-faveo/profilepic'; - $fileName = rand(0000, 9999) . '.' . $name; - //echo $fileName; - Input::file('profile_pic')->move($destinationPath, $fileName); - $user->profile_pic = $fileName; - } else { - $user->fill($request->except('profile_pic', 'gender'))->save(); - return redirect('guest')->with('success', 'Profile Updated sucessfully'); - } - if ($user->fill($request->except('profile_pic'))->save()) { - return redirect('guest')->with('success', 'Profile Updated sucessfully'); - } - } + /** + * Post profile page + * @param type int $id + * @param type ProfileRequest $request + * @return type Response + */ + public function postProfile($id, ProfileRequest $request) { + $user = Auth::user(); + $user->gender = $request->input('gender'); + $user->save(); + if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') { + if ($request->input('gender') == 1) { + $name = 'avatar5.png'; + $destinationPath = 'lb-faveo/profilepic'; + $user->profile_pic = $name; + } elseif ($request->input('gender') == 0) { + $name = 'avatar2.png'; + $destinationPath = 'lb-faveo/profilepic'; + $user->profile_pic = $name; + } + } + if (Input::file('profile_pic')) { + //$extension = Input::file('profile_pic')->getClientOriginalExtension(); + $name = Input::file('profile_pic')->getClientOriginalName(); + $destinationPath = 'lb-faveo/profilepic'; + $fileName = rand(0000, 9999) . '.' . $name; + //echo $fileName; + Input::file('profile_pic')->move($destinationPath, $fileName); + $user->profile_pic = $fileName; + } else { + $user->fill($request->except('profile_pic', 'gender'))->save(); + return redirect('guest')->with('success', 'Profile Updated sucessfully'); + } + if ($user->fill($request->except('profile_pic'))->save()) { + return redirect('guest')->with('success', 'Profile Updated sucessfully'); + } + } + + /** + * Post Profile password page + * @param type int $id + * @param type User $user + * @param type ProfilePassword $request + * @return type Response + */ + public function postProfilePassword($id, User $user, ProfilePassword $request) { + $user = Auth::user(); + //echo $user->password; + if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { + $user->password = Hash::make($request->input('new_password')); + $user->save(); + return redirect('guest')->with('success', 'Password Updated sucessfully'); + } else { + return redirect('guest')->with('fails', 'Password was not Updated'); + } + } - /** - * Post Profile password page - * @param type int $id - * @param type User $user - * @param type ProfilePassword $request - * @return type Response - */ - public function postProfilePassword($id, User $user, ProfilePassword $request) { - $user = Auth::user(); - //echo $user->password; - if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { - $user->password = Hash::make($request->input('new_password')); - $user->save(); - return redirect('guest')->with('success', 'Password Updated sucessfully'); - } else { - return redirect('guest')->with('fails', 'Password was not Updated'); - } - } } diff --git a/app/Http/Controllers/Admin/helpdesk/SettingsController.php b/app/Http/Controllers/Admin/helpdesk/SettingsController.php index 4b3e18aea..1c9b1c49f 100644 --- a/app/Http/Controllers/Admin/helpdesk/SettingsController.php +++ b/app/Http/Controllers/Admin/helpdesk/SettingsController.php @@ -1,4 +1,7 @@ -smtp(); - $this->middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return void + */ + public function __construct() { + // $this->smtp(); + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Main Settings Page - * @return type view - */ + /** + * Main Settings Page + * @return type view + */ public function settings() { - return view('themes.default1.admin.helpdesk.setting'); - } -public function RatingSettings() { - $ratings = DB::table('settings_ratings')->get(); - - return view('themes.default1.admin.helpdesk.settings.ratings',compact('ratings')); - } - public function PostRatingSettings($slug) { - $name = Input::get('rating_name'); - $publish = Input::get('publish'); - $modify = Input::get('modify'); - - DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name,'publish' => $publish, 'modify' => $modify)); - - return redirect()->back()->with('success', 'Successfully updated'); - } - public function RatingDelete($slug) { - DB::table('settings_ratings')->whereSlug($slug)->delete(); - - return redirect()->back()->with('success', 'Successfully Deleted'); - } - /** - * @param int $id - * @return Response - * @param $compant instance of company table - * - * get the form for company setting page - */ - public function getcompany(Company $company) { - try { - /* fetch the values of company from company table */ - $companys = $company->whereId('1')->first(); - /* Direct to Company Settings Page */ - return view('themes.default1.admin.helpdesk.settings.company', compact('companys')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + return view('themes.default1.admin.helpdesk.setting'); + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Company $company - * @param type CompanyRequest $request - * @return Response - */ - public function postcompany($id, Company $company, CompanyRequest $request) { - /* fetch the values of company request */ - $companys = $company->whereId('1')->first(); - if (Input::file('logo')) { - $name = Input::file('logo')->getClientOriginalName(); - $destinationPath = 'lb-faveo/media/company/'; - $fileName = rand(0000, 9999) . '.' . $name; - Input::file('logo')->move($destinationPath, $fileName); - $companys->logo = $fileName; - } - if($request->input('use_logo')==null) { - $companys->use_logo = '0'; - } - /* Check whether function success or not */ - try { - $companys->fill($request->except('logo'))->save(); - /* redirect to Index page with Success Message */ - return redirect('getcompany')->with('success', 'Company Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getcompany')->with('fails', 'Company can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * @param int $id + * @return Response + * @param $compant instance of company table + * + * get the form for company setting page + */ + public function getcompany(Company $company) { + try { + /* fetch the values of company from company table */ + $companys = $company->whereId('1')->first(); + /* Direct to Company Settings Page */ + return view('themes.default1.admin.helpdesk.settings.company', compact('companys')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * get the form for System setting page - * @param type System $system - * @param type Department $department - * @param type Timezones $timezone - * @param type Date_format $date - * @param type Date_time_format $date_time - * @param type Time_format $time - * @return type Response - */ - public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time) { - try { - /* fetch the values of system from system table */ - $systems = $system->whereId('1')->first(); - /* Fetch the values from Department table */ - $departments = $department->get(); - /* Fetch the values from Timezones table */ - $timezones = $timezone->get(); - /* Direct to System Settings Page */ - return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Company $company + * @param type CompanyRequest $request + * @return Response + */ + public function postcompany($id, Company $company, CompanyRequest $request) { + /* fetch the values of company request */ + $companys = $company->whereId('1')->first(); + if (Input::file('logo')) { + $name = Input::file('logo')->getClientOriginalName(); + $destinationPath = 'lb-faveo/media/company/'; + $fileName = rand(0000, 9999) . '.' . $name; + Input::file('logo')->move($destinationPath, $fileName); + $companys->logo = $fileName; + } + if ($request->input('use_logo') == null) { + $companys->use_logo = '0'; + } + /* Check whether function success or not */ + try { + $companys->fill($request->except('logo'))->save(); + /* redirect to Index page with Success Message */ + return redirect('getcompany')->with('success', 'Company Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getcompany')->with('fails', 'Company can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type System $system - * @param type SystemRequest $request - * @return type Response - */ - public function postsystem($id, System $system, SystemRequest $request) { - try { - // dd($request); - /* fetch the values of system request */ - $systems = $system->whereId('1')->first(); - /* fill the values to coompany table */ - /* Check whether function success or not */ - $systems->fill($request->input())->save(); - /* redirect to Index page with Success Message */ - return redirect('getsystem')->with('success', 'System Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getsystem')->with('fails', 'System can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * get the form for System setting page + * @param type System $system + * @param type Department $department + * @param type Timezones $timezone + * @param type Date_format $date + * @param type Date_time_format $date_time + * @param type Time_format $time + * @return type Response + */ + public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time) { + try { + /* fetch the values of system from system table */ + $systems = $system->whereId('1')->first(); + /* Fetch the values from Department table */ + $departments = $department->get(); + /* Fetch the values from Timezones table */ + $timezones = $timezone->get(); + /* Direct to System Settings Page */ + return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * get the form for Ticket setting page - * @param type Ticket $ticket - * @param type Sla_plan $sla - * @param type Help_topic $topic - * @param type Priority $priority - * @return type Response - */ - public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority) { - try { - /* fetch the values of ticket from ticket table */ - $tickets = $ticket->whereId('1')->first(); - /* Fetch the values from SLA Plan table */ - $slas = $sla->get(); - /* Fetch the values from Help_topic table */ - $topics = $topic->get(); - /* Direct to Ticket Settings Page */ - return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type System $system + * @param type SystemRequest $request + * @return type Response + */ + public function postsystem($id, System $system, SystemRequest $request) { + try { + // dd($request); + /* fetch the values of system request */ + $systems = $system->whereId('1')->first(); + /* fill the values to coompany table */ + /* Check whether function success or not */ + $systems->fill($request->input())->save(); + /* redirect to Index page with Success Message */ + return redirect('getsystem')->with('success', 'System Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getsystem')->with('fails', 'System can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Ticket $ticket - * @param type Request $request - * @return type Response - */ - public function postticket($id, Ticket $ticket, Request $request) { - try { - /* fetch the values of ticket request */ - $tickets = $ticket->whereId('1')->first(); - /* fill the values to coompany table */ - $tickets->fill($request->except('captcha', 'claim_response', 'assigned_ticket', 'answered_ticket', 'agent_mask', 'html', 'client_update'))->save(); - /* insert checkbox to Database */ - $tickets->captcha = $request->input('captcha'); - $tickets->claim_response = $request->input('claim_response'); - $tickets->assigned_ticket = $request->input('assigned_ticket'); - $tickets->answered_ticket = $request->input('answered_ticket'); - $tickets->agent_mask = $request->input('agent_mask'); - $tickets->html = $request->input('html'); - $tickets->client_update = $request->input('client_update'); - /* Check whether function success or not */ - $tickets->save(); - /* redirect to Index page with Success Message */ - return redirect('getticket')->with('success', 'Ticket Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getticket')->with('fails', 'Ticket can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * get the form for Ticket setting page + * @param type Ticket $ticket + * @param type Sla_plan $sla + * @param type Help_topic $topic + * @param type Priority $priority + * @return type Response + */ + public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority) { + try { + /* fetch the values of ticket from ticket table */ + $tickets = $ticket->whereId('1')->first(); + /* Fetch the values from SLA Plan table */ + $slas = $sla->get(); + /* Fetch the values from Help_topic table */ + $topics = $topic->get(); + /* Direct to Ticket Settings Page */ + return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * get the form for Email setting page - * @param type Email $email - * @param type Template $template - * @param type Emails $email1 - * @return type Response - */ - public function getemail(Email $email, Template $template, Emails $email1) { - try { - /* fetch the values of email from Email table */ - $emails = $email->whereId('1')->first(); - /* Fetch the values from Template table */ - $templates = $template->get(); - /* Fetch the values from Emails table */ - $emails1 = $email1->get(); - /* Direct to Email Settings Page */ - return view('themes.default1.admin.helpdesk.settings.email', compact('emails', 'templates', 'emails1')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Ticket $ticket + * @param type Request $request + * @return type Response + */ + public function postticket($id, Ticket $ticket, Request $request) { + try { + /* fetch the values of ticket request */ + $tickets = $ticket->whereId('1')->first(); + /* fill the values to coompany table */ + $tickets->fill($request->except('captcha', 'claim_response', 'assigned_ticket', 'answered_ticket', 'agent_mask', 'html', 'client_update'))->save(); + /* insert checkbox to Database */ + $tickets->captcha = $request->input('captcha'); + $tickets->claim_response = $request->input('claim_response'); + $tickets->assigned_ticket = $request->input('assigned_ticket'); + $tickets->answered_ticket = $request->input('answered_ticket'); + $tickets->agent_mask = $request->input('agent_mask'); + $tickets->html = $request->input('html'); + $tickets->client_update = $request->input('client_update'); + $tickets->collision_avoid = $request->input('collision_avoid'); + /* Check whether function success or not */ + $tickets->save(); + /* redirect to Index page with Success Message */ + return redirect('getticket')->with('success', 'Ticket Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getticket')->with('fails', 'Ticket can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Email $email - * @param type EmailRequest $request - * @return type Response - */ - public function postemail($id, Email $email, EmailRequest $request) { - try { - /* fetch the values of email request */ - $emails = $email->whereId('1')->first(); - /* fill the values to email table */ - $emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save(); - /* insert checkboxes to database */ - $emails->email_fetching = $request->input('email_fetching'); - $emails->notification_cron = $request->input('notification_cron'); - $emails->all_emails = $request->input('all_emails'); - $emails->email_collaborator = $request->input('email_collaborator'); - $emails->strip = $request->input('strip'); - $emails->attachment = $request->input('attachment'); - /* Check whether function success or not */ - $emails->save(); - /* redirect to Index page with Success Message */ - return redirect('getemail')->with('success', 'Email Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getemail')->with('fails', 'Email can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * get the form for Email setting page + * @param type Email $email + * @param type Template $template + * @param type Emails $email1 + * @return type Response + */ + public function getemail(Email $email, Template $template, Emails $email1) { + try { + /* fetch the values of email from Email table */ + $emails = $email->whereId('1')->first(); + /* Fetch the values from Template table */ + $templates = $template->get(); + /* Fetch the values from Emails table */ + $emails1 = $email1->get(); + /* Direct to Email Settings Page */ + return view('themes.default1.admin.helpdesk.settings.email', compact('emails', 'templates', 'emails1')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * get the form for Access setting page - * @param type Access $access - * @return type Response - */ - // public function getaccess(Access $access) { - // try { - // /* fetch the values of access from access table */ - // $accesses = $access->whereId('1')->first(); + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Email $email + * @param type EmailRequest $request + * @return type Response + */ + public function postemail($id, Email $email, EmailRequest $request) { + try { + /* fetch the values of email request */ + $emails = $email->whereId('1')->first(); + /* fill the values to email table */ + $emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save(); + /* insert checkboxes to database */ + $emails->email_fetching = $request->input('email_fetching'); + $emails->notification_cron = $request->input('notification_cron'); + $emails->all_emails = $request->input('all_emails'); + $emails->email_collaborator = $request->input('email_collaborator'); + $emails->strip = $request->input('strip'); + $emails->attachment = $request->input('attachment'); + /* Check whether function success or not */ + $emails->save(); + /* redirect to Index page with Success Message */ + return redirect('getemail')->with('success', 'Email Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getemail')->with('fails', 'Email can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + + /** + * get the form for Access setting page + * @param type Access $access + * @return type Response + */ + // public function getaccess(Access $access) { + // try { + // /* fetch the values of access from access table */ + // $accesses = $access->whereId('1')->first(); // // Direct to Access Settings Page - // return view('themes.default1.admin.helpdesk.settings.access', compact('accesses')); - // } catch (Exception $e) { - // return view('404'); - // } - // } + // return view('themes.default1.admin.helpdesk.settings.access', compact('accesses')); + // } catch (Exception $e) { + // return view('404'); + // } + // } - /** - * Update the specified resource in storage. - * @param type Access $access - * @param type Request $request - * @return type Response - */ - // public function postaccess(Access $access, Request $request) { - // try { - // /* fetch the values of access request */ - // $accesses = $access->whereId('1')->first(); - // /* fill the values to access table */ - // $accesses->fill($request->except('password_reset', 'bind_agent_ip', 'reg_require', 'quick_access'))->save(); - // /* insert checkbox value to DB */ - // $accesses->password_reset = $request->input('password_reset'); - // $accesses->bind_agent_ip = $request->input('bind_agent_ip'); - // $accesses->reg_require = $request->input('reg_require'); - // $accesses->quick_access = $request->input('quick_access'); - // /* Check whether function success or not */ - // if ($accesses->save() == true) { - // /* redirect to Index page with Success Message */ - // return redirect('getaccess')->with('success', 'Access Updated Successfully'); - // } else { - // /* redirect to Index page with Fails Message */ - // return redirect('getaccess')->with('fails', 'Access can not Updated'); - // } - // } catch (Exception $e) { - // /* redirect to Index page with Fails Message */ - // return redirect('getaccess')->with('fails', 'Access can not Updated'); - // } - // } + /** + * Update the specified resource in storage. + * @param type Access $access + * @param type Request $request + * @return type Response + */ + // public function postaccess(Access $access, Request $request) { + // try { + // /* fetch the values of access request */ + // $accesses = $access->whereId('1')->first(); + // /* fill the values to access table */ + // $accesses->fill($request->except('password_reset', 'bind_agent_ip', 'reg_require', 'quick_access'))->save(); + // /* insert checkbox value to DB */ + // $accesses->password_reset = $request->input('password_reset'); + // $accesses->bind_agent_ip = $request->input('bind_agent_ip'); + // $accesses->reg_require = $request->input('reg_require'); + // $accesses->quick_access = $request->input('quick_access'); + // /* Check whether function success or not */ + // if ($accesses->save() == true) { + // /* redirect to Index page with Success Message */ + // return redirect('getaccess')->with('success', 'Access Updated Successfully'); + // } else { + // /* redirect to Index page with Fails Message */ + // return redirect('getaccess')->with('fails', 'Access can not Updated'); + // } + // } catch (Exception $e) { + // /* redirect to Index page with Fails Message */ + // return redirect('getaccess')->with('fails', 'Access can not Updated'); + // } + // } - /** - * get the form for Responder setting page - * @param type Responder $responder - * @return type Response - */ - public function getresponder(Responder $responder) { - try { - /* fetch the values of responder from responder table */ - $responders = $responder->whereId('1')->first(); - /* Direct to Responder Settings Page */ - return view('themes.default1.admin.helpdesk.settings.responder', compact('responders')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * get the form for Responder setting page + * @param type Responder $responder + * @return type Response + */ + public function getresponder(Responder $responder) { + try { + /* fetch the values of responder from responder table */ + $responders = $responder->whereId('1')->first(); + /* Direct to Responder Settings Page */ + return view('themes.default1.admin.helpdesk.settings.responder', compact('responders')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Update the specified resource in storage. - * @param type Responder $responder - * @param type Request $request - * @return type - */ - public function postresponder(Responder $responder, Request $request) { - try { - /* fetch the values of responder request */ - $responders = $responder->whereId('1')->first(); - /* insert Checkbox value to DB */ - $responders->new_ticket = $request->input('new_ticket'); - $responders->agent_new_ticket = $request->input('agent_new_ticket'); - $responders->submitter = $request->input('submitter'); - $responders->participants = $request->input('participants'); - $responders->overlimit = $request->input('overlimit'); - /* fill the values to coompany table */ - /* Check whether function success or not */ - $responders->save(); - /* redirect to Index page with Success Message */ - return redirect('getresponder')->with('success', 'Responder Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getresponder')->with('fails', 'Responder can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified resource in storage. + * @param type Responder $responder + * @param type Request $request + * @return type + */ + public function postresponder(Responder $responder, Request $request) { + try { + /* fetch the values of responder request */ + $responders = $responder->whereId('1')->first(); + /* insert Checkbox value to DB */ + $responders->new_ticket = $request->input('new_ticket'); + $responders->agent_new_ticket = $request->input('agent_new_ticket'); + $responders->submitter = $request->input('submitter'); + $responders->participants = $request->input('participants'); + $responders->overlimit = $request->input('overlimit'); + /* fill the values to coompany table */ + /* Check whether function success or not */ + $responders->save(); + /* redirect to Index page with Success Message */ + return redirect('getresponder')->with('success', 'Responder Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getresponder')->with('fails', 'Responder can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * get the form for Alert setting page - * @param type Alert $alert - * @return type Response - */ - public function getalert(Alert $alert) { - try { - /* fetch the values of alert from alert table */ - $alerts = $alert->whereId('1')->first(); - /* Direct to Alert Settings Page */ - return view('themes.default1.admin.helpdesk.settings.alert', compact('alerts')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * get the form for Alert setting page + * @param type Alert $alert + * @return type Response + */ + public function getalert(Alert $alert) { + try { + /* fetch the values of alert from alert table */ + $alerts = $alert->whereId('1')->first(); + /* Direct to Alert Settings Page */ + return view('themes.default1.admin.helpdesk.settings.alert', compact('alerts')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Update the specified resource in storage. - * @param type $id - * @param type Alert $alert - * @param type Request $request - * @return type Response - */ - public function postalert($id, Alert $alert, Request $request) { - try { - /* fetch the values of alert request */ - $alerts = $alert->whereId('1')->first(); - /* Insert Checkbox to DB */ - $alerts->assignment_status = $request->input('assignment_status'); - $alerts->ticket_status = $request->input('ticket_status'); - $alerts->overdue_department_member = $request->input('overdue_department_member'); - $alerts->sql_error = $request->input('sql_error'); - $alerts->excessive_failure = $request->input('excessive_failure'); - $alerts->overdue_status = $request->input('overdue_status'); - $alerts->overdue_assigned_agent = $request->input('overdue_assigned_agent'); - $alerts->overdue_department_manager = $request->input('overdue_department_manager'); - $alerts->internal_status = $request->input('internal_status'); - $alerts->internal_last_responder = $request->input('internal_last_responder'); - $alerts->internal_assigned_agent = $request->input('internal_assigned_agent'); - $alerts->internal_department_manager = $request->input('internal_department_manager'); - $alerts->assignment_assigned_agent = $request->input('assignment_assigned_agent'); - $alerts->assignment_team_leader = $request->input('assignment_team_leader'); - $alerts->assignment_team_member = $request->input('assignment_team_member'); - $alerts->system_error = $request->input('system_error'); - $alerts->transfer_department_member = $request->input('transfer_department_member'); - $alerts->transfer_department_manager = $request->input('transfer_department_manager'); - $alerts->transfer_assigned_agent = $request->input('transfer_assigned_agent'); - $alerts->transfer_status = $request->input('transfer_status'); - $alerts->message_organization_accmanager = $request->input('message_organization_accmanager'); - $alerts->message_department_manager = $request->input('message_department_manager'); - $alerts->message_assigned_agent = $request->input('message_assigned_agent'); - $alerts->message_last_responder = $request->input('message_last_responder'); - $alerts->message_status = $request->input('message_status'); - $alerts->ticket_organization_accmanager = $request->input('ticket_organization_accmanager'); - $alerts->ticket_department_manager = $request->input('ticket_department_manager'); - $alerts->ticket_department_member = $request->input('ticket_department_member'); - $alerts->ticket_admin_email = $request->input('ticket_admin_email'); + /** + * Update the specified resource in storage. + * @param type $id + * @param type Alert $alert + * @param type Request $request + * @return type Response + */ + public function postalert($id, Alert $alert, Request $request) { + try { + /* fetch the values of alert request */ + $alerts = $alert->whereId('1')->first(); + /* Insert Checkbox to DB */ + $alerts->assignment_status = $request->input('assignment_status'); + $alerts->ticket_status = $request->input('ticket_status'); + $alerts->overdue_department_member = $request->input('overdue_department_member'); + $alerts->sql_error = $request->input('sql_error'); + $alerts->excessive_failure = $request->input('excessive_failure'); + $alerts->overdue_status = $request->input('overdue_status'); + $alerts->overdue_assigned_agent = $request->input('overdue_assigned_agent'); + $alerts->overdue_department_manager = $request->input('overdue_department_manager'); + $alerts->internal_status = $request->input('internal_status'); + $alerts->internal_last_responder = $request->input('internal_last_responder'); + $alerts->internal_assigned_agent = $request->input('internal_assigned_agent'); + $alerts->internal_department_manager = $request->input('internal_department_manager'); + $alerts->assignment_assigned_agent = $request->input('assignment_assigned_agent'); + $alerts->assignment_team_leader = $request->input('assignment_team_leader'); + $alerts->assignment_team_member = $request->input('assignment_team_member'); + $alerts->system_error = $request->input('system_error'); + $alerts->transfer_department_member = $request->input('transfer_department_member'); + $alerts->transfer_department_manager = $request->input('transfer_department_manager'); + $alerts->transfer_assigned_agent = $request->input('transfer_assigned_agent'); + $alerts->transfer_status = $request->input('transfer_status'); + $alerts->message_organization_accmanager = $request->input('message_organization_accmanager'); + $alerts->message_department_manager = $request->input('message_department_manager'); + $alerts->message_assigned_agent = $request->input('message_assigned_agent'); + $alerts->message_last_responder = $request->input('message_last_responder'); + $alerts->message_status = $request->input('message_status'); + $alerts->ticket_organization_accmanager = $request->input('ticket_organization_accmanager'); + $alerts->ticket_department_manager = $request->input('ticket_department_manager'); + $alerts->ticket_department_member = $request->input('ticket_department_member'); + $alerts->ticket_admin_email = $request->input('ticket_admin_email'); - if($request->input('system_error') == null){ - $str = '%0%'; - $path = app_path('../config/app.php'); - $content = \File::get($path); - $content = str_replace('%1%', $str, $content); - \File::put($path, $content); - } else { - $str = '%1%'; - $path = app_path('../config/app.php'); - $content = \File::get($path); - $content = str_replace('%0%', $str, $content); - \File::put($path, $content); - } - /* fill the values to coompany table */ - /* Check whether function success or not */ - $alerts->save(); - /* redirect to Index page with Success Message */ - return redirect('getalert')->with('success', 'Alert Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('getalert')->with('fails', 'Alert can not Updated'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + if ($request->input('system_error') == null) { + $str = '%0%'; + $path = app_path('../config/app.php'); + $content = \File::get($path); + $content = str_replace('%1%', $str, $content); + \File::put($path, $content); + } else { + $str = '%1%'; + $path = app_path('../config/app.php'); + $content = \File::get($path); + $content = str_replace('%0%', $str, $content); + \File::put($path, $content); + } + /* fill the values to coompany table */ + /* Check whether function success or not */ + $alerts->save(); + /* redirect to Index page with Success Message */ + return redirect('getalert')->with('success', 'Alert Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('getalert')->with('fails', 'Alert can not Updated' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + + /** + * To display the list of ratings in the system + * @return type View + */ + public function RatingSettings() { + $ratings = DB::table('settings_ratings')->get(); + return view('themes.default1.admin.helpdesk.settings.ratings', compact('ratings')); + } + + /** + * To store rating data + * @return type Redirect + */ + public function PostRatingSettings($slug) { + $name = Input::get('rating_name'); + $publish = Input::get('publish'); + $modify = Input::get('modify'); + DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name, 'publish' => $publish, 'modify' => $modify)); + return redirect()->back()->with('success', 'Successfully updated'); + } + + /** + * To delete a type of rating + * @return type Redirect + */ + public function RatingDelete($slug) { + DB::table('settings_ratings')->whereSlug($slug)->delete(); + return redirect()->back()->with('success', 'Successfully Deleted'); + } } diff --git a/app/Http/Controllers/Admin/helpdesk/SlaController.php b/app/Http/Controllers/Admin/helpdesk/SlaController.php index 003a2d66b..2dd8c69c5 100644 --- a/app/Http/Controllers/Admin/helpdesk/SlaController.php +++ b/app/Http/Controllers/Admin/helpdesk/SlaController.php @@ -1,16 +1,15 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type void + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Sla_plan $sla - * @return type Response - */ - public function index(Sla_plan $sla) { - try { - /* Declare a Variable $slas to store all Values From Sla_plan Table */ - $slas = $sla->get(); - /* Listing the values From Sla_plan Table */ - return view('themes.default1.admin.helpdesk.manage.sla.index', compact('slas')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Display a listing of the resource. + * @param type Sla_plan $sla + * @return type Response + */ + public function index(Sla_plan $sla) { + try { + /* Declare a Variable $slas to store all Values From Sla_plan Table */ + $slas = $sla->get(); + /* Listing the values From Sla_plan Table */ + return view('themes.default1.admin.helpdesk.manage.sla.index', compact('slas')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Show the form for creating a new resource. - * @return type Response - */ - public function create() { - try { - /* Direct to Create Page */ - return view('themes.default1.admin.helpdesk.manage.sla.create'); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Show the form for creating a new resource. + * @return type Response + */ + public function create() { + try { + /* Direct to Create Page */ + return view('themes.default1.admin.helpdesk.manage.sla.create'); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Store a newly created resource in storage. - * @param type Sla_plan $sla - * @param type SlaRequest $request - * @return type Response - */ - public function store(Sla_plan $sla, SlaRequest $request) { - try { - /* Fill the request values to Sla_plan Table */ - /* Check whether function success or not */ - $sla->fill($request->input())->save(); - /* redirect to Index page with Success Message */ - return redirect('sla')->with('success', 'SLA Plan Created Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('sla')->with('fails', 'SLA Plan can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Store a newly created resource in storage. + * @param type Sla_plan $sla + * @param type SlaRequest $request + * @return type Response + */ + public function store(Sla_plan $sla, SlaRequest $request) { + try { + /* Fill the request values to Sla_plan Table */ + /* Check whether function success or not */ + $sla->fill($request->input())->save(); + /* redirect to Index page with Success Message */ + return redirect('sla')->with('success', 'SLA Plan Created Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('sla')->with('fails', 'SLA Plan can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Show the form for editing the specified resource. - * @param type int $id - * @param type Sla_plan $sla - * @return type Response - */ - public function edit($id, Sla_plan $sla) { - try { - /* Direct to edit page along values of perticular field using Id */ - $slas = $sla->whereId($id)->first(); - $slas->get(); - return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Show the form for editing the specified resource. + * @param type int $id + * @param type Sla_plan $sla + * @return type Response + */ + public function edit($id, Sla_plan $sla) { + try { + /* Direct to edit page along values of perticular field using Id */ + $slas = $sla->whereId($id)->first(); + $slas->get(); + return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Sla_plan $sla - * @param type SlaUpdate $request - * @return type Response - */ - public function update($id, Sla_plan $sla, SlaUpdate $request) { - try { - /* Fill values to selected field using Id except Check box */ - $slas = $sla->whereId($id)->first(); - $slas->fill($request->except('transient', 'ticket_overdue'))->save(); - /* Update transient checkox field */ - $slas->transient = $request->input('transient'); - /* Update ticket_overdue checkox field */ - $slas->ticket_overdue = $request->input('ticket_overdue'); - /* Check whether function success or not */ - $slas->save(); - /* redirect to Index page with Success Message */ - return redirect('sla')->with('success', 'SLA Plan Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('sla')->with('fails', 'SLA Plan can not Update'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Sla_plan $sla + * @param type SlaUpdate $request + * @return type Response + */ + public function update($id, Sla_plan $sla, SlaUpdate $request) { + try { + /* Fill values to selected field using Id except Check box */ + $slas = $sla->whereId($id)->first(); + $slas->fill($request->except('transient', 'ticket_overdue'))->save(); + /* Update transient checkox field */ + $slas->transient = $request->input('transient'); + /* Update ticket_overdue checkox field */ + $slas->ticket_overdue = $request->input('ticket_overdue'); + /* Check whether function success or not */ + $slas->save(); + /* redirect to Index page with Success Message */ + return redirect('sla')->with('success', 'SLA Plan Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('sla')->with('fails', 'SLA Plan can not Update' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Sla_plan $sla - * @return type Response - */ - public function destroy($id, Sla_plan $sla) { - $default_sla = Ticket::where('id','=','1')->first(); - if($default_sla->sla == $id) { - return redirect('departments')->with('fails', 'You cannot delete default department'); - } else { - $tickets = DB::table('tickets')->where('sla','=',$id)->update(['sla' => $default_sla->sla]); - if($tickets > 0) { - if($tickets > 1) { - $text_tickets = "Tickets"; - } else { - $text_tickets = "Ticket"; - } - $ticket = '
  • '.$tickets.' '.$text_tickets.' have been moved to default SLA
  • '; - } else { - $ticket = ""; - } - $dept = DB::table('department')->where('sla','=',$id)->update(['sla' => $default_sla->sla]); - if($dept > 0){ - if($dept > 1){ - $text_dept = "Emails"; - } else { - $text_dept = "Email"; - } - $dept = '
  • Associated department have been moved to default SLA
  • '; - } else { - $dept = ""; - } - $topic = DB::table('help_topic')->where('sla_plan','=',$id)->update(['sla_plan' => $default_sla->sla]); - if($topic > 0){ - if($topic > 1){ - $text_topic = "Emails"; - } else { - $text_topic = "Email"; - } - $topic = '
  • Associated Help Topic have been moved to default SLA
  • '; - } else { - $topic = ""; - } - $message = $ticket.$dept.$topic; - /* Delete a perticular field from the database by delete() using Id */ - $slas = $sla->whereId($id)->first(); - /* Check whether function success or not */ - try{ - $slas->delete(); - /* redirect to Index page with Success Message */ - return redirect('sla')->with('success', 'SLA Plan Deleted Successfully'.$message); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('sla')->with('fails', 'SLA Plan can not Delete'.'
  • '.$e->errorInfo[2].'
  • '); - } - } - } + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Sla_plan $sla + * @return type Response + */ + public function destroy($id, Sla_plan $sla) { + $default_sla = Ticket::where('id', '=', '1')->first(); + if ($default_sla->sla == $id) { + return redirect('departments')->with('fails', 'You cannot delete default department'); + } else { + $tickets = DB::table('tickets')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]); + if ($tickets > 0) { + if ($tickets > 1) { + $text_tickets = "Tickets"; + } else { + $text_tickets = "Ticket"; + } + $ticket = '
  • ' . $tickets . ' ' . $text_tickets . ' have been moved to default SLA
  • '; + } else { + $ticket = ""; + } + $dept = DB::table('department')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]); + if ($dept > 0) { + if ($dept > 1) { + $text_dept = "Emails"; + } else { + $text_dept = "Email"; + } + $dept = '
  • Associated department have been moved to default SLA
  • '; + } else { + $dept = ""; + } + $topic = DB::table('help_topic')->where('sla_plan', '=', $id)->update(['sla_plan' => $default_sla->sla]); + if ($topic > 0) { + if ($topic > 1) { + $text_topic = "Emails"; + } else { + $text_topic = "Email"; + } + $topic = '
  • Associated Help Topic have been moved to default SLA
  • '; + } else { + $topic = ""; + } + $message = $ticket . $dept . $topic; + /* Delete a perticular field from the database by delete() using Id */ + $slas = $sla->whereId($id)->first(); + /* Check whether function success or not */ + try { + $slas->delete(); + /* redirect to Index page with Success Message */ + return redirect('sla')->with('success', 'SLA Plan Deleted Successfully' . $message); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('sla')->with('fails', 'SLA Plan can not Delete' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + } } diff --git a/app/Http/Controllers/Admin/helpdesk/TeamController.php b/app/Http/Controllers/Admin/helpdesk/TeamController.php index 91057d142..396c996d7 100644 --- a/app/Http/Controllers/Admin/helpdesk/TeamController.php +++ b/app/Http/Controllers/Admin/helpdesk/TeamController.php @@ -1,17 +1,16 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type void + */ + public function __construct() { + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * get Index page - * @param type Teams $team - * @param type Assign_team_agent $assign_team_agent - * @return type Response - */ - public function index(Teams $team, Assign_team_agent $assign_team_agent) { - try { - $teams = $team->get(); - /* find out the Number of Members in the Team */ - $id = $teams->lists('id'); - $assign_team_agent = $assign_team_agent->get(); - return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * get Index page + * @param type Teams $team + * @param type Assign_team_agent $assign_team_agent + * @return type Response + */ + public function index(Teams $team, Assign_team_agent $assign_team_agent) { + try { + $teams = $team->get(); + /* find out the Number of Members in the Team */ + $id = $teams->lists('id'); + $assign_team_agent = $assign_team_agent->get(); + return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Show the form for creating a new resource. - * @param type User $user - * @return type Response - */ - public function create(User $user) { - try { - $user = $user->get(); - return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + /** + * Show the form for creating a new resource. + * @param type User $user + * @return type Response + */ + public function create(User $user) { + try { + $user = $user->get(); + return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - /** - * Store a newly created resource in storage. - * @param type Teams $team - * @param type TeamRequest $request - * @return type Response - */ - public function store(Teams $team, TeamRequest $request) { - - if($request->team_lead){ - $team_lead = $request->team_lead; - } else { - $team_lead = null; - } - $team->team_lead = $team_lead; - try { - /* Check whether function success or not */ - $team->fill($request->except('team_lead'))->save(); - /* redirect to Index page with Success Message */ - return redirect('teams')->with('success', 'Teams Created Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('teams')->with('fails', 'Teams can not Create'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Store a newly created resource in storage. + * @param type Teams $team + * @param type TeamRequest $request + * @return type Response + */ + public function store(Teams $team, TeamRequest $request) { - /** - * Show the form for editing the specified resource. - * @param type $id - * @param type User $user - * @param type Assign_team_agent $assign_team_agent - * @param type Teams $team - * @return type Response - */ - public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team) { - try { - $user = $user->whereId($id)->first(); - $teams = $team->whereId($id)->first(); - $agent_team = $assign_team_agent->where('team_id', $id)->get(); - $agent_id = $agent_team->lists('agent_id', 'agent_id'); - return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents')); - } catch (Exception $e) { - return redirect()->back()->with('fails',$e->errorInfo[2]); - } - } + if ($request->team_lead) { + $team_lead = $request->team_lead; + } else { + $team_lead = null; + } + $team->team_lead = $team_lead; + try { + /* Check whether function success or not */ + $team->fill($request->except('team_lead'))->save(); + /* redirect to Index page with Success Message */ + return redirect('teams')->with('success', 'Teams Created Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('teams')->with('fails', 'Teams can not Create' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Teams $team - * @param type TeamUpdate $request - * @return type Response - */ - public function update($id, Teams $team, TeamUpdate $request) { - - $teams = $team->whereId($id)->first(); - //updating check box - if($request->team_lead){ - $team_lead = $request->team_lead; - } else { - $team_lead = null; - } - $teams->team_lead = $team_lead; - $teams->save(); + /** + * Show the form for editing the specified resource. + * @param type $id + * @param type User $user + * @param type Assign_team_agent $assign_team_agent + * @param type Teams $team + * @return type Response + */ + public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team) { + try { + $user = $user->whereId($id)->first(); + $teams = $team->whereId($id)->first(); + $agent_team = $assign_team_agent->where('team_id', $id)->get(); + $agent_id = $agent_team->lists('agent_id', 'agent_id'); + return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents')); + } catch (Exception $e) { + return redirect()->back()->with('fails', $e->errorInfo[2]); + } + } - $alert = $request->input('assign_alert'); - $teams->assign_alert = $alert; - $teams->save(); //saving check box - //updating whole field - /* Check whether function success or not */ - try { - $teams->fill($request->except('team_lead'))->save(); - /* redirect to Index page with Success Message */ - return redirect('teams')->with('success', 'Teams Updated Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('teams')->with('fails', 'Teams can not Update'.'
  • '.$e->errorInfo[2].'
  • '); - } - } + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Teams $team + * @param type TeamUpdate $request + * @return type Response + */ + public function update($id, Teams $team, TeamUpdate $request) { + + $teams = $team->whereId($id)->first(); + //updating check box + if ($request->team_lead) { + $team_lead = $request->team_lead; + } else { + $team_lead = null; + } + $teams->team_lead = $team_lead; + $teams->save(); + + $alert = $request->input('assign_alert'); + $teams->assign_alert = $alert; + $teams->save(); //saving check box + //updating whole field + /* Check whether function success or not */ + try { + $teams->fill($request->except('team_lead'))->save(); + /* redirect to Index page with Success Message */ + return redirect('teams')->with('success', 'Teams Updated Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('teams')->with('fails', 'Teams can not Update' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } + + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Teams $team + * @param type Assign_team_agent $assign_team_agent + * @return type Response + */ + public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent) { + try { + $assign_team_agent->where('team_id', $id)->delete(); + $teams = $team->whereId($id)->first(); + $tickets = DB::table('tickets')->where('team_id', '=', $id)->update(['team_id' => null]); + /* Check whether function success or not */ + $teams->delete(); + /* redirect to Index page with Success Message */ + return redirect('teams')->with('success', 'Teams Deleted Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('teams')->with('fails', 'Teams can not Delete' . '
  • ' . $e->errorInfo[2] . '
  • '); + } + } - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Teams $team - * @param type Assign_team_agent $assign_team_agent - * @return type Response - */ - public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent) { - try { - $assign_team_agent->where('team_id', $id)->delete(); - $teams = $team->whereId($id)->first(); - $tickets = DB::table('tickets')->where('team_id','=',$id)->update(['team_id' => null]); - /* Check whether function success or not */ - $teams->delete(); - /* redirect to Index page with Success Message */ - return redirect('teams')->with('success', 'Teams Deleted Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('teams')->with('fails', 'Teams can not Delete'.'
  • '.$e->errorInfo[2].'
  • '); - } - } } diff --git a/app/Http/Controllers/Admin/helpdesk/TemplateController.php b/app/Http/Controllers/Admin/helpdesk/TemplateController.php index 2f29cd0df..9e55e240d 100644 --- a/app/Http/Controllers/Admin/helpdesk/TemplateController.php +++ b/app/Http/Controllers/Admin/helpdesk/TemplateController.php @@ -1,7 +1,11 @@ -middleware('auth'); - $this->middleware('roles'); - } + /** + * Create a new controller instance. + * @return type void + */ + public function __construct(PhpMailController $PhpMailController) { + $this->PhpMailController = $PhpMailController; + SettingsController::smtp(); + $this->middleware('auth'); + $this->middleware('roles'); + } - /** - * Display a listing of the resource. - * @param type Template $template - * @return type Response - */ - public function index(Template $template) { - try { - $templates = $template->get(); - return view('themes.default1.admin.helpdesk.emails.template.index', compact('templates')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Template $template + * @return type Response + */ + public function index(Template $template) { + try { + $templates = $template->get(); + return view('themes.default1.admin.helpdesk.emails.template.index', compact('templates')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Show the form for creating a new resource. - * @param type Languages $language - * @param type Template $template - * @return type Response - */ - public function create(Languages $language, Template $template) { - try { - $templates = $template->get(); - $languages = $language->get(); - return view('themes.default1.admin.helpdesk.emails.template.create', compact('languages', 'templates')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Show the form for creating a new resource. + * @param type Languages $language + * @param type Template $template + * @return type Response + */ + public function create(Languages $language, Template $template) { + try { + $templates = $template->get(); + $languages = $language->get(); + return view('themes.default1.admin.helpdesk.emails.template.create', compact('languages', 'templates')); + } catch (Exception $e) { + return view('404'); + } + } - /** - * Store a newly created resource in storage. - * @param type Template $template - * @param type TemplateRequest $request - * @return type Response - */ - public function store(Template $template, TemplateRequest $request) { - try { - /* Check whether function success or not */ - if ($template->fill($request->input())->save() == true) { - /* redirect to Index page with Success Message */ - return redirect('template')->with('success', 'Teams Created Successfully'); - } else { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Create'); - } - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Create'); - } - } - - /** - * Display the specified resource. - * @param int $id - * @return Response - */ - public function show($id) { - // - } - - /** - * Show the form for editing the specified resource. - * @param type $id - * @param type Template $template - * @param type Languages $language - * @return type Response - */ - public function listtemplates() { - $path = '../resources/views/emails/'; - - $templates = scandir($path); - $directory = str_replace('/', '-', $path); - return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates','directory')); - } - - public function readtemplate($template,$path) { - $directory = str_replace('-', '/', $path); - $directory2 = $directory.$template; - if (is_dir($directory2)) { - $templates = scandir($directory2); - $directory = str_replace('/', '-', $directory2.'/'); - return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates','directory')); + /** + * Store a newly created resource in storage. + * @param type Template $template + * @param type TemplateRequest $request + * @return type Response + */ + public function store(Template $template, TemplateRequest $request) { + try { + /* Check whether function success or not */ + if ($template->fill($request->input())->save() == true) { + /* redirect to Index page with Success Message */ + return redirect('template')->with('success', 'Teams Created Successfully'); + } else { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Create'); } - else { - $handle = fopen($directory.$template, "r"); - $contents = fread($handle, filesize($directory.$template)); - fclose($handle); - } - return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents','template','path')); - } - public function createtemplate() { - $directory = '../resources/views/emails/'; - $fname = Input::get('folder_name'); - $filename = $directory.$fname; - + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Create'); + } + } + + /** + * Display the specified resource. + * @param int $id + * @return Response + */ + public function show($id) { + // + } + + /** + * Show the form for editing the specified resource. + * @param type $id + * @param type Template $template + * @param type Languages $language + * @return type Response + */ + public function listdirectories() { + $path = '../resources/views/emails/'; + $directories = scandir($path); + $directory = str_replace('/', '-', $path); + return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory')); + } + + public function listtemplates($template, $path) { + $paths = str_replace('-', '/', $path); + $directory2 = $paths . $template; + + $templates = scandir($directory2); + $directory = str_replace('/', '-', $directory2 . '/'); + return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory')); + } + + public function readtemplate($template, $path) { + $directory = str_replace('-', '/', $path); + $handle = fopen($directory . $template, "r"); + $contents = fread($handle, filesize($directory . $template)); + fclose($handle); + + return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path')); + } + + public function createtemplate() { + $directory = '../resources/views/emails/'; + $fname = Input::get('folder_name'); + $filename = $directory . $fname; + // images folder creation using php // $mydir = dirname( __FILE__ )."/html/images"; // if(!is_dir($mydir)){ // mkdir("html/images"); // } - // Move all images files + // Move all images files + + if (!file_exists($filename)) { + mkdir($filename, 0777); + } + $files = array_filter(scandir($directory . 'default')); + + foreach ($files as $file) { + if ($file === '.' or $file === '..') + continue; + if (!is_dir($file)) { + // $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file); + $destination = $directory . $fname . '/'; + + copy($directory . 'default/' . $file, $destination . $file); + } + } + return \Redirect::back()->with('success', 'Successfully copied'); + } + + public function writetemplate($template, $path) { + $directory = str_replace('-', '/', $path); + $b = Input::get('templatedata'); + + file_put_contents($directory . $template, print_r($b, true)); + return \Redirect::back()->with('success', 'Successfully updated'); + } + + public function deletetemplate($template, $path) { + $directory = str_replace('-', '/', $path); + $dir = $directory . $template; + $status = \DB::table('settings_email')->first(); + if ($template == 'default' or $template == $status->template) { + return \Redirect::back()->with('fails', 'You cannot delete a default or active directory!'); + } + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + unlink($dir . "/" . $object); + } + } + rmdir($dir); + } else { + rmdir($dir); + } + return \Redirect::back()->with('success', 'Successfully Deleted'); + } + + public function activateset($setname) { + \DB::table('settings_email')->update(array('template' => $setname)); + return \Redirect::back()->with('success', 'You have Successfully Activated this Set'); + } + + public function edit($id, Template $template, Languages $language) { + try { + $templates = $template->whereId($id)->first(); + $languages = $language->get(); + return view('themes.default1.admin.helpdesk.emails.template.edit', compact('templates', 'languages')); + } catch (Exception $e) { + return view('404'); + } + } + + /** + * Update the specified resource in storage. + * @param type int $id + * @param type Template $template + * @param type TemplateUdate $request + * @return type Response + */ + public function update($id, Template $template, TemplateUdate $request) { + try { + //TODO validation + $templates = $template->whereId($id)->first(); + /* Check whether function success or not */ + if ($templates->fill($request->input())->save() == true) { + /* redirect to Index page with Success Message */ + return redirect('template')->with('success', 'Teams Updated Successfully'); + } else { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Update'); + } + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Update'); + } + } + + /** + * Remove the specified resource from storage. + * @param type int $id + * @param type Template $template + * @return type Response + */ + public function destroy($id, Template $template) { + try { + $templates = $template->whereId($id)->first(); + /* Check whether function success or not */ + if ($templates->delete() == true) { + /* redirect to Index page with Success Message */ + return redirect('template')->with('success', 'Teams Deleted Successfully'); + } else { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Delete'); + } + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect('template')->with('fails', 'Teams can not Delete'); + } + } + + /** + * Form for Email connection checking. + * @param type Emails $email + * @return type Response + */ + public function formDiagno(Emails $email) { + try { + $emails = $email->get(); + return view('themes.default1.admin.helpdesk.emails.template.formDiagno', compact('emails')); + } catch (Exception $e) { + return view('404'); + } + } + + /** + * function to send emails + * @param type Request $request + * @return type + */ + public function postDiagno(Request $request) { + $email = $request->input('to'); + if ($email == null) { + return redirect('getdiagno')->with('fails', 'Please provide E-mail address !'); + } + // sending mail via php mailer + $mail = $this->PhpMailController->sendmail($from = 1, $to = ['email' => $email], $message = ['subject' => 'Checking the connection', 'scenario' => 'error-report', 'content' => 'Email Received Successfully'], $template_variables = ['system_error' => 'hello']); + + return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address'); + } -if(!file_exists($filename)) { -mkdir($filename,0777); -} -$files = array_filter(scandir($directory.'default')); - - foreach($files as $file){ - if ($file === '.' or $file === '..') continue; - if(!is_dir($file)) { - // $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file); - $destination = $directory.$fname.'/'; - - copy($directory.'default/'.$file, $destination.$file); - } - } - return \Redirect::back()->with('success', 'Successfully copied'); - } - public function writetemplate($template,$path) { - $directory = str_replace('-', '/', $path); - $b = Input::get('templatedata'); - - file_put_contents($directory.$template, print_r($b, true)); - return \Redirect::back()->with('success', 'Successfully updated'); - } - - public function edit($id, Template $template, Languages $language) { - try { - $templates = $template->whereId($id)->first(); - $languages = $language->get(); - return view('themes.default1.admin.helpdesk.emails.template.edit', compact('templates', 'languages')); - } catch (Exception $e) { - return view('404'); - } - } - - /** - * Update the specified resource in storage. - * @param type int $id - * @param type Template $template - * @param type TemplateUdate $request - * @return type Response - */ - public function update($id, Template $template, TemplateUdate $request) { - try { - //TODO validation - $templates = $template->whereId($id)->first(); - /* Check whether function success or not */ - if ($templates->fill($request->input())->save() == true) { - /* redirect to Index page with Success Message */ - return redirect('template')->with('success', 'Teams Updated Successfully'); - } else { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Update'); - } - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Update'); - } - } - - /** - * Remove the specified resource from storage. - * @param type int $id - * @param type Template $template - * @return type Response - */ - public function destroy($id, Template $template) { - try { - $templates = $template->whereId($id)->first(); - /* Check whether function success or not */ - if ($templates->delete() == true) { - /* redirect to Index page with Success Message */ - return redirect('template')->with('success', 'Teams Deleted Successfully'); - } else { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Delete'); - } - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect('template')->with('fails', 'Teams can not Delete'); - } - } - - /** - * Form for Email connection checking. - * @param type Emails $email - * @return type Response - */ - public function formDiagno(Emails $email) { - try { - $emails = $email->get(); - return view('themes.default1.admin.helpdesk.emails.template.formDiagno', compact('emails')); - } catch (Exception $e) { - return view('404'); - } - } - - /** - * function to send emails - * @param type Request $request - * @return type - */ - public function postDiagno(Request $request) { - $email = $request->input('to'); - if($email == null) - { - return redirect('getdiagno')->with('fails', 'Please provide E-mail address !'); - } - $mail = Mail::send('themes.default1.admin.helpdesk.emails.template.connection', array('link' => url('getmail'), 'username' => $email), function ($message) use ($email) { - $message->to($email)->subject('Checking the connection'); - }); - return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address'); - } - } diff --git a/app/Http/Controllers/Admin/helpdesk/ThreadController.php b/app/Http/Controllers/Admin/helpdesk/ThreadController.php index 184658215..f9653d36e 100644 --- a/app/Http/Controllers/Admin/helpdesk/ThreadController.php +++ b/app/Http/Controllers/Admin/helpdesk/ThreadController.php @@ -1,14 +1,15 @@ -get(); - /* get the values of priority from Priority Table */ - $priorities = $priority->get(); - /* Direct to view page */ - return view('themes.default1.admin.helpdesk.tickets.ticket', compact('threads', 'priorities')); - } catch (Exception $e) { - return view('404'); - } - } + /** + * get the values from ticket_thread Table and direct to view page + * @param type Ticket_thread $thread + * @param type Priority $priority + * @return type Response + */ + public function getTickets(Ticket_thread $thread, Priority $priority) { + try { + /* get the values of Ticket_thread from Ticket_thread Table */ + $threads = $thread->get(); + /* get the values of priority from Priority Table */ + $priorities = $priority->get(); + /* Direct to view page */ + return view('themes.default1.admin.helpdesk.tickets.ticket', compact('threads', 'priorities')); + } catch (Exception $e) { + return view('404'); + } + } + } diff --git a/app/Http/Controllers/Agent/DashboardController.php b/app/Http/Controllers/Agent/DashboardController.php deleted file mode 100644 index 5fe9793a6..000000000 --- a/app/Http/Controllers/Agent/DashboardController.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ -class DashboardController extends Controller { - - /** - * Create a new controller instance. - * constructor to check - * 1. authentication - * 2. user roles - * 3. roles must be agent - * @return void - */ - public function __construct() { - $this->middleware('auth'); - $this->middleware('role.agent'); - } - - /** - * Show the form for creating a new resource. - * @return type Response - */ - public function index() { - try { - if(Auth::user()->role == "user"){ - return \Redirect::route('home'); - } - return View::make('themes.default1.agent.helpdesk.dashboard.dashboard'); - } catch (Exception $e) { - return view('404'); - } - } - - /** - * ChartData - * @return type - */ - public function ChartData() - { - $date2 = strtotime(Date('Y-m-d')); - $date3 = Date('Y-m-d'); - $format = 'Y-m-d'; - $date1 = strtotime(Date($format,strtotime('-1 month'. $date3))); - - $return = ""; - $last = ""; - for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) { - $thisDate = date( 'Y-m-d', $i ); - - $created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count(); - $closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count(); - $reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count(); - - $value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened]; - $array = array_map('htmlentities',$value); - $json = html_entity_decode(json_encode($array)); - $return .= $json.','; - } - $last = rtrim($return,','); - - return '['.$last.']'; - - - - // $ticketlist = DB::table('tickets') - // ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'), - // DB::raw('count(*) as totaltickets')) - // ->groupBy('month') - // ->orderBy('month', 'asc') - // ->get(); - - // return $ticketlist; - } - -} diff --git a/app/Http/Controllers/Agent/dashboard.blade.php b/app/Http/Controllers/Agent/dashboard.blade.php deleted file mode 100644 index e235138da..000000000 --- a/app/Http/Controllers/Agent/dashboard.blade.php +++ /dev/null @@ -1,234 +0,0 @@ -@extends('themes.default1.agent.layout.agent') - -@section('Dashboard') -class="active" -@stop - -@section('dashboard-bar') -active -@stop - -@section('dashboard') -class="active" -@stop - -@section('content') - -
    - - =',date('Y-m-d'))->get(); - - // echo count($tickets); - - ?> -
    -

    {!! Lang::get('lang.line_chart') !!}

    -
    - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -

    {!! Lang::get('lang.statistics') !!}

    - -
    -
    - - - - - - - - - - - -@foreach($departments as $department) -id)->where('status','=',1)->count(); -$resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',2)->count(); -$close = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',3)->count(); -$delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',5)->count(); - -?> - - - - - - - - - - - @endforeach -
    {!! Lang::get('lang.department') !!}{!! Lang::get('lang.opened') !!}{!! Lang::get('lang.resolved') !!}{!! Lang::get('lang.closed') !!}{!! Lang::get('lang.deleted') !!}
    {!! $department->name !!}{!! $open !!}{!! $resolve !!}{!! $close !!}{!! $delete !!}
    -
    -
    - - - - -@stop diff --git a/app/Http/Controllers/Agent/helpdesk/CannedController.php b/app/Http/Controllers/Agent/helpdesk/CannedController.php index 465504a74..1b61bdeb6 100644 --- a/app/Http/Controllers/Agent/helpdesk/CannedController.php +++ b/app/Http/Controllers/Agent/helpdesk/CannedController.php @@ -1,16 +1,15 @@ -middleware('auth'); - // checking if role is agent - $this->middleware('role.agent'); - } + /** + * Create a new controller instance. + * constructor to check + * 1. authentication + * 2. user roles + * 3. roles must be agent + * @return void + */ + public function __construct() { + // checking authentication + $this->middleware('auth'); + // checking if role is agent + $this->middleware('role.agent'); + } - /** - * Display a listing of the Canned Responses. - * @return type View - */ - public function index() { - return view('themes.default1.agent.helpdesk.canned.index'); - } + /** + * Display a listing of the Canned Responses. + * @return type View + */ + public function index() { + return view('themes.default1.agent.helpdesk.canned.index'); + } - /** - * Show the form for creating a new Canned Response - * @return type View - */ - public function create() { - return view('themes.default1.agent.helpdesk.canned.create'); - } + /** + * Show the form for creating a new Canned Response + * @return type View + */ + public function create() { + return view('themes.default1.agent.helpdesk.canned.create'); + } - /** - * Store a newly created Canned Response. - * @param type CannedRequest $request - * @param type Canned $canned - * @return type Redirect - */ - public function store(CannedRequest $request, Canned $canned) { - // fetching all the requested inputs - $canned->user_id = \Auth::user()->id; - $canned->title = $request->input('title'); - $canned->message = $request->input('message'); - try { - // saving inputs - $canned->save(); - return redirect()->route('canned.list')->with('success','Added Successfully'); - } catch (Exception $e) { - return redirect()->route('canned.list')->with('fails',$e->errorInfo[2]); - } - } + /** + * Store a newly created Canned Response. + * @param type CannedRequest $request + * @param type Canned $canned + * @return type Redirect + */ + public function store(CannedRequest $request, Canned $canned) { + // fetching all the requested inputs + $canned->user_id = \Auth::user()->id; + $canned->title = $request->input('title'); + $canned->message = $request->input('message'); + try { + // saving inputs + $canned->save(); + return redirect()->route('canned.list')->with('success', 'Added Successfully'); + } catch (Exception $e) { + return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]); + } + } - /** - * Show the form for editing the Canned Response. - * @param type $id - * @param type Canned $canned - * @return type View - */ - public function edit($id, Canned $canned) { - // fetching requested canned response - $canned = $canned->where('user_id', '=', \Auth::user()->id)->where('id','=',$id)->first(); - return view('themes.default1.agent.helpdesk.canned.edit',compact('canned')); - } + /** + * Show the form for editing the Canned Response. + * @param type $id + * @param type Canned $canned + * @return type View + */ + public function edit($id, Canned $canned) { + // fetching requested canned response + $canned = $canned->where('user_id', '=', \Auth::user()->id)->where('id', '=', $id)->first(); + return view('themes.default1.agent.helpdesk.canned.edit', compact('canned')); + } - /** - * Update the Canned Response in database. - * @param type $id - * @param type CannedUpdateRequest $request - * @param type Canned $canned - * @return type Redirect - */ - public function update($id, CannedUpdateRequest $request, Canned $canned) { - /* select the field where id = $id(request Id) */ - $canned = $canned->where('id','=',$id)->where('user_id', '=', \Auth::user()->id)->first(); - // fetching all the requested inputs - $canned->user_id = \Auth::user()->id; - $canned->title = $request->input('title'); - $canned->message = $request->input('message'); - try { - // saving inputs - $canned->save(); - return redirect()->route('canned.list')->with('success','Updated Successfully'); - } catch (Exception $e) { - return redirect()->route('canned.list')->with('fails',$e->errorInfo[2]); - } - } + /** + * Update the Canned Response in database. + * @param type $id + * @param type CannedUpdateRequest $request + * @param type Canned $canned + * @return type Redirect + */ + public function update($id, CannedUpdateRequest $request, Canned $canned) { + /* select the field where id = $id(request Id) */ + $canned = $canned->where('id', '=', $id)->where('user_id', '=', \Auth::user()->id)->first(); + // fetching all the requested inputs + $canned->user_id = \Auth::user()->id; + $canned->title = $request->input('title'); + $canned->message = $request->input('message'); + try { + // saving inputs + $canned->save(); + return redirect()->route('canned.list')->with('success', 'Updated Successfully'); + } catch (Exception $e) { + return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]); + } + } - /** - * Delete the Canned Response from storage. - * @param type $id - * @param type Canned $canned - * @return type Redirect - */ - public function destroy($id, Canned $canned) { - /* select the field where id = $id(request Id) */ - $canned = $canned->whereId($id)->first(); - /* delete the selected field */ - /* Check whether function success or not */ - try { - $canned->delete(); - /* redirect to Index page with Success Message */ - return redirect()->route('canned.list')->with('success', 'User Deleted Successfully'); - } catch (Exception $e) { - /* redirect to Index page with Fails Message */ - return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]); - } - } + /** + * Delete the Canned Response from storage. + * @param type $id + * @param type Canned $canned + * @return type Redirect + */ + public function destroy($id, Canned $canned) { + /* select the field where id = $id(request Id) */ + $canned = $canned->whereId($id)->first(); + /* delete the selected field */ + /* Check whether function success or not */ + try { + $canned->delete(); + /* redirect to Index page with Success Message */ + return redirect()->route('canned.list')->with('success', 'User Deleted Successfully'); + } catch (Exception $e) { + /* redirect to Index page with Fails Message */ + return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]); + } + } - /** - * Fetch Canned Response in the ticket detail page. - * @param type $id - * @return type json - */ - public function get_canned($id) { - // checking for the canned response with requested value - if($id != "zzz") { - // fetching canned response - $canned = Canned::where('id','=',$id)->where('user_id','=',\Auth::user()->id)->first(); - $msg = $canned->message; - } else { - $msg = ""; - } - // returning the canned response in JSON format - return \Response::json($msg); - } + /** + * Fetch Canned Response in the ticket detail page. + * @param type $id + * @return type json + */ + public function get_canned($id) { + // checking for the canned response with requested value + if ($id != "zzz") { + // fetching canned response + $canned = Canned::where('id', '=', $id)->where('user_id', '=', \Auth::user()->id)->first(); + $msg = $canned->message; + } else { + $msg = ""; + } + // returning the canned response in JSON format + return \Response::json($msg); + } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Agent/helpdesk/DashboardController.php b/app/Http/Controllers/Agent/helpdesk/DashboardController.php index 1225864d0..cf7a4dda2 100644 --- a/app/Http/Controllers/Agent/helpdesk/DashboardController.php +++ b/app/Http/Controllers/Agent/helpdesk/DashboardController.php @@ -1,14 +1,14 @@ -middleware('auth'); + $this->middleware('auth'); // checking if the role is agent - $this->middleware('role.agent'); - } + $this->middleware('role.agent'); + } - /** - * Get the dashboard page - * @return type view - */ - public function index() { - // if(Auth::user()->role == "user"){ - // return \Redirect::route('home'); - // } + /** + * Get the dashboard page + * @return type view + */ + public function index() { + // if(Auth::user()->role == "user"){ + // return \Redirect::route('home'); + // } try { - return View::make('themes.default1.agent.helpdesk.dashboard.dashboard'); + return View::make('themes.default1.agent.helpdesk.dashboard.dashboard'); } catch (Exception $e) { - return View::make('themes.default1.agent.helpdesk.dashboard.dashboard'); + return View::make('themes.default1.agent.helpdesk.dashboard.dashboard'); } - } + } /** * Fetching dashboard graph data to implement graph * @return type Json */ - public function ChartData($date111 = "",$date122 = "") - { - - $date11 = strtotime($date122); - $date12 = strtotime($date111); - if($date11 && $date12){ - $date2 = $date12; - $date1 = $date11; - } else { + public function ChartData($date111 = "", $date122 = "") { + $date11 = strtotime($date122); + $date12 = strtotime($date111); + if ($date11 && $date12) { + $date2 = $date12; + $date1 = $date11; + } else { // generating current date $date2 = strtotime(Date('Y-m-d')); $date3 = Date('Y-m-d'); $format = 'Y-m-d'; // generating a date range of 1 month - $date1 = strtotime(Date($format,strtotime('-1 month'. $date3))); - } - $return = ""; - $last = ""; - for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) { - $thisDate = date( 'Y-m-d', $i ); - - $created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count(); - $closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count(); - $reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count(); - - $value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened]; - $array = array_map('htmlentities',$value); - $json = html_entity_decode(json_encode($array)); - $return .= $json.','; - } - $last = rtrim($return,','); + $date1 = strtotime(Date($format, strtotime('-1 month' . $date3))); + } + $return = ""; + $last = ""; + for ($i = $date1; $i <= $date2; $i = $i + 86400) { + $thisDate = date('Y-m-d', $i); + + $created = \DB::table('tickets')->select('created_at')->where('created_at', 'LIKE', '%' . $thisDate . '%')->count(); + $closed = \DB::table('tickets')->select('closed_at')->where('closed_at', 'LIKE', '%' . $thisDate . '%')->count(); + $reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at', 'LIKE', '%' . $thisDate . '%')->count(); + + $value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened]; + $array = array_map('htmlentities', $value); + $json = html_entity_decode(json_encode($array)); + $return .= $json . ','; + } + $last = rtrim($return, ','); + + return '[' . $last . ']'; - return '['.$last.']'; - // $ticketlist = DB::table('tickets') // ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'),DB::raw('SUM(CASE WHEN status = 5 THEN 1 ELSE 0 END) as deleted'), // DB::raw('count(*) as totaltickets')) // ->groupBy('month') // ->orderBy('month', 'asc') // ->get(); - // return $ticketlist; } diff --git a/app/Http/Controllers/Agent/helpdesk/MailController.php b/app/Http/Controllers/Agent/helpdesk/MailController.php index 0a1322b12..1cb90eedd 100644 --- a/app/Http/Controllers/Agent/helpdesk/MailController.php +++ b/app/Http/Controllers/Agent/helpdesk/MailController.php @@ -1,8 +1,10 @@ -TicketController = $TicketController; - } + /** + * constructor + * Create a new controller instance. + * @param type TicketController $TicketController + */ + public function __construct(TicketController $TicketController) { + $this->TicketController = $TicketController; + } - /** - * Reademails - * @return type - */ - - - public function readmails(Emails $emails, Email $settings_email, System $system) - { - // $path_url = $system->first()->url; - if($settings_email->first()->email_fetching == 1) - { - if($settings_email->first()->all_emails == 1) - { - // $helptopic = $this->TicketController->default_helptopic(); - // $sla = $this->TicketController->default_sla(); - $email = $emails->get(); - foreach($email as $e_mail) - { - $helptopic = $e_mail->help_topic; - $get_helptopic = Help_topic::where('id', '=', $helptopic)->first(); - $sla = $get_helptopic->sla_plan; - $dept = $e_mail->department; - $host = $e_mail->fetching_host; - $port = $e_mail->fetching_port; - $protocol = $e_mail->mailbox_protocol; - $get_mailboxprotocol = MailboxProtocol::where('id','=',$protocol)->first(); - $protocol = $get_mailboxprotocol->value; - $imap_config = '{'.$host.':'.$port.$protocol.'}INBOX'; - $password = Crypt::decrypt($e_mail->password); - $mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__); - $mails = array(); - $mailsIds = $mailbox->searchMailBox('SINCE '. date('d-M-Y', strtotime("-1 day"))); - if(!$mailsIds) { - die('Mailbox is empty'); - } - foreach($mailsIds as $mailId) { - $overview = $mailbox->get_overview($mailId); - $var = $overview[0]->seen ? 'read' : 'unread'; - if ($var == 'unread') { - $mail = $mailbox->getMail($mailId); - if($settings_email->first()->email_collaborator == 1) { - $collaborator = $mail->cc; - } else { - $collaborator = null; - } - $body = $mail->textHtml; - if($body == null) { - $body = $mailbox->backup_getmail($mailId); - $body = str_replace('\r\n', '
    ', $body); - // var_dump($body); - } - $date = $mail->date; - $datetime = $overview[0]->date; - $date_time = explode(" ", $datetime); - $date = $date_time[1] . "-" . $date_time[2] . "-" . $date_time[3] . " " . $date_time[4]; - $date = date('Y-m-d H:i:s', strtotime($date)); - // dd($date); - - if(isset($mail->subject)){ - $subject = $mail->subject; - } else { - $subject = "No Subject"; - } - - // dd($subject); - $fromname = $mail->fromName; - $fromaddress = $mail->fromAddress; - $ticket_source = Ticket_source::where('name','=','email')->first(); - $source = $ticket_source->id; - $phone = ""; - $priority = $get_helptopic->priority; - // Ticket_Priority::where('') + /** + * Reademails + * @return type + */ + public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) { + // $path_url = $system->first()->url; + if ($settings_email->first()->email_fetching == 1) { + if ($settings_email->first()->all_emails == 1) { + // $helptopic = $this->TicketController->default_helptopic(); + // $sla = $this->TicketController->default_sla(); + $email = $emails->get(); + foreach ($email as $e_mail) { + $priority = $e_mail->priority; + $dept = $e_mail->department; + $helptopic = $e_mail->help_topic; - $assign = $get_helptopic->auto_assign; - $form_data = null; - $result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data); - // dd($result); - if ($result[1] == true) { - $ticket_table = Tickets::where('ticket_number', '=' , $result[0])->first(); - $thread_id = Ticket_Thread::where('ticket_id','=',$ticket_table->id)->max('id'); - // $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first(); - $thread_id = $thread_id; - - foreach($mail->getAttachments() as $attachment) { - $support = "support"; - // echo $_SERVER['DOCUMENT_ROOT']; - $dir_img_paths = __DIR__; - $dir_img_path = explode('/code', $dir_img_paths); - // dd($attachment->filePath); - $filepath = explode('../../../../../public',$attachment->filePath); - // var_dump($attachment->filePath); - // dd($filepath); - // $path = $dir_img_path[0]."/code/public/".$filepath[1]; - $path = public_path().$filepath[1]; - // dd($path); - $filesize = filesize($path); - $file_data = file_get_contents($path); - $ext = pathinfo($attachment->filePath, PATHINFO_EXTENSION); - $imageid = $attachment->id; - $string = str_replace('-', '', $attachment->name); - $filename = explode('src', $attachment->filePath); - $filename = str_replace('\\', '', $filename); - $body = str_replace("cid:".$imageid, $filepath[1], $body); - $pos = strpos($body, $filepath[1]); + if ($priority == null) { + $priority = $ticket->first()->priority; + } - if($pos == false) { - if($settings_email->first()->attachment == 1) { - $upload = new Ticket_attachments; - $upload->file = $file_data; - $upload->thread_id = $thread_id; - $upload->name = $filepath[1]; - $upload->type = $ext; - $upload->size = $filesize; - $upload->poster = "ATTACHMENT"; - $upload->save(); + if ($dept == null) { + $dept = $system->first()->department; + } + + if ($helptopic == null) { + $helptopic = $ticket->first()->help_topic; + } + // dd($dept); + + $get_helptopic = Help_topic::where('id', '=', $helptopic)->first(); + $sla = $get_helptopic->sla_plan; + // $dept = $e_mail->department; + $host = $e_mail->fetching_host; + $port = $e_mail->fetching_port; + $protocol = $e_mail->mailbox_protocol; + $get_mailboxprotocol = MailboxProtocol::where('id', '=', $protocol)->first(); + $protocol = $get_mailboxprotocol->value; + $imap_config = '{' . $host . ':' . $port . $protocol . '}INBOX'; + $password = Crypt::decrypt($e_mail->password); + $mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__); + $mails = array(); + $mailsIds = $mailbox->searchMailBox('SINCE ' . date('d-M-Y', strtotime("-1 day"))); + if (!$mailsIds) { + die('Mailbox is empty'); + } + foreach ($mailsIds as $mailId) { + $overview = $mailbox->get_overview($mailId); + $var = $overview[0]->seen ? 'read' : 'unread'; + if ($var == 'unread') { + $mail = $mailbox->getMail($mailId); + if ($settings_email->first()->email_collaborator == 1) { + $collaborator = $mail->cc; + } else { + $collaborator = null; + } + $body = $mail->textHtml; + if ($body == null) { + $body = $mailbox->backup_getmail($mailId); + $body = str_replace('\r\n', '
    ', $body); + // var_dump($body); + } + $date = $mail->date; + $datetime = $overview[0]->date; + $date_time = explode(" ", $datetime); + $date = $date_time[1] . "-" . $date_time[2] . "-" . $date_time[3] . " " . $date_time[4]; + $date = date('Y-m-d H:i:s', strtotime($date)); + // dd($date); + + if (isset($mail->subject)) { + $subject = $mail->subject; + } else { + $subject = "No Subject"; + } + + // dd($subject); + $fromname = $mail->fromName; + $fromaddress = $mail->fromAddress; + $ticket_source = Ticket_source::where('name', '=', 'email')->first(); + $source = $ticket_source->id; + $phone = ""; + + $assign = $get_helptopic->auto_assign; + $form_data = null; + $result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data); + // dd($result); + if ($result[1] == true) { + $ticket_table = Tickets::where('ticket_number', '=', $result[0])->first(); + $thread_id = Ticket_Thread::where('ticket_id', '=', $ticket_table->id)->max('id'); + // $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first(); + $thread_id = $thread_id; + + foreach ($mail->getAttachments() as $attachment) { + $support = "support"; + // echo $_SERVER['DOCUMENT_ROOT']; + $dir_img_paths = __DIR__; + $dir_img_path = explode('/code', $dir_img_paths); + // dd($attachment->filePath); + $filepath = explode('../../../../../public', $attachment->filePath); + // var_dump($attachment->filePath); + // dd($filepath); + // $path = $dir_img_path[0]."/code/public/".$filepath[1]; + $path = public_path() . $filepath[1]; + // dd($path); + $filesize = filesize($path); + $file_data = file_get_contents($path); + $ext = pathinfo($attachment->filePath, PATHINFO_EXTENSION); + $imageid = $attachment->id; + $string = str_replace('-', '', $attachment->name); + $filename = explode('src', $attachment->filePath); + $filename = str_replace('\\', '', $filename); + $body = str_replace("cid:" . $imageid, $filepath[1], $body); + $pos = strpos($body, $filepath[1]); + + if ($pos == false) { + if ($settings_email->first()->attachment == 1) { + $upload = new Ticket_attachments; + $upload->file = $file_data; + $upload->thread_id = $thread_id; + $upload->name = $filepath[1]; + $upload->type = $ext; + $upload->size = $filesize; + $upload->poster = "ATTACHMENT"; + $upload->save(); + } + } else { + $upload = new Ticket_attachments; + $upload->file = $file_data; + $upload->thread_id = $thread_id; + $upload->name = $filepath[1]; + $upload->type = $ext; + $upload->size = $filesize; + $upload->poster = "INLINE"; + $upload->save(); + } + unlink($path); } - } else { - $upload = new Ticket_attachments; - $upload->file = $file_data; - $upload->thread_id = $thread_id; - $upload->name = $filepath[1]; - $upload->type = $ext; - $upload->size = $filesize; - $upload->poster = "INLINE"; - $upload->save(); - } - unlink($path); - } - $body = Encoding::fixUTF8($body); - $thread = Ticket_Thread::where('id','=',$thread_id)->first(); - $thread->body = $this->separate_reply($body) ; - $thread->save(); - } - } - } - } - } - } - } + $body = Encoding::fixUTF8($body); + $thread = Ticket_Thread::where('id', '=', $thread_id)->first(); + $thread->body = $this->separate_reply($body); + $thread->save(); + } + } + } + } + } + } + } - /** - * separate reply - * @param type $body - * @return type string - */ - public function separate_reply($body) { - $body2 = explode('---Reply above this line---', $body); - $body3 = $body2[0]; - return $body3; - } + /** + * separate reply + * @param type $body + * @return type string + */ + public function separate_reply($body) { + $body2 = explode('---Reply above this line---', $body); + $body3 = $body2[0]; + return $body3; + } - /** - * Decode Imap text - * @param type $str - * @return type string - */ - public function decode_imap_text($str) { - $result = ''; - $decode_header = imap_mime_header_decode($str); - foreach ($decode_header AS $obj) { - $result .= htmlspecialchars(rtrim($obj->text, "\t")); - } - return $result; - } + /** + * Decode Imap text + * @param type $str + * @return type string + */ + public function decode_imap_text($str) { + $result = ''; + $decode_header = imap_mime_header_decode($str); + foreach ($decode_header AS $obj) { + $result .= htmlspecialchars(rtrim($obj->text, "\t")); + } + return $result; + } - /** - * fetch_attachments - * @return type - */ - public function fetch_attachments(){ - $uploads = Upload::all(); - foreach($uploads as $attachment) { - $image = @imagecreatefromstring($attachment->file); - ob_start(); - imagejpeg($image, null, 80); - $data = ob_get_contents(); - ob_end_clean(); - $var = ''; - echo '
    '.$var.''; - } - } + /** + * fetch_attachments + * @return type + */ + public function fetch_attachments() { + $uploads = Upload::all(); + foreach ($uploads as $attachment) { + $image = @imagecreatefromstring($attachment->file); + ob_start(); + imagejpeg($image, null, 80); + $data = ob_get_contents(); + ob_end_clean(); + $var = ''; + echo '
    ' . $var . ''; + } + } - /** - * function to load data - * @param type $id - * @return type file - */ - public function get_data($id){ - $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id','=',$id)->get(); - foreach($attachments as $attachment) - { - header('Content-type: application/'.$attachment->type.''); - header('Content-Disposition: inline; filename='.$attachment->name.''); - header('Content-Transfer-Encoding: binary'); - echo $attachment->file; - } - } + /** + * function to load data + * @param type $id + * @return type file + */ + public function get_data($id) { + $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get(); + foreach ($attachments as $attachment) { + header('Content-type: application/' . $attachment->type . ''); + header('Content-Disposition: inline; filename=' . $attachment->name . ''); + header('Content-Transfer-Encoding: binary'); + echo $attachment->file; + } + } } diff --git a/app/Http/Controllers/Agent/helpdesk/NotificationController.php b/app/Http/Controllers/Agent/helpdesk/NotificationController.php index 70c1bbadf..278c1ac94 100644 --- a/app/Http/Controllers/Agent/helpdesk/NotificationController.php +++ b/app/Http/Controllers/Agent/helpdesk/NotificationController.php @@ -1,8 +1,9 @@ -first(); - // 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 - $notification = Log_notification::where('log','=','NOT-1')->orderBy('id','DESC')->first(); - $date = explode(" " , $notification->created_at); - if(Date('Y-m-d') == $date[0]){ - } else { - // creating a daily notification log - Log_notification::create(['log'=>'NOT-1']); - $company = $this->company(); - // Send notification details to admin - $this->send_notification_to_admin($company); - // Send notification details to team lead - $this->send_notification_to_team_lead($company); - // Send notification details to manager of a department - $this->send_notification_to_manager($company); - // Send notification details to all the agents - $this->send_notification_to_agent($company); - } - } - } + /** + * This function is for sending daily report/notification about the system + * */ + public function send_notification() { + //fetching email settings + $email = Email::where('id', '=', '1')->first(); + // 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 + $notification = Log_notification::where('log', '=', 'NOT-1')->orderBy('id', 'DESC')->first(); + $date = explode(" ", $notification->created_at); + if (Date('Y-m-d') == $date[0]) { + + } else { + // creating a daily notification log + Log_notification::create(['log' => 'NOT-1']); + $company = $this->company(); + // Send notification details to admin + $this->send_notification_to_admin($company); + // Send notification details to team lead + $this->send_notification_to_team_lead($company); + // Send notification details to manager of a department + $this->send_notification_to_manager($company); + // Send notification details to all the agents + $this->send_notification_to_agent($company); + } + } + } - /** - * Admin Notification/Report - * @param company - * @return mail - **/ - public function send_notification_to_admin($company) { - // get all admin users - $users = User::where('role','=','admin')->get(); - foreach ($users as $user) { - // Send notification details to admin - $email = $user->email; - $user_name = $user->first_name . " " . $user->last_name; - \Mail::send('emails.notifications.admin', ['company' => $company, 'name'=>$user_name], function ($message)use ($email, $user_name, $company) { - $message->to($email, $user_name)->subject($company . ' Daily Report '); - }); - } - } + /** + * Admin Notification/Report + * @param company + * @return mail + * */ + public function send_notification_to_admin($company) { + // get all admin users + $users = User::where('role', '=', 'admin')->get(); + foreach ($users as $user) { + // Send notification details to admin + $email = $user->email; + $user_name = $user->first_name . " " . $user->last_name; + \Mail::send('emails.notifications.admin', ['company' => $company, 'name' => $user_name], function ($message)use ($email, $user_name, $company) { + $message->to($email, $user_name)->subject($company . ' Daily Report '); + }); + } + } - /** - * Department Manager Notification/Report - * @return mail - **/ - public function send_notification_to_manager($company) { - // get all department managers - $depts = Department::all(); - foreach ($depts as $dept) { - if(isset($dept->manager)) { - $dept_name = $dept->name; - $users = User::where('id','=',$dept->manager)->get(); - foreach ($users as $user) { - // Send notification details to manager of a department - $email = $user->email; - $user_name = $user->first_name . " " . $user->last_name; - \Mail::send('emails.notifications.manager', ['company' => $company, 'name'=>$user_name,'dept_id' => $dept->id, 'dept_name' => $dept->name], function ($message)use ($email, $user_name, $company, $dept_name) { - $message->to($email, $user_name)->subject($company . ' Daily Report for department manager of '. $dept_name.' department.'); - }); - } - } - } - } + /** + * Department Manager Notification/Report + * @return mail + * */ + public function send_notification_to_manager($company) { + // get all department managers + $depts = Department::all(); + foreach ($depts as $dept) { + if (isset($dept->manager)) { + $dept_name = $dept->name; + $users = User::where('id', '=', $dept->manager)->get(); + foreach ($users as $user) { + // Send notification details to manager of a department + $email = $user->email; + $user_name = $user->first_name . " " . $user->last_name; + \Mail::send('emails.notifications.manager', ['company' => $company, 'name' => $user_name, 'dept_id' => $dept->id, 'dept_name' => $dept->name], function ($message)use ($email, $user_name, $company, $dept_name) { + $message->to($email, $user_name)->subject($company . ' Daily Report for department manager of ' . $dept_name . ' department.'); + }); + } + } + } + } - /** - * Team Lead Notification/Report - * @return mail - **/ - public function send_notification_to_team_lead($company) { - // get all Team leads - $teams = Teams::all(); - foreach ($teams as $team) { - if(isset($team->team_lead)) { - $team_name = $team->name; - $users = User::where('id','=',$team->team_lead)->get(); - foreach ($users as $user) { - // Send notification details to team lead - $email = $user->email; - $user_name = $user->first_name . " " . $user->last_name; - \Mail::send('emails.notifications.lead', ['company' => $company, 'name'=>$user_name,'team_id' => $team->id], function ($message)use ($email, $user_name, $company, $team_name) { - $message->to($email, $user_name)->subject($company . ' Daily Report for Team Lead of team '. $team_name); - }); - } - } - } - } + /** + * Team Lead Notification/Report + * @return mail + * */ + public function send_notification_to_team_lead($company) { + // get all Team leads + $teams = Teams::all(); + foreach ($teams as $team) { + if (isset($team->team_lead)) { + $team_name = $team->name; + $users = User::where('id', '=', $team->team_lead)->get(); + foreach ($users as $user) { + // Send notification details to team lead + $email = $user->email; + $user_name = $user->first_name . " " . $user->last_name; + \Mail::send('emails.notifications.lead', ['company' => $company, 'name' => $user_name, 'team_id' => $team->id], function ($message)use ($email, $user_name, $company, $team_name) { + $message->to($email, $user_name)->subject($company . ' Daily Report for Team Lead of team ' . $team_name); + }); + } + } + } + } - /** - * Agent Notification/Report - * @return mail - **/ - public function send_notification_to_agent($company) { - // get all agents users - $users = User::where('role','=','agent')->get(); - foreach ($users as $user) { - // Send notification details to all the agents - $email = $user->email; - $user_name = $user->first_name . " " . $user->last_name; - \Mail::send('emails.notifications.agent', ['company' => $company, 'name'=>$user_name, 'user_id' => 1], function ($message)use ($email, $user_name, $company) { - $message->to($email, $user_name)->subject($company . ' Daily Report for Agents'); - }); - } - } + /** + * Agent Notification/Report + * @return mail + * */ + public function send_notification_to_agent($company) { + // get all agents users + $users = User::where('role', '=', 'agent')->get(); + foreach ($users as $user) { + // Send notification details to all the agents + $email = $user->email; + $user_name = $user->first_name . " " . $user->last_name; + \Mail::send('emails.notifications.agent', ['company' => $company, 'name' => $user_name, 'user_id' => 1], function ($message)use ($email, $user_name, $company) { + $message->to($email, $user_name)->subject($company . ' Daily Report for Agents'); + }); + } + } - /** - * Fetching company name - * @return type variable - */ - public function company() { - // fetching comapny model - $company = Company::Where('id','=','1')->first(); - // fetching company name - if($company->company_name == null){ - $company = "Support Center"; - }else{ - $company = $company->company_name; - } - return $company; - } + /** + * Fetching company name + * @return type variable + */ + public function company() { + // fetching comapny model + $company = Company::Where('id', '=', '1')->first(); + // fetching company name + if ($company->company_name == null) { + $company = "Support Center"; + } else { + $company = $company->company_name; + } + return $company; + } - // // testing - // public function test(){ - // $email = "sujit.prasad@ladybirdweb.com"; - // $user_name = "sujit prasad"; - // \Mail::send('emails.notifications.test', ['user_id' => 1], function ($message) use($email, $user_name) { - // $message->to($email, $user_name)->subject('testing reporting'); - // }); - // } - -} \ No newline at end of file + // // testing + // public function test(){ + // $email = "sujit.prasad@ladybirdweb.com"; + // $user_name = "sujit prasad"; + // \Mail::send('emails.notifications.test', ['user_id' => 1], function ($message) use($email, $user_name) { + // $message->to($email, $user_name)->subject('testing reporting'); + // }); + // } +} diff --git a/app/Http/Controllers/Agent/helpdesk/OrganizationController.php b/app/Http/Controllers/Agent/helpdesk/OrganizationController.php index c7b033312..a2d4d71e9 100644 --- a/app/Http/Controllers/Agent/helpdesk/OrganizationController.php +++ b/app/Http/Controllers/Agent/helpdesk/OrganizationController.php @@ -1,13 +1,14 @@ -middleware('auth'); + $this->middleware('auth'); // checking if the role is agent - $this->middleware('role.agent'); - } + $this->middleware('role.agent'); + } - /** - * Display a listing of the resource. - * @param type Organization $org - * @return type Response - */ - public function index() { - try { - /* get all values of table organization */ - return view('themes.default1.agent.helpdesk.organization.index'); - } catch (Exception $e) { - return view('404'); - } - } + /** + * Display a listing of the resource. + * @param type Organization $org + * @return type Response + */ + public function index() { + try { + /* get all values of table organization */ + return view('themes.default1.agent.helpdesk.organization.index'); + } catch (Exception $e) { + return view('404'); + } + } - /** - * This function is used to display the list of Organizations - * @return datatable - */ - public function org_list() { - // chumper datable package call to display Advance datatable - return \Datatable::collection(Organization::all()) - /* searchable name */ - ->searchColumns('name') - /* order by name and website */ - ->orderColumns('name', 'website') - /* column name */ - ->addColumn('name', function ($model) { - // return $model->name; - if(strlen($model->name) > 20) { - $orgname = substr($model->name, 0, 25); - $orgname = substr($orgname, 0, strrpos($orgname, ' ')).' ...'; - } else { - $orgname = $model->name; - } - return $orgname; - }) - /* column website */ - ->addColumn('website', function ($model) { - $website = $model->website; - return $website; - }) - /* column phone number */ - ->addColumn('phone', function ($model) { - $phone = $model->phone; - return $phone; - }) - /* column action buttons */ - ->addColumn('Actions', function ($model) { - // displaying action buttons - // modal popup to delete data - return ' ' . \Lang::get('lang.edit') . ' ' . \Lang::get('lang.view') . ' -
    - {!! Form::radio('fetching_status','1',true) !!}{{Lang::get('lang.enable')}} + {!! Form::radio('fetching_status','1',true) !!} {{Lang::get('lang.enable')}}
    - {!! Form::radio('fetching_status','0',null) !!}{{Lang::get('lang.disabled')}} + {!! Form::radio('fetching_status','0',null) !!} {{Lang::get('lang.disabled')}}
    @@ -178,6 +178,69 @@ class="active" +
    + +
    + +
    + +

    Sending Email via SMTP

    + +
    + +
    + +
    + +
    + +
    + {!! Form::label('sending_status',Lang::get('lang.status')) !!} +
    +
    + {!! Form::radio('sending_status','1',true) !!} {{Lang::get('lang.enable')}} +
    +
    + {!! Form::radio('sending_status','0',null) !!} {{Lang::get('lang.disabled')}} +
    + +
    + +
    + +
    + +
    + + {!! Form::label('sending_host',Lang::get('lang.host_name')) !!} + {!! $errors->first('sending_host', ':message') !!} + {!! Form::text('sending_host',null,['class' => 'form-control']) !!} + +
    + + +
    + + {!! Form::label('sending_port',Lang::get('lang.port_number')) !!} + {!! $errors->first('sending_port', ':message') !!} + {!! Form::text('sending_port',null,['class' => 'form-control']) !!} + +
    + + +
    + + {!! Form::label('sending_encryption',Lang::get('lang.encryption')) !!} + {!! $errors->first('sending_encryption', ':message') !!} + {!!Form::select('sending_encryption',['ssl'=>'SSL','tls'=>'TLS'],null,['class' => 'form-control select']) !!} + + +
    + +
    + + +
    diff --git a/resources/views/themes/default1/admin/helpdesk/emails/emails/index.blade.php b/resources/views/themes/default1/admin/helpdesk/emails/emails/index.blade.php index b16f2093d..893e9bc3a 100644 --- a/resources/views/themes/default1/admin/helpdesk/emails/emails/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/emails/emails/index.blade.php @@ -55,6 +55,15 @@ class="active" {{Session::get('fails')}}
    @endif + + first(); + if($default_system_email->sys_email) { + $default_email = $default_system_email->sys_email; + } else { + $default_email = null; + } + ?> @@ -67,26 +76,39 @@ class="active" @foreach($emails as $email) - + + priority)->first(); ?> - + @if($email->priority == null) + System Default"; ?> + @else + priority_desc); ?> + @endif + @if($email->department !== null) department)->first(); $dept = $department->name; ?> @elseif($email->department == null) - + System Default"; ?> @endif - - - - + + + +
    {{$email -> email_address }} {{$email -> email_address }} + @if($default_email == $email->id) + ( Default ) + + @else + + @endif + {{ ucfirst($priority->priority_desc) }}{!! $priority !!}{{ $dept }}{{ UTC::usertimezone($email->created_at) }}{{ UTC::usertimezone($email->updated_at) }}{!! $dept !!}{!! UTC::usertimezone($email->created_at) !!}{!! UTC::usertimezone($email->updated_at) !!} {!! Form::open(['route'=>['emails.destroy', $email->id],'method'=>'DELETE']) !!} Edit {!! Form::button(' Delete', ['type' => 'submit', - 'class'=> 'btn btn-warning btn-xs btn-flat', + 'class'=> 'btn btn-warning btn-xs btn-flat '. $disabled, 'onclick'=>'return confirm("Are you sure?")']) !!} {!! Form::close() !!} @@ -98,5 +120,4 @@ class="active" - @stop diff --git a/resources/views/themes/default1/admin/helpdesk/emails/template/listtemplates.blade.php b/resources/views/themes/default1/admin/helpdesk/emails/template/listtemplates.blade.php index 8c34936b3..d2a28028a 100644 --- a/resources/views/themes/default1/admin/helpdesk/emails/template/listtemplates.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/emails/template/listtemplates.blade.php @@ -32,42 +32,10 @@ class="active"
    - - - - -
    - -
    +
    @@ -89,10 +57,10 @@ class="active"
    @endif - +
    - - + + @@ -100,11 +68,10 @@ class="active" - + + - - @endforeach @@ -117,6 +84,21 @@ class="active" @stop @section('FooterInclude') + + @stop @stop diff --git a/resources/views/themes/default1/admin/helpdesk/emails/template/readtemplates.blade.php b/resources/views/themes/default1/admin/helpdesk/emails/template/readtemplates.blade.php index 39c2fd8ac..5fc17123d 100644 --- a/resources/views/themes/default1/admin/helpdesk/emails/template/readtemplates.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/emails/template/readtemplates.blade.php @@ -31,44 +31,12 @@ class="active"
    + {!! Form::model($contents,['route'=>['template.write', $template,$path],'method'=>'PATCH','files' => true]) !!}
    -

    {{Lang::get('lang.templates')}}

    Edit Template
    - -
    +

    {{Lang::get('lang.edit_template')}}:

    +
    +
    @@ -90,12 +58,12 @@ class="active"
    @endif -
    + - {!! nl2br($contents) !!} - -
    + {!! Form::textarea('templatedata',$contents,['class'=>'form-control'])!!} + + {!! Form::close() !!} @stop
    @section('FooterInclude') diff --git a/resources/views/themes/default1/admin/helpdesk/language/index.blade.php b/resources/views/themes/default1/admin/helpdesk/language/index.blade.php index e888386a4..d010a919e 100644 --- a/resources/views/themes/default1/admin/helpdesk/language/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/language/index.blade.php @@ -32,8 +32,8 @@ class="active" @section('content')
    diff --git a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/create.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/create.blade.php index e624eec98..5b05e5603 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/create.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/create.blade.php @@ -53,8 +53,8 @@ class="active" {!! Form::label('ticket_status',Lang::get('lang.status')) !!}   {!! $errors->first('ticket_status', ':message') !!} - {!! Form::radio('ticket_status','1',true) !!}{{Lang::get('lang.active')}}    - {!! Form::radio('ticket_status','0') !!}{{Lang::get('lang.disabled')}} + {!! Form::radio('ticket_status','1',true) !!} {{Lang::get('lang.active')}}    + {!! Form::radio('ticket_status','0') !!} {{Lang::get('lang.disabled')}}
    @@ -64,8 +64,8 @@ class="active" {!! Form::label('type',Lang::get('lang.type')) !!}   {!! $errors->first('type', ':message') !!} - {!! Form::radio('type','1',true) !!}{{Lang::get('lang.public')}}    - {!! Form::radio('type','0') !!}{{Lang::get('lang.private')}} + {!! Form::radio('type','1',true) !!} {{Lang::get('lang.public')}}    + {!! Form::radio('type','0') !!} {{Lang::get('lang.private')}}
    diff --git a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/edit.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/edit.blade.php index f411688ad..6a24b4b6d 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/helptopic/edit.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/helptopic/edit.blade.php @@ -47,8 +47,8 @@ class="active" {!! Form::label('ticket_status',Lang::get('lang.status')) !!}   {!! $errors->first('ticket_status', ':message') !!} - {!! Form::radio('ticket_status','1',true) !!}{{Lang::get('lang.active')}}    - {!! Form::radio('ticket_status','0') !!}{{Lang::get('lang.disabled')}} + {!! Form::radio('ticket_status','1',true) !!} {{Lang::get('lang.active')}}    + {!! Form::radio('ticket_status','0') !!} {{Lang::get('lang.disabled')}} @@ -58,8 +58,8 @@ class="active" {!! Form::label('type',Lang::get('lang.type')) !!}   {!! $errors->first('type', ':message') !!} - {!! Form::radio('type','1',true) !!}{{Lang::get('lang.public')}}    - {!! Form::radio('type','0') !!}{{Lang::get('lang.private')}} + {!! Form::radio('type','1',true) !!} {{Lang::get('lang.public')}}    + {!! Form::radio('type','0') !!} {{Lang::get('lang.private')}} diff --git a/resources/views/themes/default1/admin/helpdesk/manage/sla/create.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/sla/create.blade.php index 963af44a9..f35529382 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/sla/create.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/sla/create.blade.php @@ -72,8 +72,8 @@ class="active" {!! Form::label('status',Lang::get('lang.status')) !!}  {!! $errors->first('status', ':message') !!} - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.active')}}   - {!! Form::radio('status','0') !!}{{Lang::get('lang.disabled')}} + {!! Form::radio('status','1',true) !!} {{Lang::get('lang.active')}}   + {!! Form::radio('status','0') !!} {{Lang::get('lang.disabled')}} diff --git a/resources/views/themes/default1/admin/helpdesk/manage/sla/edit.blade.php b/resources/views/themes/default1/admin/helpdesk/manage/sla/edit.blade.php index 01596dd7c..5cc7cd13d 100644 --- a/resources/views/themes/default1/admin/helpdesk/manage/sla/edit.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/manage/sla/edit.blade.php @@ -72,8 +72,8 @@ class="active" {!! Form::label('status',Lang::get('lang.status')) !!}  {!! $errors->first('status', ':message') !!} - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.active')}}   - {!! Form::radio('status','0') !!}{{Lang::get('lang.disabled')}} + {!! Form::radio('status','1',true) !!} {{Lang::get('lang.active')}}   + {!! Form::radio('status','0') !!} {{Lang::get('lang.disabled')}} diff --git a/resources/views/themes/default1/admin/helpdesk/setting.blade.php b/resources/views/themes/default1/admin/helpdesk/setting.blade.php index d67afd767..7220f6cd0 100644 --- a/resources/views/themes/default1/admin/helpdesk/setting.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/setting.blade.php @@ -105,25 +105,12 @@ - -
    -
    -
    - - - -
    -
    {!! Lang::get('lang.outgoing_emails') !!}
    -
    -
    -
    @@ -131,17 +118,21 @@
    - +
    {!! Lang::get('lang.templates') !!}
    -
    --> + + +
    @@ -367,7 +358,7 @@
    -
    {!! Lang::get('lang.widgets') !!}
    +
    {!! Lang::get('lang.social') !!}
    diff --git a/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php index f68608480..3746216e1 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php @@ -65,7 +65,7 @@ class="active"
    -
    +
    {{--
    --}} {{--
    --}} @@ -76,13 +76,15 @@ class="active" {{--
    --}} - {{--
    --}} - {{--
    --}} - {{-- {!! Form::label('sys_email',Lang::get('lang.default_system_email')) !!} --}} - {{-- {!! $errors->first('sys_email', ':message') !!} --}} - {{-- {!!Form::select('sys_email', $emails1->lists('email_address','email_address'),null,['class'=>'form-control']) !!} --}} - {{--
    --}} - {{--
    --}} +
    +
    +
    + {!! Form::label('sys_email',Lang::get('lang.default_system_email')) !!} + {!! $errors->first('sys_email', ':message') !!} + {!!Form::select('sys_email', $emails1->lists('email_name','id'),null,['class'=>'form-control']) !!} +
    +
    +
    {{--
    --}} diff --git a/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php deleted file mode 100644 index c8b22d21d..000000000 --- a/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php +++ /dev/null @@ -1,171 +0,0 @@ -@extends('themes.default1.admin.layout.admin') - -@section('Settings') -class="active" -@stop - -@section('settings-bar') -active -@stop - -@section('system') -class="active" -@stop - -@section('HeadInclude') - -@stop - -@section('PageHeader') - -@stop - - -@section('breadcrumbs') - -@stop - - -@section('content') - -
    -
    -

    {{Lang::get('lang.ratings')}}

    -
    -@if(Session::has('success')) -
    - - Success! - - {{Session::get('success')}} -
    - @endif - - @if(Session::has('fails')) -
    - - Fail! - - {{Session::get('fails')}} -
    - @endif - -
    -
    {{Lang::get('lang.name')}}{{Lang::get('lang.name')}}{{Lang::get('lang.description')}}
    {!! $template !!}{{ Lang::get('lang.'.$cname) }}
    - - - - - - - - - - - - @foreach($ratings as $rating) - - - - - - - - - @endforeach - -
    IDTitleAction
    {!! $rating->id !!}{!! $rating->rating_name !!} - - - - - - - - -
    - -
    - @stop -
    \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php index 1a5d32dfc..78605a9e3 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/system.blade.php @@ -71,10 +71,10 @@ class="active" {!! Form::label('status',Lang::get('lang.status')) !!}
    - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.online')}} + {!! Form::radio('status','1',true) !!} {{Lang::get('lang.online')}}
    - {!! Form::radio('status','0') !!}{{Lang::get('lang.offline')}} + {!! Form::radio('status','0') !!} {{Lang::get('lang.offline')}}
    diff --git a/resources/views/themes/default1/admin/helpdesk/settings/ticket.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/ticket.blade.php index 946a4ff11..45082b666 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/ticket.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/ticket.blade.php @@ -51,7 +51,7 @@ class="active" Success! - {{Session::get('success')}} + {!! Session::get('success') !!} @endif @@ -60,7 +60,7 @@ class="active" Fail! - {{Session::get('fails')}} + {!! Session::get('fails') !!} @endif @@ -104,7 +104,7 @@ class="active" -
    +
    {!! Form::label('priority',Lang::get('lang.default_priority')) !!} {!! $errors->first('priority', ':message') !!} @@ -113,7 +113,7 @@ class="active"
    -
    +
    {!! Form::label('sla',Lang::get('lang.default_sla')) !!} {!! $errors->first('sla', ':message') !!} @@ -122,7 +122,7 @@ class="active"
    -
    +
    {!! Form::label('help_topic',Lang::get('lang.default_help_topic')) !!} {!! $errors->first('help_topic', ':message') !!} @@ -140,13 +140,18 @@ class="active" {{--
    --}} - {{--
    --}} - {{--
    --}} - {{-- {!! Form::label('collision_avoid',Lang::get('lang.agent_collision_avoidance_duration')) !!} --}} - {{-- {!! $errors->first('collision_avoid', ':message') !!} --}} - {{-- {!! Form::text('collision_avoid',$tickets->collision_avoid,['class' => 'form-control']) !!} --}} - {{--
    --}} - {{--
    --}} +
    +
    + {!! Form::label('collision_avoid',Lang::get('lang.agent_collision_avoidance_duration')) !!} + {!! $errors->first('collision_avoid', ':message') !!} +
    + +
    + {!!Lang::get('lang.in_minutes')!!} +
    +
    +
    +
    diff --git a/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php b/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php index 78502835c..683e0e7d7 100644 --- a/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php @@ -26,17 +26,74 @@ class="active"
    - @if(Session::has('content')) +
    +
    +
    + +
    + + {!! Form::label('date', 'Date:') !!} + + {!! Form::text('start_date',null,['class'=>'form-control','id'=>'datepicker4'])!!} + +
    + first(); + if($start_date != null) { + $created_date = $start_date->created_at; + $created_date = explode(' ', $created_date); + $created_date = $created_date[0]; + $start_date = date("m/d/Y",strtotime($created_date.' -1 months')); + } else { + $start_date = date("m/d/Y",strtotime(date("m/d/Y").' -1 months')); + } + + ?> + + +
    + + {!! Form::label('start_time', 'End Date:') !!} + + {!! Form::text('end_date',null,['class'=>'form-control','id'=>'datetimepicker3'])!!} + +
    + + +
    + {!! Form::label('filter', 'Filter:') !!}
    + +
    +
    +
    +
    +
    -
    - + +
    - @else -
    -
    - -
    - @endif +

    @@ -84,8 +141,8 @@ $delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id -{{-- --}} @stop \ No newline at end of file diff --git a/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php index 0d26a95b0..b6661cf07 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php @@ -12,7 +12,6 @@ active class="active" @stop - @section('content') {!! Form::open(['route'=>'post.newticket','method'=>'post']) !!} @@ -221,4 +220,8 @@ class="active" - @stop \ No newline at end of file + @stop + + + + diff --git a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php index 065dd6161..18674628b 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php @@ -45,16 +45,30 @@ active
  • {!! Lang::get('lang.ticket_ratings') !!} -
  • - - -
    - {!! $tickets->rating !!}
    - - -

    - {!! $tickets->ratingreply !!}

    -
  • + +
  • + + Overall Rating: + + rating=='1')?'checked':'' ?> /> + rating=='2')?'checked':'' ?> /> + rating=='3')?'checked':'' ?>/> + rating=='4')?'checked':'' ?>/> + rating=='5')?'checked':'' ?> /> + + +
  • +
  • + Reply Rating: + + ratingreply=='1')?'checked':'' ?> /> + ratingreply=='2')?'checked':'' ?> /> + ratingreply=='3')?'checked':'' ?> /> + ratingreply=='4')?'checked':'' ?> /> + ratingreply=='5')?'checked':'' ?> /> + + +
  • @stop @section('content') @@ -335,7 +349,7 @@ $canneds = App\Model\helpdesk\Agent_panel\Canned::where('user_id','=',Auth::user
    - +
    @@ -1063,31 +1077,16 @@ $count_teams = count($teams);
    - +first(); ?> diff --git a/resources/views/themes/default1/agent/helpdesk/user/create.blade.php b/resources/views/themes/default1/agent/helpdesk/user/create.blade.php index 9398f22a4..d579cdafc 100644 --- a/resources/views/themes/default1/agent/helpdesk/user/create.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/user/create.blade.php @@ -100,10 +100,10 @@ class="active" {!! $errors->first('active', ':message') !!}
    - {!! Form::radio('active','1',true) !!}{{Lang::get('lang.active')}} + {!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
    - {!! Form::radio('active','0') !!}{{Lang::get('lang.inactive')}} + {!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
    diff --git a/resources/views/themes/default1/agent/helpdesk/user/edit.blade.php b/resources/views/themes/default1/agent/helpdesk/user/edit.blade.php index 72ef7dc42..af06f18fd 100644 --- a/resources/views/themes/default1/agent/helpdesk/user/edit.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/user/edit.blade.php @@ -87,10 +87,10 @@ class="active" {!! $errors->first('active', ':message') !!}
    - {!! Form::radio('active','1',true) !!}{{Lang::get('lang.active')}} + {!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
    - {!! Form::radio('active','0') !!}{{Lang::get('lang.inactive')}} + {!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
    @@ -103,10 +103,10 @@ class="active"
    - {!! Form::radio('ban','1',true) !!}{{Lang::get('lang.enable')}} + {!! Form::radio('ban','1',true) !!} {{Lang::get('lang.enable')}}
    - {!! Form::radio('ban','0') !!}{{Lang::get('lang.disable')}} + {!! Form::radio('ban','0') !!} {{Lang::get('lang.disable')}}
    diff --git a/resources/views/themes/default1/agent/helpdesk/user/profile-edit.blade.php b/resources/views/themes/default1/agent/helpdesk/user/profile-edit.blade.php index cc0c023d3..15708670c 100644 --- a/resources/views/themes/default1/agent/helpdesk/user/profile-edit.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/user/profile-edit.blade.php @@ -68,10 +68,10 @@ class="active" {!! Form::label('gender',Lang::get('lang.gender')) !!}
    - {!! Form::radio('gender','1',true) !!}{{Lang::get('lang.male')}} + {!! Form::radio('gender','1',true) !!} {{Lang::get('lang.male')}}
    - {!! Form::radio('gender','0') !!}{{Lang::get('lang.female')}} + {!! Form::radio('gender','0') !!} {{Lang::get('lang.female')}}
    diff --git a/resources/views/themes/default1/agent/kb/article/create.blade.php b/resources/views/themes/default1/agent/kb/article/create.blade.php index 3e513be77..4e0804a7f 100644 --- a/resources/views/themes/default1/agent/kb/article/create.blade.php +++ b/resources/views/themes/default1/agent/kb/article/create.blade.php @@ -2,16 +2,17 @@ @extends('themes.default1.agent.layout.sidebar') @section('article') - active +active @stop @section('add-article') - class="active" +class="active" @stop @section('content') + {!! Form::open(array('action' => 'Agent\kb\ArticleController@store' , 'method' => 'post') )!!}
    - @if(Session::has('success')) + @if(Session::has('success'))
    Success @@ -35,153 +36,203 @@ {!! Lang::get('lang.create_a_category') !!}
    @endif - -
    -
    -
    -
    -

    {!! Lang::get('lang.addarticle') !!}

    -
    -
    -
    -
    - - {!! Form::label('name',Lang::get('lang.name')) !!} - {!! $errors->first('name', ':message') !!} - {!! Form::text('name',null,['class' => 'form-control']) !!} -
    - -
    - - {!! Form::label('slug',Lang::get('lang.slug')) !!} - {!! $errors->first('slug', ':message') !!} - {!! Form::text('slug',null,['class' => 'form-control']) !!} -
    -
    - -
    - {!! Form::label('description',Lang::get('lang.description')) !!} - {!! $errors->first('description', ':message') !!} -
    - {!! Form::textarea('description',null,['class' => 'form-control color','size' => '128x20','id'=>'myNicEditor','placeholder'=>Lang::get('lang.enter_the_description')]) !!} -
    -
    -
    -
    - -
    - -
      -
    • -
      -
      -
      -

      {{Lang::get('lang.publish')}}

      -
      -
      -
      - - {!! Form::label('type',Lang::get('lang.status')) !!} - {!! $errors->first('type', ':message') !!} -
      -
      - {!! Form::radio('type','1',true) !!}{{Lang::get('lang.published')}} -
      -
      - {!! Form::radio('type','0',null) !!}{{Lang::get('lang.draft')}} -
      -
      -
      - - -
      - - {!! Form::label('status',Lang::get('lang.visibility')) !!} - {!! $errors->first('status', ':message') !!} -
      -
      - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.public')}} -
      -
      -
      - {!! Form::radio('status','0',null) !!}{{Lang::get('lang.private')}} -
      -
      - -
      - -
      -
      - - -
    • -
    • -
      -
      -
      -

      {{Lang::get('lang.category')}}

      +
      +
      +
      +
      +

      {!! Lang::get('lang.addarticle') !!}

      -
      +
      +
      -
      - {{-- {!! Form::label('category_id','Category') !!} --}} - {!! $errors->first('category_id', ':message') !!} - @while (list($key, $val) = each($category)) -
      -
      -
      - -
      -
      - -
      -
      -
      - @endwhile +
      -
      -
      - {!! Form::close() !!} - - {{Lang::get('lang.addcategory')}} - -
      -
      -
      -
    • -
    - -{{-- {!! Form::close() !!} --}} -@stop + +
    + {!! Form::label('description',Lang::get('lang.description')) !!} + {!! $errors->first('description', ':message') !!} +
    + {!! Form::textarea('description',null,['class' => 'form-control','id'=>'editor','size' => '128x20','placeholder'=>Lang::get('lang.enter_the_description')]) !!} +
    + +
    +
    +
    + + + +
      +
    • +
      +
      +
      +

      {{Lang::get('lang.publish')}}

      +
      +
      +
      + + {!! Form::label('type',Lang::get('lang.status')) !!} + {!! $errors->first('type', ':message') !!} +
      +
      + {!! Form::radio('type','1',true) !!} +
      +
      + {{Lang::get('lang.published')}} +
      +
      + {!! Form::radio('type','0',null) !!} +
      +
      + {{Lang::get('lang.draft')}} +
      +
      +
      + + +
      + + {!! Form::label('status',Lang::get('lang.visibility')) !!} + {!! $errors->first('status', ':message') !!} +
      +
      + {!! Form::radio('status','1',true) !!} +
      +
      + {{Lang::get('lang.public')}} +
      + +
      +
      + {!! Form::radio('status','0',null) !!} +
      +
      + {{Lang::get('lang.private')}} +
      +
      + +
      + +
      + + + + first()->date_time_format; + $format = \App\Model\helpdesk\Utility\Time_format::where('id',$format)->first()->format; + $tz = App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone; + $tz = App\Model\helpdesk\Utility\Timezones::where('id',$tz)->first()->name; + date_default_timezone_set($tz); + $date = date($format); + $dateparse = date_parse_from_format($format, $date); + //dd($dateparse); + $month = $dateparse['month']; + $day = $dateparse['day']; + $year = $dateparse['year']; + $hour = $dateparse['hour']; + $minute = $dateparse['minute']; +// echo $date; + ?> +
      +
      + {!! Form::label('month','Publish Immediately') !!} +
      +
      + + + {!! Form::selectMonth('month', $month) !!} + {!! Form::selectRange('day', 1, 31, $day) !!} + + {!! Form::selectYear('year', 2015,2035,null) !!}@ + : + +
      + + +
      +
      + + +
    • +
    • +
      +
      +
      +

      {{Lang::get('lang.category')}}

      +
      +
      + +
      + {{-- {!! Form::label('category_id','Category') !!} --}} + {!! $errors->first('category_id', ':message') !!} + @while (list($key, $val) = each($category)) +
      +
      +
      + +
      +
      + +
      +
      +
      + @endwhile + +
      +
      + {!! Form::close() !!} + +
      +
      +
    • +
    + + @stop diff --git a/resources/views/themes/default1/agent/kb/article/edit.blade.php b/resources/views/themes/default1/agent/kb/article/edit.blade.php index 2fda7ae9f..c30f934d8 100644 --- a/resources/views/themes/default1/agent/kb/article/edit.blade.php +++ b/resources/views/themes/default1/agent/kb/article/edit.blade.php @@ -1,177 +1,224 @@ @extends('themes.default1.agent.layout.agent') @extends('themes.default1.agent.layout.sidebar') @section('article') - active +active @stop @section('all-article') - class="active" +class="active" @stop @section('content') + {!! Form::model($article,['url' => 'article/'.$article->id , 'method' => 'PATCH'] )!!}
    -
    - @if(Session::has('success')) -
    - - Success - - {{Session::get('success')}} -
    - @endif - - @if(Session::has('fails')) -
    - - Fail! - - {{Session::get('fails')}} -
    - @endif -
    -
    -
    -
    - {!! Form::label('name',Lang::get('lang.name')) !!} - {!! $errors->first('name', ':message') !!} - {!! Form::text('name',null,['class' => 'form-control']) !!} -
    -
    - {!! Form::label('slug',Lang::get('lang.slug')) !!} - {!! $errors->first('slug', ':message') !!} - {!! Form::text('slug',null,['class' => 'form-control']) !!} -
    -
    - -
    - {!! Form::label('description',Lang::get('lang.description')) !!} - {!! $errors->first('description', ':message') !!} -
    - {!! Form::textarea('description',null,['class' => 'form-control','size' => '128x20','id'=>'myNicEditor','placeholder'=>'Enter the description']) !!} -
    -
    -
    -
    -
    - -
      -
    • -
      -
      -
      -

      {{Lang::get('lang.publish')}}

      -
      -
      -
      - - {!! Form::label('type',Lang::get('lang.status')) !!} - {!! $errors->first('type', ':message') !!} -
      -
      - {!! Form::radio('type','1',true) !!}{{Lang::get('lang.published')}} -
      -
      - {!! Form::radio('type','0',null) !!}{{Lang::get('lang.draft')}} -
      -
      -
      - - -
      - - {!! Form::label('status',Lang::get('lang.visibility')) !!} - {!! $errors->first('status', ':message') !!} -
      -
      - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.public')}} -
      -
      -
      - {!! Form::radio('status','0',null) !!}{{Lang::get('lang.private')}} -
      -
      - -
      - -
      -
      - {!! Form::close() !!} - - -
    • -
    • -
      -
      -
      -

      {{Lang::get('lang.category')}}

      +
      + @if(Session::has('success')) +
      + + Success + + {{Session::get('success')}} +
      + @endif + + @if(Session::has('fails')) +
      + + Fail! + + {{Session::get('fails')}} +
      + @endif +
      +
      +
      +
      + {!! Form::label('name',Lang::get('lang.name')) !!} + {!! $errors->first('name', ':message') !!} + {!! Form::text('name',null,['class' => 'form-control']) !!} +
      +
      + {!! Form::label('slug',Lang::get('lang.slug')) !!} + {!! $errors->first('slug', ':message') !!} + {!! Form::text('slug',null,['class' => 'form-control']) !!} +
      -
      -
      - {{-- {!! Form::label('category_id','Category') !!} --}} - {!! $errors->first('category_id', ':message') !!} - @while (list($key, $val) = each($category)) -
      -
      -
      - >
      -
      - -
      -
      -
      - @endwhile +
      + {!! Form::label('description',Lang::get('lang.description')) !!} + {!! $errors->first('description', ':message') !!} +
      + {!! Form::textarea('description',$article->description,['class' => 'form-control','id'=>'editor','size' => '128x20','placeholder'=>Lang::get('lang.enter_the_description')]) !!} +
      + +
      +
      +
      +
      -
      -
      +
        +
      • +
        +
        +
        +

        {{Lang::get('lang.publish')}}

        +
        +
        +
        - -
        +
      • +
      • +
        +
        +
        +

        {{Lang::get('lang.category')}}

        +
        +
        -
      • -
      +
      + {{-- {!! Form::label('category_id','Category') !!} --}} + {!! $errors->first('category_id', ':message') !!} + @while (list($key, $val) = each($category)) +
      +
      +
      + >
      +
      + +
      +
      +
      + @endwhile - +
      +
      + +
      +
      + +
    • +
    + + @stop + \ No newline at end of file diff --git a/resources/views/themes/default1/agent/kb/category/edit.blade.php b/resources/views/themes/default1/agent/kb/category/edit.blade.php index 67a9fb17c..fd4a446fd 100644 --- a/resources/views/themes/default1/agent/kb/category/edit.blade.php +++ b/resources/views/themes/default1/agent/kb/category/edit.blade.php @@ -68,10 +68,10 @@ {!! $errors->first('status', ':message') !!}
    - {!! Form::radio('status','1',true) !!}{{Lang::get('lang.active')}} + {!! Form::radio('status','1',true) !!} {{Lang::get('lang.active')}}
    - {!! Form::radio('status','0',null) !!}{{Lang::get('lang.inactive')}} + {!! Form::radio('status','0',null) !!} {{Lang::get('lang.inactive')}}
    diff --git a/resources/views/themes/default1/agent/layout/agent.blade.php b/resources/views/themes/default1/agent/layout/agent.blade.php index 7a3f8ba52..de5eff999 100644 --- a/resources/views/themes/default1/agent/layout/agent.blade.php +++ b/resources/views/themes/default1/agent/layout/agent.blade.php @@ -8,30 +8,6 @@ - - @@ -52,15 +28,15 @@ span.stars2 span { - + + + - - - + + @yield('HeadInclude') @@ -318,7 +294,9 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where( {!! Lang::get('lang.copyright') !!} © {!! date('Y') !!} {!! $company->company_name !!}. {!! Lang::get('lang.all_rights_reserved') !!}. {!! Lang::get('lang.powered_by') !!} Faveo - + {{-- // --}} + + {{-- // --}} @@ -347,6 +325,7 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where( + - + @@ -146,12 +147,6 @@ if (DB_HOST && DB_USER && DB_NAME) { - -

    - - Previous -

    -