diff --git a/app/Http/Controllers/Admin/helpdesk/SettingsController.php b/app/Http/Controllers/Admin/helpdesk/SettingsController.php index 9f3bd209c..4b3e18aea 100644 --- a/app/Http/Controllers/Admin/helpdesk/SettingsController.php +++ b/app/Http/Controllers/Admin/helpdesk/SettingsController.php @@ -27,6 +27,7 @@ use App\Model\helpdesk\Utility\Time_format; use Illuminate\Http\Request; use Input; use Exception; +use DB; /** * SettingsController @@ -54,7 +55,25 @@ class SettingsController extends Controller { 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 diff --git a/app/Http/Controllers/Admin/helpdesk/TemplateController.php b/app/Http/Controllers/Admin/helpdesk/TemplateController.php index 8bceb153e..2f29cd0df 100644 --- a/app/Http/Controllers/Admin/helpdesk/TemplateController.php +++ b/app/Http/Controllers/Admin/helpdesk/TemplateController.php @@ -13,6 +13,7 @@ use App\Model\helpdesk\Utility\Languages; use Illuminate\Http\Request; use Mail; use Exception; +use Input; /** * TemplateController @@ -101,6 +102,65 @@ class TemplateController extends Controller { * @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')); + } + 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; + +// images folder creation using php +// $mydir = dirname( __FILE__ )."/html/images"; +// if(!is_dir($mydir)){ +// mkdir("html/images"); +// } + // 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 edit($id, Template $template, Languages $language) { try { $templates = $template->whereId($id)->first(); diff --git a/app/Http/Controllers/Agent/helpdesk/DashboardController.php b/app/Http/Controllers/Agent/helpdesk/DashboardController.php index 65b707a10..1225864d0 100644 --- a/app/Http/Controllers/Agent/helpdesk/DashboardController.php +++ b/app/Http/Controllers/Agent/helpdesk/DashboardController.php @@ -59,51 +59,47 @@ class DashboardController extends Controller { * Fetching dashboard graph data to implement graph * @return type Json */ - public function ChartData() + public function ChartData($date111 = "",$date122 = "") { - - // $date11 = strtotime(\Input::get('start_date')); - // $date12 = strtotime(\Input::get('end_date')); - // if($date11 && $date12){ - // $date2 = $date12; - // $date1 = $date11; - // } else { + + $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,','); - $return = ""; - $last = ""; - // fetching dashboard data for each day on a 1 month fixed range - // this range can also be fetched on a requested rannge of date - for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) { - $thisDate = date( 'Y-m-d', $i ); - // created tickets - $created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count(); - // closed tickets - $closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count(); - // reopened tickets - $reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count(); - // storing in array format - $value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened]; - $array = array_map('htmlentities',$value); - // encoding the values in jsom format - $json = html_entity_decode(json_encode($array)); - $return .= $json.','; - } - // combining all the values in a single variable and returning that variable in 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 435a3f40e..0a1322b12 100644 --- a/app/Http/Controllers/Agent/helpdesk/MailController.php +++ b/app/Http/Controllers/Agent/helpdesk/MailController.php @@ -20,7 +20,7 @@ use App\Model\helpdesk\Ticket\Tickets; use PhpImap\Mailbox as ImapMailbox; use PhpImap\IncomingMail; use PhpImap\IncomingMailAttachment; -use \ForceUTF8\Encoding; +use ForceUTF8\Encoding; use App; use DB; use Crypt; @@ -28,7 +28,9 @@ use Schedule; use File; use Artisan; use Exception; - +use Phpmailer\PHPMailerautoload; +//$root = realpath($_SERVER["DOCUMENT_ROOT"]); +//include_once($root.'\vendor\phpmailer\phpmailer\PHPMailerautoload.php'); /** * MailController * @@ -51,6 +53,8 @@ class MailController extends Controller { * Reademails * @return type */ + + public function readmails(Emails $emails, Email $settings_email, System $system) { // $path_url = $system->first()->url; diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 01514501b..09fe3ab29 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -2182,5 +2182,15 @@ class TicketController extends Controller { return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id')); } } + public function rating($id,$rating) { + + Tickets::where('id', $id)->update(array('rating' => $rating)); + return redirect()->back()->with('Success','Thank you for your rating!'); + } + public function ratingReply($id,$rating) { + + Tickets::where('id', $id)->update(array('ratingreply' => $rating)); + return redirect()->back()->with('Success','Thank you for your rating!'); + } } diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index c3f8ea36a..d29ee9833 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -18,6 +18,7 @@ use Mail; use Auth; use Exception; + /** * --------------------------------------------------- * AuthController @@ -103,7 +104,8 @@ class AuthController extends Controller { }); return redirect('home')->with('success', 'Activate Your Account ! Click on Link that send to your mail'); } - + + /** * Get mail function * @param type $token diff --git a/app/Http/Controllers/PhpMailController.php b/app/Http/Controllers/PhpMailController.php new file mode 100644 index 000000000..f2adf7491 --- /dev/null +++ b/app/Http/Controllers/PhpMailController.php @@ -0,0 +1,119 @@ +SMTPDebug = 3; // Enable verbose debug output + + $mail->isSMTP(); // Set mailer to use SMTP + $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = 'sujitprasad4567@gmail.com'; // SMTP username + $mail->Password = 'pankajprasad22.'; // SMTP password + $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted + $mail->Port = 587; // TCP port to connect to + + $mail->setFrom('sujitprasad4567@gmail.com', 'Mailer'); + $mail->addAddress('sada059@gmail.com', 'Joe User'); // Add a recipient + // Name is optional + $mail->addReplyTo('sada059@gmail.com', 'Information'); + + + // Optional name + $mail->isHTML(true); // Set email format to HTML + + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + if (!$mail->send()) { + echo 'Message could not be sent.'; + echo 'Mailer Error: ' . $mail->ErrorInfo; + } else { + echo 'Message has been sent'; + } + } + + /** + * Show the form for creating a new resource. + * + * @return Response + */ + public function create() { + // + } + + /** + * Store a newly created resource in storage. + * + * @return Response + */ + public function store() { + // + } + + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) { + // + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return Response + */ + public function edit($id) { + // + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * @return Response + */ + public function update($id) { + // + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return Response + */ + public function destroy($id) { + // + } + +} diff --git a/app/Http/routes.php b/app/Http/routes.php index 65ddc7911..9130d8b71 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -58,7 +58,10 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () { Route::resource('banlist', 'Admin\helpdesk\BanlistController'); // in banlist module, for CRUD Route::resource('template', 'Admin\helpdesk\TemplateController'); // in template module, for CRUD - +Route::get('list-templates', 'Admin\helpdesk\TemplateController@listtemplates'); +Route::get('read-templates/{template}/{directory}',['as'=>'template.read','uses'=>'Admin\helpdesk\TemplateController@readtemplate']); +Route::patch('write-templates/{contents}/{directory}',['as'=>'template.write','uses'=>'Admin\helpdesk\TemplateController@writetemplate']); +Route::post('create-templates',['as'=>'template.createnew','uses'=>'Admin\helpdesk\TemplateController@createtemplate']); Route::get('getdiagno', 'Admin\helpdesk\TemplateController@formDiagno'); // for getting form for diagnostic Route::post('postdiagno', 'Admin\helpdesk\TemplateController@postDiagno'); // for getting form for diagnostic @@ -178,7 +181,7 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function () Route::get('agen1', 'Agent\helpdesk\DashboardController@ChartData'); - Route::post('chart-range', ['as' => 'post.chart', 'uses' => 'Agent\helpdesk\DashboardController@ChartData']); + Route::post('chart-range/{date1}/{date2}', ['as' => 'post.chart', 'uses' => 'Agent\helpdesk\DashboardController@ChartData']); Route::resource('user', 'Agent\helpdesk\UserController'); /* User router is used to control the CRUD of user */ @@ -216,7 +219,11 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function () Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\helpdesk\MailController@fetchdata']); /* Fetch Emails */ - Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */ + Route::post('rating/{id}/{rating}', ['as' => 'ticket.rating' , 'uses' => 'Agent\helpdesk\TicketController@rating']); /* Get overall Ratings */ + + Route::post('rating2/{id}/{rating}', ['as' => 'ticket.rating2' , 'uses' => 'Agent\helpdesk\TicketController@ratingReply']); /* Get reply Ratings */ + + Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */ Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']); /* Get Inbox Ticket */ @@ -529,6 +536,12 @@ $router->get('test', 'ArticleController@test'); $router->post('image', 'Agent\kb\SettingsController@image'); +Route::get('getratings', 'Admin\helpdesk\SettingsController@RatingSettings'); +Route::get('deleter/{rating}',[ + 'as'=>'ratings.delete' ,'uses'=>'Admin\helpdesk\SettingsController@RatingDelete' + ]); +Route::patch('postratings/{slug}',['as'=>'settings.rating','uses'=> 'Admin\helpdesk\SettingsController@PostRatingSettings']); + $router->get('direct', function () { return view('direct'); }); diff --git a/composer.json b/composer.json index 1c8c6872d..22fc6cf98 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "neitanod/forceutf8": "dev-master", "nicolaslopezj/searchable": "1.*", "chumper/datatable": "dev-develop", - "chumper/zipper": "0.6.x" + "chumper/zipper": "0.6.x", + "phpmailer/phpmailer": "^5.2" }, diff --git a/composer.lock b/composer.lock index 0b6f4af17..8ce132306 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d69b3602970278fff33081e9bb760580", - "content-hash": "9a33542c090892cab719529c7d512c73", + "hash": "dbe708dd8bd674e7f50ffacac524aa7f", + "content-hash": "6029d0feb460baf939941b14712788f4", "packages": [ { "name": "bugsnag/bugsnag", @@ -1356,26 +1356,25 @@ }, { "name": "php-imap/php-imap", - "version": "2.0.6", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/barbushin/php-imap.git", - "reference": "3174b23aaf45cc570972209f366c384f257399a8" + "reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barbushin/php-imap/zipball/3174b23aaf45cc570972209f366c384f257399a8", - "reference": "3174b23aaf45cc570972209f366c384f257399a8", + "url": "https://api.github.com/repos/barbushin/php-imap/zipball/cc1a49a3f68090db182183c59ffbc09055d59f5b", + "reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b", "shasum": "" }, "require": { - "ext-imap": "*", "php": ">=5.3.0" }, "type": "library", "autoload": { - "psr-4": { - "PhpImap\\": "src/PhpImap/" + "psr-0": { + "PhpImap": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1396,7 +1395,68 @@ "mail", "php" ], - "time": "2015-12-14 02:46:12" + "time": "2015-09-16 07:40:39" + }, + { + "name": "phpmailer/phpmailer", + "version": "v5.2.14", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "e774bc9152de85547336e22b8926189e582ece95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e774bc9152de85547336e22b8926189e582ece95", + "reference": "e774bc9152de85547336e22b8926189e582ece95", + "shasum": "" + }, + "require": { + "php": ">=5.0.0" + }, + "require-dev": { + "phpdocumentor/phpdocumentor": "*", + "phpunit/phpunit": "4.7.*" + }, + "suggest": { + "league/oauth2-client": "Needed for XOAUTH2 authentication", + "league/oauth2-google": "Needed for Gmail XOAUTH2" + }, + "type": "library", + "autoload": { + "classmap": [ + "class.phpmailer.php", + "class.phpmaileroauth.php", + "class.phpmaileroauthgoogle.php", + "class.smtp.php", + "class.pop3.php", + "extras/EasyPeasyICS.php", + "extras/ntlm_sasl_client.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "time": "2015-11-01 10:15:28" }, { "name": "propaganistas/laravel-phone", diff --git a/config/app.php b/config/app.php index 40cffea2c..42e87cbf5 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | */ - 'debug' => false, + 'debug' => true, /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2016_01_25_075608_create_tickets_table.php b/database/migrations/2016_01_25_075608_create_tickets_table.php index 0223ce530..ecfcccd25 100644 --- a/database/migrations/2016_01_25_075608_create_tickets_table.php +++ b/database/migrations/2016_01_25_075608_create_tickets_table.php @@ -26,6 +26,8 @@ class CreateTicketsTable extends Migration { $table->integer('flags'); $table->integer('ip_address'); $table->integer('assigned_to')->unsigned()->nullable()->index('assigned_to'); + $table->integer('rating'); + $table->integer('ratingreply'); $table->integer('lock_by'); $table->integer('lock_at'); $table->integer('source')->unsigned()->nullable()->index('source'); diff --git a/database/migrations/2016_02_01_052219_settings_ratings.php b/database/migrations/2016_02_01_052219_settings_ratings.php new file mode 100644 index 000000000..379444d8c --- /dev/null +++ b/database/migrations/2016_02_01_052219_settings_ratings.php @@ -0,0 +1,52 @@ +increments('id'); + $table->string('rating_name'); + $table->integer('publish'); + $table->integer('modify'); + $table->string('slug')->unique(); + $table->timestamps(); + }); + DB::table('settings_ratings')->insert(array( + array( + 'rating_name' => 'Overall Rating', + 'publish' => '1', + 'modify' => '1', + 'slug' => Str::slug(ucfirst('Overall Rating')) + ), + array( + 'rating_name' => 'Reply Rating', + 'publish' => '1', + 'modify' => '1', + 'slug' => Str::slug(ucfirst('Reply Rating')) + ) + ) + ); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('settings_ratings'); + } + +} diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 000000000..d37ef9563 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_54 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 000000000..035db715d --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + Faveo.v1.0.5.2 + + + diff --git a/public/lb-faveo/dist/css/jquery.rating.css b/public/lb-faveo/dist/css/jquery.rating.css new file mode 100644 index 000000000..2f2389177 --- /dev/null +++ b/public/lb-faveo/dist/css/jquery.rating.css @@ -0,0 +1,12 @@ +/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */ +div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden} +div.rating-cancel,div.rating-cancel a{background:url('http://stsinfosystems.kayako.com/__swift/themes/client/images/icon_ratingdelete.gif') no-repeat 0 -16px} +div.star-rating,div.star-rating a{background:url('http://stsinfosystems.kayako.com/__swift/themes/client/images/icon_ratingstar.gif') no-repeat 0 0px} +div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0} +div.star-rating-on a{background-position:0 -16px!important} +div.star-rating-hover a{background-position:0 -32px} +/* Read Only CSS */ +div.star-rating-readonly a{cursor:default !important} +/* Partial Star CSS */ +div.star-rating{background:transparent!important;overflow:hidden!important} +/* END jQuery.Rating Plugin CSS */ \ No newline at end of file diff --git a/public/lb-faveo/dist/images/delete.gif b/public/lb-faveo/dist/images/delete.gif new file mode 100644 index 000000000..43c6ca876 Binary files /dev/null and b/public/lb-faveo/dist/images/delete.gif differ diff --git a/public/lb-faveo/dist/images/star.gif b/public/lb-faveo/dist/images/star.gif new file mode 100644 index 000000000..d0948a708 Binary files /dev/null and b/public/lb-faveo/dist/images/star.gif differ diff --git a/public/lb-faveo/dist/images/stars.png b/public/lb-faveo/dist/images/stars.png new file mode 100644 index 000000000..b55a9b381 Binary files /dev/null and b/public/lb-faveo/dist/images/stars.png differ diff --git a/public/lb-faveo/dist/js/jquery.rating.pack.js b/public/lb-faveo/dist/js/jquery.rating.pack.js new file mode 100644 index 000000000..10bbeb217 --- /dev/null +++ b/public/lb-faveo/dist/js/jquery.rating.pack.js @@ -0,0 +1,9 @@ +/* + ### jQuery Star Rating Plugin v4.11 - 2013-03-14 ### + * Home: http://www.fyneworks.com/jquery/star-rating/ + * Code: http://code.google.com/p/jquery-star-rating-plugin/ + * + * Licensed under http://en.wikipedia.org/wiki/MIT_License + ### +*/ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X("1T",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]==\'1m\'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y(\'.l-4-1g\').p(\'l-4-1g\').18(8(){7 b,m=$(3);7 c=(3.2g||\'28-4\').1f(/\\[|\\]/g,\'Y\').1f(/^\\Y+|\\Y+$/g,\'\');7 d=$(3.2h||1j.1H);7 e=d.6(\'4\');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6(\'4\'+c);5(f)b=f.6(\'4\');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$(\'<1G 13="l-4-1I"/>\');m.1J(f);f.p(\'4-12-11-10\');5(m.Z(\'G\')||m.14(\'G\'))b.n=s;5(m.14(\'1c\'))b.1c=s;f.1r(b.D=$(\'\'+b.1B+\'\').q(\'1e\',8(){$(3).4(\'N\');$(3).p(\'l-4-T\')}).q(\'1h\',8(){$(3).4(\'x\');$(3).I(\'l-4-T\')}).q(\'1i\',8(){$(3).4(\'y\')}).6(\'4\',b))};7 g=$(\'\'+3.1k+\'\');f.1r(g);5(3.X)g.Z(\'X\',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B==\'1l\'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M(\'a\').1N({\'1O-1P\':\'-\'+(i*17)+\'1Q\'})};5(b.n)g.p(\'l-4-1p\');R g.p(\'l-4-1S\').q(\'1e\',8(){$(3).4(\'1q\');$(3).4(\'J\')}).q(\'1h\',8(){$(3).4(\'x\');$(3).4(\'H\')}).q(\'1i\',8(){$(3).4(\'y\')});5(3.S)b.r=g;5(3.1Y=="A"){5($(3).14(\'1Z\'))b.r=g};m.1t();m.q(\'1u.4\',8(a){5(a.1v)9 C;$(3).4(\'y\')});g.6(\'4.m\',m.6(\'4.l\',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6(\'4\',b);f.6(\'4\',b);g.6(\'4\',b);d.6(\'4\',e);d.6(\'4\'+c,f)});$(\'.4-12-11-10\').4(\'x\').I(\'4-12-11-10\');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6(\'4\');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6(\'4.m\')||$(3.19==\'1a\'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$(\'a\',b.6(\'4.l\'))[0]])},H:8(){7 a=3.6(\'4\');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6(\'4.m\')||$(3.19==\'1a\'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$(\'a\',b.6(\'4.l\'))[0]])},1q:8(){7 a=3.6(\'4\');5(!a)9 3;5(a.n)9;3.4(\'N\');3.1z().1A().O(\'.t-\'+a.z).p(\'l-4-T\')},N:8(){7 a=3.6(\'4\');5(!a)9 3;5(a.n)9;a.t.2a().O(\'.t-\'+a.z).I(\'l-4-q\').I(\'l-4-T\')},x:8(){7 a=3.6(\'4\');5(!a)9 3;3.4(\'N\');7 b=$(a.r);7 c=b.u?b.1z().1A().O(\'.t-\'+a.z):w;5(c)c.p(\'l-4-q\');a.D[a.n||a.1c?\'1t\':\'2b\']();3.2c()[a.n?\'p\':\'I\'](\'l-4-1p\')},y:8(a,b){7 c=3.6(\'4\');5(!c)9 3;5(c.n)9;c.r=w;5(M a!=\'F\'||3.u>1){5(M a==\'1l\')9 $(c.L[a]).4(\'y\',F,b);5(M a==\'1m\'){$.18(c.L,8(){5($(3).6(\'4.m\').Q()==a)$(3).4(\'y\',F,b)});9 3}}R{c.r=3[0].19==\'1a\'?3.6(\'4.l\'):(3.2e(\'.t-\'+c.z)?3:w)};3.6(\'4\',c);3.4(\'x\');7 d=$(c.r?c.r.6(\'4.m\'):w);7 e=$(c.v).O(\':S\');7 f=$(c.v).1y(d);f.1D(\'S\',C);d.1D(\'S\',s);$(d.u?d:e).2f({1E:\'1u\',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$(\'a\',c.r)[0]]);9 3},n:8(a,b){7 c=3.6(\'4\');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z("G","G");R $(c.v).2i("G");3.6(\'4\',c);3.4(\'x\')},2j:8(){3.4(\'n\',s,s)},2k:8(){3.4(\'n\',C,C)}});$.o.4.1w={D:\'2l 2m\',1B:\'\',B:0,1n:16};$(8(){$(\'m[1E=2n].l\').4()})})(1C);',62,148,'|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio'.split('|'),0,{})) \ No newline at end of file diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index e573d43cf..561ecfdf1 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -21,7 +21,9 @@ return array( 'success' => 'Success', 'fails' => 'Fails', 'alert' => 'Alert', - + 'ratings' => 'Ratings', + 'please_rate' => 'Please rate:', + 'ticket_ratings' => 'TICKET RATING', /* |-------------------------------------- | Login Page diff --git a/resources/views/emails/Admin_mail.blade.php b/resources/views/emails/default/Admin_mail.blade.php similarity index 100% rename from resources/views/emails/Admin_mail.blade.php rename to resources/views/emails/default/Admin_mail.blade.php diff --git a/resources/views/emails/Ticket_Create.blade.php b/resources/views/emails/default/Ticket_Create.blade.php similarity index 100% rename from resources/views/emails/Ticket_Create.blade.php rename to resources/views/emails/default/Ticket_Create.blade.php diff --git a/resources/views/emails/Ticket_Reply.blade.php b/resources/views/emails/default/Ticket_Reply.blade.php similarity index 100% rename from resources/views/emails/Ticket_Reply.blade.php rename to resources/views/emails/default/Ticket_Reply.blade.php diff --git a/resources/views/emails/Ticket_assign.blade.php b/resources/views/emails/default/Ticket_assign.blade.php similarity index 100% rename from resources/views/emails/Ticket_assign.blade.php rename to resources/views/emails/default/Ticket_assign.blade.php diff --git a/resources/views/emails/check_ticket.blade.php b/resources/views/emails/default/check_ticket.blade.php similarity index 100% rename from resources/views/emails/check_ticket.blade.php rename to resources/views/emails/default/check_ticket.blade.php diff --git a/resources/views/emails/close_ticket.blade.php b/resources/views/emails/default/close_ticket.blade.php similarity index 100% rename from resources/views/emails/close_ticket.blade.php rename to resources/views/emails/default/close_ticket.blade.php diff --git a/resources/views/emails/email_reply.blade.php b/resources/views/emails/default/email_reply.blade.php similarity index 100% rename from resources/views/emails/email_reply.blade.php rename to resources/views/emails/default/email_reply.blade.php diff --git a/resources/views/emails/pass.blade.php b/resources/views/emails/default/pass.blade.php similarity index 100% rename from resources/views/emails/pass.blade.php rename to resources/views/emails/default/pass.blade.php diff --git a/resources/views/emails/password.blade (2).php b/resources/views/emails/default/password.blade (2).php similarity index 100% rename from resources/views/emails/password.blade (2).php rename to resources/views/emails/default/password.blade (2).php diff --git a/resources/views/emails/password.blade.php b/resources/views/emails/default/password.blade.php similarity index 100% rename from resources/views/emails/password.blade.php rename to resources/views/emails/default/password.blade.php diff --git a/resources/views/emails/report.blade.php b/resources/views/emails/default/report.blade.php similarity index 100% rename from resources/views/emails/report.blade.php rename to resources/views/emails/default/report.blade.php diff --git a/resources/views/emails/ticket_re-reply.blade.php b/resources/views/emails/default/ticket_re-reply.blade.php similarity index 100% rename from resources/views/emails/ticket_re-reply.blade.php rename to resources/views/emails/default/ticket_re-reply.blade.php diff --git a/resources/views/emails/notifications/admin.blade.php b/resources/views/emails/notifications/admin.blade.php index e6831f01a..d3551b415 100644 --- a/resources/views/emails/notifications/admin.blade.php +++ b/resources/views/emails/notifications/admin.blade.php @@ -1,154 +1,141 @@ -name; - $created = DB::table('tickets')->select('created_at')->where('dept_id','=',$dept->id)->where('created_at','LIKE','%'.$day1.'%')->count(); - $closed = DB::table('tickets')->where('dept_id','=',$dept->id)->where('closed_at','LIKE','%'.$day1.'%')->count(); - $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->count(); - $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->get(); +name; + $created = DB::table('tickets')->select('created_at')->where('dept_id','=',$dept->id)->where('created_at','LIKE','%'.$day1.'%')->count(); + $closed = DB::table('tickets')->where('dept_id','=',$dept->id)->where('closed_at','LIKE','%'.$day1.'%')->count(); + $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->count(); + $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->get(); $i = 0; foreach ($overdues as $overdue) { - $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id','=',$overdue->sla)->first(); - $ovdate = $overdue->created_at; - $new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period)).'

'; - if(date('Y-m-d H:i:s') > $new_date){ + $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id','=',$overdue->sla)->first(); + $ovdate = $overdue->created_at; + $new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period)).'

'; + if(date('Y-m-d H:i:s') > $new_date){ $i++; } } - // echo "created=".$created."
"; - // echo "closed=".$closed."
"; - // echo "inprogress=".$inprogress."
"; - // echo "overdue=".$i."
"; + // echo "created=".$created."
"; + // echo "closed=".$closed."
"; + // echo "inprogress=".$inprogress."
"; + // echo "overdue=".$i."
"; } -?> +?> - - - - -SmoothDeal - - - - - - - + + + - - - - - - + + + + -
- - -

+ +SmoothDeal + + + + + + + + + + + +

{!! $company !!}

- -

+ +

Daily Report

-

+

Hi {!! $name !!},
Below mentioned are your daily report for your {!! $company !!}.

- -
+ + - - -

+ + +

Overview

@foreach ($depts as $dept) - name; - $created = DB::table('tickets')->select('created_at')->where('dept_id','=',$dept->id)->where('created_at','LIKE','%'.$day1.'%')->count(); - $closed = DB::table('tickets')->where('dept_id','=',$dept->id)->where('closed_at','LIKE','%'.$day1.'%')->count(); - $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->count(); - $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->get(); + name; + $created = DB::table('tickets')->select('created_at')->where('dept_id','=',$dept->id)->where('created_at','LIKE','%'.$day1.'%')->count(); + $closed = DB::table('tickets')->where('dept_id','=',$dept->id)->where('closed_at','LIKE','%'.$day1.'%')->count(); + $inprogress = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->count(); + $overdues = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$dept->id)->where('status', '=', 1)->get(); $i = 0; foreach ($overdues as $overdue) { - $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id','=',$overdue->sla)->first(); - $ovdate = $overdue->created_at; - $new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period)).'

'; - if(date('Y-m-d H:i:s') > $new_date){ + $sla_plan = App\Model\helpdesk\Manage\Sla_plan::where('id','=',$overdue->sla)->first(); + $ovdate = $overdue->created_at; + $new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period)).'

'; + if(date('Y-m-d H:i:s') > $new_date){ $i++; } } - // echo "created=".$created."
"; - // echo "closed=".$closed."
"; - // echo "inprogress=".$inprogress."
"; - // echo "overdue=".$i."
"; - ?> - - - - - + // echo "created=".$created."
"; + // echo "closed=".$closed."
"; + // echo "inprogress=".$inprogress."
"; + // echo "overdue=".$i."
"; + ?> + + + + + {!! $dept->name !!} + + - - - - - - - - + + New tickets + {!! $created !!} + + + Closed tickets + {!! $closed !!} + - - - - - - - - + + Inprogress tickets + {!! $inprogress !!} + + + Overdue tickets + {!! $i !!} + - - - -
- {!! $dept->name !!} -
New tickets{!! $created !!}
Closed tickets{!! $closed !!}
Inprogress tickets{!! $inprogress !!}
Overdue tickets{!! $i !!}
- + + + +
+ @endforeach -
-

- We should all work hard to guarantee that all tickets are being addressed in a timely manner.  + + +

+ We should all work hard to guarantee that all tickets are being addressed in a timely manner. 

-

- Thank You,
Kind Regards,
{!! $company !!} +

+ Thank You,
Kind Regards,
{!! $company !!}

- -

+ +

Powered by Faveo

-
- - - - + \ No newline at end of file diff --git a/resources/views/emails/random/Admin_mail.blade.php b/resources/views/emails/random/Admin_mail.blade.php new file mode 100644 index 000000000..bb3dd0e5a --- /dev/null +++ b/resources/views/emails/random/Admin_mail.blade.php @@ -0,0 +1,14 @@ +Hello {!! $agent !!},

+New ticket {!! $ticket_number !!} created
+
+From +Name :- {!! $name !!}
+E-mail :- {!! $email !!}
+
+ +

{!! $content !!}

+ + +
+Kind Regard,
+{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/Ticket_Create.blade.php b/resources/views/emails/random/Ticket_Create.blade.php new file mode 100644 index 000000000..5f7092206 --- /dev/null +++ b/resources/views/emails/random/Ticket_Create.blade.php @@ -0,0 +1,25 @@ +---Reply above this line---

+ + + +

{!! $content !!}

{!! $sign !!}

+You can check the status of or update this ticket online at: {!! \URL::route('ticket2') !!}

+ + + +Hello {!!$name!!}

+Thank you for contacting us. This is an automated response confirming the receipt of your ticket. Our team will get back to you as soon as possible. When replying, please make sure that the ticket ID is kept in the subject so that we can track your replies.

+Ticket ID: {!!$ticket_number!!}
+{{-- Subject: Ticket Subject
--}} +{{-- Department: Support
--}} +{{-- Status: Open
--}} +{{-- Priority: Normal

--}} +{!! $sign !!} +You can check the status of or update this ticket online at: {!! \URL::route('ticket2') !!}

+ \ No newline at end of file diff --git a/resources/views/emails/random/Ticket_Reply.blade.php b/resources/views/emails/random/Ticket_Reply.blade.php new file mode 100644 index 000000000..9edfb9e60 --- /dev/null +++ b/resources/views/emails/random/Ticket_Reply.blade.php @@ -0,0 +1,4 @@ +---Reply above this line---


+ +Hello {{$name}}

+Your ticket have been created please visit this link for your ticket query.

diff --git a/resources/views/emails/random/Ticket_assign.blade.php b/resources/views/emails/random/Ticket_assign.blade.php new file mode 100644 index 000000000..1f06a4d8b --- /dev/null +++ b/resources/views/emails/random/Ticket_assign.blade.php @@ -0,0 +1,9 @@ +Hello {!! $agent !!},

+Ticket No: {!! $ticket_number !!}
+ +Has been assigned to you by {!! $master !!}
+ +
+Thank You

+Kind Regards,
+{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/check_ticket.blade.php b/resources/views/emails/random/check_ticket.blade.php new file mode 100644 index 000000000..4133e7014 --- /dev/null +++ b/resources/views/emails/random/check_ticket.blade.php @@ -0,0 +1,9 @@ +Hello {!! $user !!},

+ + +Click the link below to view your Requested ticket

+{!! $link !!}

+ + +Kind Regards,
+{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/close_ticket.blade.php b/resources/views/emails/random/close_ticket.blade.php new file mode 100644 index 000000000..d26655186 --- /dev/null +++ b/resources/views/emails/random/close_ticket.blade.php @@ -0,0 +1,7 @@ +Hello,

+This message is regarding your ticket ID {{ $ticket_number }}. We are changing the status of this ticket to 'Closed' as the issue appears to be resolved.
+
+Thank you
+
+Kind regards,
+{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/email_reply.blade.php b/resources/views/emails/random/email_reply.blade.php new file mode 100644 index 000000000..70b7050c8 --- /dev/null +++ b/resources/views/emails/random/email_reply.blade.php @@ -0,0 +1,13 @@ +Hello {!! $agent !!},

+A reply been made to ticket {!! $ticket_number !!}
+
+From +Name: {!! $name !!}
+E-mail: {!! $email !!}
+
+ +

{!! $content !!}

+
+
+Kind Regards,
+{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/pass.blade.php b/resources/views/emails/random/pass.blade.php new file mode 100644 index 000000000..8bc12a322 --- /dev/null +++ b/resources/views/emails/random/pass.blade.php @@ -0,0 +1,14 @@ +Hello {!! $name !!},

+ +This email is confirmation that you are now registered at our helpdesk.

+ +Registered Email: {!! $emailadd !!}
+Password: {{$password}}

+ +You can visit the helpdesk to browse articles and contact us at any time: {!! \URL::route('ticket2') !!}

+ +Thank You.

+ +Kind Regards,

+ +{!! $from !!} \ No newline at end of file diff --git a/resources/views/emails/random/password.blade (2).php b/resources/views/emails/random/password.blade (2).php new file mode 100644 index 000000000..c97bca905 --- /dev/null +++ b/resources/views/emails/random/password.blade (2).php @@ -0,0 +1 @@ +Click here to reset your password: {!! url('password/reset/'.$token) !!} diff --git a/resources/views/emails/random/password.blade.php b/resources/views/emails/random/password.blade.php new file mode 100644 index 000000000..71ce09054 --- /dev/null +++ b/resources/views/emails/random/password.blade.php @@ -0,0 +1,14 @@ +Hello

+ +You asked to reset your password. To do so, please click this link:

+ +{!! url('password/reset/'.$token) !!}

+ +
+This will let you change your password to something new. If you didn't ask for this, don't worry, we'll keep your password safe.

+ +Thank You.
+
+Kind Regards,

+first(); $company = $company->company_name; ?> +{!! $company !!} \ No newline at end of file diff --git a/resources/views/emails/random/report.blade.php b/resources/views/emails/random/report.blade.php new file mode 100644 index 000000000..1e6423ec1 --- /dev/null +++ b/resources/views/emails/random/report.blade.php @@ -0,0 +1 @@ +
{{$e}}
\ No newline at end of file diff --git a/resources/views/emails/random/ticket_re-reply.blade.php b/resources/views/emails/random/ticket_re-reply.blade.php new file mode 100644 index 000000000..a77b88b35 --- /dev/null +++ b/resources/views/emails/random/ticket_re-reply.blade.php @@ -0,0 +1,11 @@ +---Reply above this line---

+ +{!! $content !!}
+ +{!! $Agent_Signature !!}
+ + +Ticket Details
+Ticket ID: {!! $ticket_number !!}
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 new file mode 100644 index 000000000..8c34936b3 --- /dev/null +++ b/resources/views/themes/default1/admin/helpdesk/emails/template/listtemplates.blade.php @@ -0,0 +1,123 @@ +@extends('themes.default1.admin.layout.admin') + +@section('Emails') +class="active" +@stop + +@section('emails-bar') +active +@stop + +@section('template') +class="active" +@stop + +@section('HeadInclude') +@stop + +@section('PageHeader') + +@stop + + +@section('breadcrumbs') + +@stop + + +@section('content') +
+
+
+
+ + + +
+ +
+ + + +@if(Session::has('success')) +
+ + Success! + + {{Session::get('success')}} +
+ @endif + + @if(Session::has('fails')) +
+ + Fail! + + {{Session::get('fails')}} +
+ @endif + + + + + + + + + @foreach($templates as $template) + + + + + + + + + +@endforeach + + + + + + +
{{Lang::get('lang.name')}}
{!! $template !!}
+@stop +
+@section('FooterInclude') + +@stop +@stop + \ No newline at end of file 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 new file mode 100644 index 000000000..39c2fd8ac --- /dev/null +++ b/resources/views/themes/default1/admin/helpdesk/emails/template/readtemplates.blade.php @@ -0,0 +1,105 @@ +@extends('themes.default1.admin.layout.admin') + +@section('Emails') +class="active" +@stop + +@section('emails-bar') +active +@stop + +@section('template') +class="active" +@stop + +@section('HeadInclude') +@stop + +@section('PageHeader') + +@stop + + +@section('breadcrumbs') + +@stop + + +@section('content') +
+
+
+
+

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

Edit Template
+ + +
+ + + +@if(Session::has('success')) +
+ + Success! + + {{Session::get('success')}} +
+ @endif + + @if(Session::has('fails')) +
+ + Fail! + + {{Session::get('fails')}} +
+ @endif + +
+ + {!! nl2br($contents) !!} + +
+ +@stop +
+@section('FooterInclude') + +@stop +@stop + \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/setting.blade.php b/resources/views/themes/default1/admin/helpdesk/setting.blade.php index 2e5c7a4b5..bcdc7f4a7 100644 --- a/resources/views/themes/default1/admin/helpdesk/setting.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/setting.blade.php @@ -131,6 +131,17 @@
+
+
+ +
{!! Lang::get('lang.templates') !!}
+
+
diff --git a/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php new file mode 100644 index 000000000..c8b22d21d --- /dev/null +++ b/resources/views/themes/default1/admin/helpdesk/settings/ratings.blade.php @@ -0,0 +1,171 @@ +@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 + +
+ + + + + + + + + + + + + @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/agent/helpdesk/ticket/timeline.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php index d3e8cc8bb..065dd6161 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php @@ -16,6 +16,7 @@ active ?> @section('sidebar') +
  • {!! Lang::get('lang.Ticket_Information') !!}
  • @@ -41,6 +42,19 @@ active @endif
  • + +
  • + {!! Lang::get('lang.ticket_ratings') !!} +
  • + + +
    + {!! $tickets->rating !!}
    + + +

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

    +
  • @stop @section('content') @@ -1053,7 +1067,22 @@ $count_teams = count($teams); - {{-- // --}} - {{-- // --}} - - + + + @yield('HeadInclude') @@ -294,9 +318,7 @@ $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
    - {{-- // --}} - - + {{-- // --}} diff --git a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php index fac73421b..1acf8b10d 100644 --- a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php +++ b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php @@ -23,9 +23,12 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id','=',\Crypt:
    - +
    +

    {{$thread->title}}

    ( {{$tickets->ticket_number}} )
    +
    +
    {{-- --}} @@ -42,6 +45,42 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id','=',\Crypt:
    {!! Form::close() !!}
    +
    +
    +
    +
    +
    + + + +   + + + + + + +   + + +
    Overall Satisfaction  
    + 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':'' ?> /> + +
    +
    +
    +
    +
    @@ -340,7 +379,71 @@ $data = $ConvDate[0]; + + + + + + + + +"; + echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above."); +} + +if (count($results_messages) > 0) { + echo '

    Run results

    '; + echo '
      '; + foreach ($results_messages as $result) { + echo "
    • $result
    • "; + } + echo '
    '; +} + +if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") { + echo "
    \n"; + echo "
    Script:\n"; + echo "
    \n";
    +    echo $example_code;
    +    echo "\n
    \n"; + echo "\n
    \n"; +} +?> +
    +
    +
    +
    + Mail Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    +
    Test will include two attachments.
    +
    +
    +
    +
    + Mail Test Specs + + + + + +
    Test Type +
    + + + required> +
    +
    + + + required> +
    +
    + + + required> +
    +
    + + + required> +
    +
    +
    "> + SMTP Specific Options: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + + value=""> +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + + diff --git a/vendor/phpmailer/phpmailer/examples/contents.html b/vendor/phpmailer/phpmailer/examples/contents.html new file mode 100644 index 000000000..dc3fc6676 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/contents.html @@ -0,0 +1,17 @@ + + + + + PHPMailer Test + + +
    +

    This is a test of PHPMailer.

    +
    + PHPMailer rocks +
    +

    This example uses HTML.

    +

    ISO-8859-1 text:

    +
    + + diff --git a/vendor/phpmailer/phpmailer/examples/contentsutf8.html b/vendor/phpmailer/phpmailer/examples/contentsutf8.html new file mode 100644 index 000000000..81a202405 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/contentsutf8.html @@ -0,0 +1,20 @@ + + + + + PHPMailer Test + + +
    +

    This is a test of PHPMailer.

    +
    + PHPMailer rocks +
    +

    This example uses HTML.

    +

    Chinese text: 郵件內容為空

    +

    Russian text: Пустое тело сообщения

    +

    Armenian text: Հաղորդագրությունը դատարկ է

    +

    Czech text: Prázdné tělo zprávy

    +
    + + diff --git a/vendor/phpmailer/phpmailer/examples/exceptions.phps b/vendor/phpmailer/phpmailer/examples/exceptions.phps new file mode 100644 index 000000000..0e941e733 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/exceptions.phps @@ -0,0 +1,35 @@ +setFrom('from@example.com', 'First Last'); + //Set an alternative reply-to address + $mail->addReplyTo('replyto@example.com', 'First Last'); + //Set who the message is to be sent to + $mail->addAddress('whoto@example.com', 'John Doe'); + //Set the subject line + $mail->Subject = 'PHPMailer Exceptions test'; + //Read an HTML message body from an external file, convert referenced images to embedded, + //and convert the HTML into a basic plain-text alternative body + $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + //Replace the plain text body with one created manually + $mail->AltBody = 'This is a plain-text message body'; + //Attach an image file + $mail->addAttachment('images/phpmailer_mini.png'); + //send the message + //Note that we don't need check the response from this because it will throw an exception if it has trouble + $mail->send(); + echo "Message sent!"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} diff --git a/vendor/phpmailer/phpmailer/examples/gmail.phps b/vendor/phpmailer/phpmailer/examples/gmail.phps new file mode 100644 index 000000000..b3cc02d53 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/gmail.phps @@ -0,0 +1,75 @@ +isSMTP(); + +//Enable SMTP debugging +// 0 = off (for production use) +// 1 = client messages +// 2 = client and server messages +$mail->SMTPDebug = 2; + +//Ask for HTML-friendly debug output +$mail->Debugoutput = 'html'; + +//Set the hostname of the mail server +$mail->Host = 'smtp.gmail.com'; +// use +// $mail->Host = gethostbyname('smtp.gmail.com'); +// if your network does not support SMTP over IPv6 + +//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission +$mail->Port = 587; + +//Set the encryption system to use - ssl (deprecated) or tls +$mail->SMTPSecure = 'tls'; + +//Whether to use SMTP authentication +$mail->SMTPAuth = true; + +//Username to use for SMTP authentication - use full email address for gmail +$mail->Username = "username@gmail.com"; + +//Password to use for SMTP authentication +$mail->Password = "yourpassword"; + +//Set who the message is to be sent from +$mail->setFrom('from@example.com', 'First Last'); + +//Set an alternative reply-to address +$mail->addReplyTo('replyto@example.com', 'First Last'); + +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); + +//Set the subject line +$mail->Subject = 'PHPMailer GMail SMTP test'; + +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; + +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps b/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps new file mode 100644 index 000000000..d64483a4d --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps @@ -0,0 +1,85 @@ +isSMTP(); + +//Enable SMTP debugging +// 0 = off (for production use) +// 1 = client messages +// 2 = client and server messages +$mail->SMTPDebug = 0; + +//Ask for HTML-friendly debug output +$mail->Debugoutput = 'html'; + +//Set the hostname of the mail server +$mail->Host = 'smtp.gmail.com'; + +//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission +$mail->Port = 587; + +//Set the encryption system to use - ssl (deprecated) or tls +$mail->SMTPSecure = 'tls'; + +//Whether to use SMTP authentication +$mail->SMTPAuth = true; + +//Set AuthType +$mail->AuthType = 'XOAUTH2'; + +//User Email to use for SMTP authentication - Use the same Email used in Google Developer Console +$mail->oauthUserEmail = "someone@gmail.com"; + +//Obtained From Google Developer Console +$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com"; + +//Obtained From Google Developer Console +$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP"; + +//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console. +//Set Redirect URI in Developer Console as [https/http]:////get_oauth_token.php +// eg: http://localhost/phpmail/get_oauth_token.php +$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0"; + +//Set who the message is to be sent from +//For gmail, this generally needs to be the same as the user you logged in as +$mail->setFrom('from@example.com', 'First Last'); + +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); + +//Set the subject line +$mail->Subject = 'PHPMailer GMail SMTP test'; + +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; + +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/vendor/phpmailer/phpmailer/examples/images/phpmailer.png b/vendor/phpmailer/phpmailer/examples/images/phpmailer.png new file mode 100644 index 000000000..9bdd83c8d Binary files /dev/null and b/vendor/phpmailer/phpmailer/examples/images/phpmailer.png differ diff --git a/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png b/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png new file mode 100644 index 000000000..e6915f431 Binary files /dev/null and b/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png differ diff --git a/vendor/phpmailer/phpmailer/examples/index.html b/vendor/phpmailer/phpmailer/examples/index.html new file mode 100644 index 000000000..bbb830d19 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/index.html @@ -0,0 +1,48 @@ + + + + + PHPMailer Examples + + +

    PHPMailer code examplesPHPMailer logo

    +

    This folder contains a collection of examples of using PHPMailer.

    +

    About testing email sending

    +

    When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:

    +
      +
    • FakeSMTP, a Java desktop app with the ability to show an SMTP log and save messages to a folder.
    • +
    • FakeEmail, a Python-based fake mail server with a web interface.
    • +
    • smtp-sink, part of the Postfix mail server, so you probably already have this installed. This is used in the Travis-CI configuration to run PHPMailer's unit tests.
    • +
    • smtp4dev, a dummy SMTP server for Windows.
    • +
    • fakesendmail.sh, part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
    • +
    • msglint, not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
    • +
    +
    +

    Security note

    +

    Before running these examples you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - please don't do that! Similarly, don't leave your passwords in these files as they will be visible to the world!

    +
    +

    code_generator.phps

    +

    This script is a simple code generator - fill in the form and hit submit, and it will use when you entered to email you a message, and will also generate PHP code using your settings that you can copy and paste to use in your own apps. If you need to get going quickly, this is probably the best place to start.

    +

    mail.phps

    +

    This script is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.

    +

    exceptions.phps

    +

    The same as the mail example, but shows how to use PHPMailer's optional exceptions for error handling.

    +

    smtp.phps

    +

    A simple example sending using SMTP with authentication.

    +

    smtp_no_auth.phps

    +

    A simple example sending using SMTP without authentication.

    +

    sendmail.phps

    +

    A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.

    +

    gmail.phps

    +

    Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.

    +

    pop_before_smtp.phps

    +

    Before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a POP3 protocol client, so it can carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP first.

    +

    mailing_list.phps

    +

    This is a somewhat naïve example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.

    +
    +

    smtp_check.phps

    +

    This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.

    +
    +

    Most of these examples use the 'example.com' domain. This domain is reserved by IANA for illustrative purposes, as documented in RFC 2606. Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!

    + + diff --git a/vendor/phpmailer/phpmailer/examples/mail.phps b/vendor/phpmailer/phpmailer/examples/mail.phps new file mode 100644 index 000000000..8e129f47d --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/mail.phps @@ -0,0 +1,31 @@ +setFrom('from@example.com', 'First Last'); +//Set an alternative reply-to address +$mail->addReplyTo('replyto@example.com', 'First Last'); +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); +//Set the subject line +$mail->Subject = 'PHPMailer mail() test'; +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/vendor/phpmailer/phpmailer/examples/mailing_list.phps b/vendor/phpmailer/phpmailer/examples/mailing_list.phps new file mode 100644 index 000000000..8644bb596 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/mailing_list.phps @@ -0,0 +1,59 @@ +isSMTP(); +$mail->Host = 'smtp.example.com'; +$mail->SMTPAuth = true; +$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead +$mail->Port = 25; +$mail->Username = 'yourname@example.com'; +$mail->Password = 'yourpassword'; +$mail->setFrom('list@example.com', 'List manager'); +$mail->addReplyTo('list@example.com', 'List manager'); + +$mail->Subject = "PHPMailer Simple database mailing list test"; + +//Same body for all messages, so set this before the sending loop +//If you generate a different body for each recipient (e.g. you're using a templating system), +//set it inside the loop +$mail->msgHTML($body); +//msgHTML also sets AltBody, but if you want a custom one, set it afterwards +$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; + +//Connect to the database and select the recipients from your mailing list that have not yet been sent to +//You'll need to alter this to match your database +$mysql = mysqli_connect('localhost', 'username', 'password'); +mysqli_select_db($mysql, 'mydb'); +$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false'); + +foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+ + $mail->addAddress($row['email'], $row['full_name']); + if (!empty($row['photo'])) { + $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB + } + + if (!$mail->send()) { + echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
    '; + break; //Abandon sending + } else { + echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
    '; + //Mark it as sent in the DB + mysqli_query( + $mysql, + "UPDATE mailinglist SET sent = true WHERE email = '" . + mysqli_real_escape_string($mysql, $row['email']) . "'" + ); + } + // Clear all addresses and attachments for next loop + $mail->clearAddresses(); + $mail->clearAttachments(); +} diff --git a/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps b/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps new file mode 100644 index 000000000..164dfe8dd --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps @@ -0,0 +1,54 @@ +isSMTP(); + //Enable SMTP debugging + // 0 = off (for production use) + // 1 = client messages + // 2 = client and server messages + $mail->SMTPDebug = 2; + //Ask for HTML-friendly debug output + $mail->Debugoutput = 'html'; + //Set the hostname of the mail server + $mail->Host = "mail.example.com"; + //Set the SMTP port number - likely to be 25, 465 or 587 + $mail->Port = 25; + //Whether to use SMTP authentication + $mail->SMTPAuth = false; + //Set who the message is to be sent from + $mail->setFrom('from@example.com', 'First Last'); + //Set an alternative reply-to address + $mail->addReplyTo('replyto@example.com', 'First Last'); + //Set who the message is to be sent to + $mail->addAddress('whoto@example.com', 'John Doe'); + //Set the subject line + $mail->Subject = 'PHPMailer POP-before-SMTP test'; + //Read an HTML message body from an external file, convert referenced images to embedded, + //and convert the HTML into a basic plain-text alternative body + $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + //Replace the plain text body with one created manually + $mail->AltBody = 'This is a plain-text message body'; + //Attach an image file + $mail->addAttachment('images/phpmailer_mini.png'); + //send the message + //Note that we don't need check the response from this because it will throw an exception if it has trouble + $mail->send(); + echo "Message sent!"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} diff --git a/vendor/phpmailer/phpmailer/examples/scripts/XRegExp.js b/vendor/phpmailer/phpmailer/examples/scripts/XRegExp.js new file mode 100644 index 000000000..ebdb9c948 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/scripts/XRegExp.js @@ -0,0 +1,664 @@ +// XRegExp 1.5.1 +// (c) 2007-2012 Steven Levithan +// MIT License +// +// Provides an augmented, extensible, cross-browser implementation of regular expressions, +// including support for additional syntax, flags, and methods + +var XRegExp; + +if (XRegExp) { + // Avoid running twice, since that would break references to native globals + throw Error("can't load XRegExp twice in the same frame"); +} + +// Run within an anonymous function to protect variables and avoid new globals +(function (undefined) { + + //--------------------------------- + // Constructor + //--------------------------------- + + // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native + // regular expression in that additional syntax and flags are supported and cross-browser + // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and + // converts to type XRegExp + XRegExp = function (pattern, flags) { + var output = [], + currScope = XRegExp.OUTSIDE_CLASS, + pos = 0, + context, tokenResult, match, chr, regex; + + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) + throw TypeError("can't supply flags when constructing one RegExp from another"); + return clone(pattern); + } + // Tokens become part of the regex construction process, so protect against infinite + // recursion when an XRegExp is constructed within a token handler or trigger + if (isInsideConstructor) + throw Error("can't call the XRegExp constructor within token definition functions"); + + flags = flags || ""; + context = { // `this` object for custom tokens + hasNamedCapture: false, + captureNames: [], + hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, + setFlag: function (flag) {flags += flag;} + }; + + while (pos < pattern.length) { + // Check for custom tokens at the current position + tokenResult = runTokens(pattern, pos, currScope, context); + + if (tokenResult) { + output.push(tokenResult.output); + pos += (tokenResult.match[0].length || 1); + } else { + // Check for native multicharacter metasequences (excluding character classes) at + // the current position + if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { + output.push(match[0]); + pos += match[0].length; + } else { + chr = pattern.charAt(pos); + if (chr === "[") + currScope = XRegExp.INSIDE_CLASS; + else if (chr === "]") + currScope = XRegExp.OUTSIDE_CLASS; + // Advance position one character + output.push(chr); + pos++; + } + } + } + + regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); + regex._xregexp = { + source: pattern, + captureNames: context.hasNamedCapture ? context.captureNames : null + }; + return regex; + }; + + + //--------------------------------- + // Public properties + //--------------------------------- + + XRegExp.version = "1.5.1"; + + // Token scope bitflags + XRegExp.INSIDE_CLASS = 1; + XRegExp.OUTSIDE_CLASS = 2; + + + //--------------------------------- + // Private variables + //--------------------------------- + + var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, + flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags + quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, + isInsideConstructor = false, + tokens = [], + // Copy native globals for reference ("native" is an ES3 reserved keyword) + nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + nativ.test.call(x, ""); + return !x.lastIndex; + }(), + hasNativeY = RegExp.prototype.sticky !== undefined, + nativeTokens = {}; + + // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, + // excluding character classes) + nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; + nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; + + + //--------------------------------- + // Public methods + //--------------------------------- + + // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by + // the XRegExp library and can be used to create XRegExp plugins. This function is intended for + // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can + // be disabled by `XRegExp.freezeTokens` + XRegExp.addToken = function (regex, handler, scope, trigger) { + tokens.push({ + pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), + handler: handler, + scope: scope || XRegExp.OUTSIDE_CLASS, + trigger: trigger || null + }); + }; + + // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag + // combination has previously been cached, the cached copy is returned; otherwise the newly + // created regex is cached + XRegExp.cache = function (pattern, flags) { + var key = pattern + "/" + (flags || ""); + return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); + }; + + // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh + // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` + // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve + // special properties required for named capture + XRegExp.copyAsGlobal = function (regex) { + return clone(regex, "g"); + }; + + // Accepts a string; returns the string with regex metacharacters escaped. The returned string + // can safely be used at any point within a regex to match the provided literal string. Escaped + // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace + XRegExp.escape = function (str) { + return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }; + + // Accepts a string to search, regex to search with, position to start the search within the + // string (default: 0), and an optional Boolean indicating whether matches must start at-or- + // after the position or at the specified position only. This function ignores the `lastIndex` + // of the provided regex in its own handling, but updates the property for compatibility + XRegExp.execAt = function (str, regex, pos, anchored) { + var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), + match; + r2.lastIndex = pos = pos || 0; + match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (anchored && match && match.index !== pos) + match = null; + if (regex.global) + regex.lastIndex = match ? r2.lastIndex : 0; + return match; + }; + + // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing + // syntax and flag changes. Should be run after XRegExp and any plugins are loaded + XRegExp.freezeTokens = function () { + XRegExp.addToken = function () { + throw Error("can't run addToken after freezeTokens"); + }; + }; + + // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. + // Note that this is also `true` for regex literals and regexes created by the `XRegExp` + // constructor. This works correctly for variables created in another frame, when `instanceof` + // and `constructor` checks would fail to work as intended + XRegExp.isRegExp = function (o) { + return Object.prototype.toString.call(o) === "[object RegExp]"; + }; + + // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to + // iterate over regex matches compared to the traditional approaches of subverting + // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop + XRegExp.iterate = function (str, regex, callback, context) { + var r2 = clone(regex, "g"), + i = -1, match; + while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (regex.global) + regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` + callback.call(context, match, ++i, str, regex); + if (r2.lastIndex === match.index) + r2.lastIndex++; + } + if (regex.global) + regex.lastIndex = 0; + }; + + // Accepts a string and an array of regexes; returns the result of using each successive regex + // to search within the matches of the previous regex. The array of regexes can also contain + // objects with `regex` and `backref` properties, in which case the named or numbered back- + // references specified are passed forward to the next regex or returned. E.g.: + // var xregexpImgFileNames = XRegExp.matchChain(html, [ + // {regex: /]+)>/i, backref: 1}, // tag attributes + // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values + // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths + // /[^\/]+$/ // filenames (strip directory paths) + // ]); + XRegExp.matchChain = function (str, chain) { + return function recurseChain (values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + regex = clone(item.regex, "g"), + matches = [], i; + for (i = 0; i < values.length; i++) { + XRegExp.iterate(values[i], regex, function (match) { + matches.push(item.backref ? (match[item.backref] || "") : match[0]); + }); + } + return ((level === chain.length - 1) || !matches.length) ? + matches : recurseChain(matches, level + 1); + }([str], 0); + }; + + + //--------------------------------- + // New RegExp prototype methods + //--------------------------------- + + // Accepts a context object and arguments array; returns the result of calling `exec` with the + // first value in the arguments array. the context is ignored but is accepted for congruity + // with `Function.prototype.apply` + RegExp.prototype.apply = function (context, args) { + return this.exec(args[0]); + }; + + // Accepts a context object and string; returns the result of calling `exec` with the provided + // string. the context is ignored but is accepted for congruity with `Function.prototype.call` + RegExp.prototype.call = function (context, str) { + return this.exec(str); + }; + + + //--------------------------------- + // Overriden native methods + //--------------------------------- + + // Adds named capture support (with backreferences returned as `result.name`), and fixes two + // cross-browser issues per ES3: + // - Captured values for nonparticipating capturing groups should be returned as `undefined`, + // rather than the empty string. + // - `lastIndex` should not be incremented after zero-length matches. + RegExp.prototype.exec = function (str) { + var match, name, r2, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.apply(this, arguments); + if (match) { + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call((str + "").slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + // Attach named capture properties + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + // Fix browsers that increment `lastIndex` after zero-length matches + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return match; + }; + + // Fix browser bugs in native method + RegExp.prototype.test = function (str) { + // Use the native `exec` to skip some processing overhead, even though the altered + // `exec` would take care of the `lastIndex` fixes + var match, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.call(this, str); + // Fix browsers that increment `lastIndex` after zero-length matches + if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return !!match; + }; + + // Adds named capture support and fixes browser bugs in native method + String.prototype.match = function (regex) { + if (!XRegExp.isRegExp(regex)) + regex = RegExp(regex); // Native `RegExp` + if (regex.global) { + var result = nativ.match.apply(this, arguments); + regex.lastIndex = 0; // Fix IE bug + return result; + } + return regex.exec(this); // Run the altered `exec` + }; + + // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, + // and provides named backreferences to replacement functions as `arguments[0].name`. Also + // fixes cross-browser differences in replacement text syntax when performing a replacement + // using a nonregex search value, and the value of replacement regexes' `lastIndex` property + // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary + // third (`flags`) parameter + String.prototype.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search), + captureNames, result, str, origLastIndex; + + // There are too many combinations of search/replacement types/values and browser bugs that + // preclude passing to native `replace`, so don't try + //if (...) + // return nativ.replace.apply(this, arguments); + + if (isRegex) { + if (search._xregexp) + captureNames = search._xregexp.captureNames; // Array or `null` + if (!search.global) + origLastIndex = search.lastIndex; + } else { + search = search + ""; // Type conversion + } + + if (Object.prototype.toString.call(replacement) === "[object Function]") { + result = nativ.replace.call(this + "", search, function () { + if (captureNames) { + // Change the `arguments[0]` string primitive to a String object which can store properties + arguments[0] = new String(arguments[0]); + // Store named backreferences on `arguments[0]` + for (var i = 0; i < captureNames.length; i++) { + if (captureNames[i]) + arguments[0][captureNames[i]] = arguments[i + 1]; + } + } + // Update `lastIndex` before calling `replacement` (fix browsers) + if (isRegex && search.global) + search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; + return replacement.apply(null, arguments); + }); + } else { + str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) + result = nativ.replace.call(str, search, function () { + var args = arguments; // Keep this function's `arguments` available through closure + return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { + // Numbered backreference (without delimiters) or special variable + if ($1) { + switch ($1) { + case "$": return "$"; + case "&": return args[0]; + case "`": return args[args.length - 1].slice(0, args[args.length - 2]); + case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + // Numbered backreference + default: + // What does "$10" mean? + // - Backreference 10, if 10 or more capturing groups exist + // - Backreference 1 followed by "0", if 1-9 capturing groups exist + // - Otherwise, it's the string "$10" + // Also note: + // - Backreferences cannot be more than two digits (enforced by `replacementToken`) + // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" + // - There is no "$0" token ("$&" is the entire match) + var literalNumbers = ""; + $1 = +$1; // Type conversion; drop leading zero + if (!$1) // `$1` was "0" or "00" + return $0; + while ($1 > args.length - 3) { + literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; + $1 = Math.floor($1 / 10); // Drop the last digit + } + return ($1 ? args[$1] || "" : "$") + literalNumbers; + } + // Named backreference or delimited numbered backreference + } else { + // What does "${n}" mean? + // - Backreference to numbered capture n. Two differences from "$n": + // - n can be more than two digits + // - Backreference 0 is allowed, and is the entire match + // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture + // - Otherwise, it's the string "${n}" + var n = +$2; // Type conversion; drop leading zeros + if (n <= args.length - 3) + return args[n]; + n = captureNames ? indexOf(captureNames, $2) : -1; + return n > -1 ? args[n + 1] : $0; + } + }); + }); + } + + if (isRegex) { + if (search.global) + search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) + else + search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + } + + return result; + }; + + // A consistent cross-browser, ES3 compliant `split` + String.prototype.split = function (s /* separator */, limit) { + // If separator `s` is not a regex, use the native `split` + if (!XRegExp.isRegExp(s)) + return nativ.split.apply(this, arguments); + + var str = this + "", // Type conversion + output = [], + lastLastIndex = 0, + match, lastLength; + + // Behavior for `limit`: if it's... + // - `undefined`: No limit + // - `NaN` or zero: Return an empty array + // - A positive number: Use `Math.floor(limit)` + // - A negative number: No limit + // - Other: Type-convert, then use the above rules + if (limit === undefined || +limit < 0) { + limit = Infinity; + } else { + limit = Math.floor(+limit); + if (!limit) + return []; + } + + // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero + // and restore it to its original value when we're done using the regex + s = XRegExp.copyAsGlobal(s); + + while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (s.lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) + Array.prototype.push.apply(output, match.slice(1)); + + lastLength = match[0].length; + lastLastIndex = s.lastIndex; + + if (output.length >= limit) + break; + } + + if (s.lastIndex === match.index) + s.lastIndex++; + } + + if (lastLastIndex === str.length) { + if (!nativ.test.call(s, "") || lastLength) + output.push(""); + } else { + output.push(str.slice(lastLastIndex)); + } + + return output.length > limit ? output.slice(0, limit) : output; + }; + + + //--------------------------------- + // Private helper functions + //--------------------------------- + + // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` + // instance with a fresh `lastIndex` (set to zero), preserving properties required for named + // capture. Also allows adding new flags in the process of copying the regex + function clone (regex, additionalFlags) { + if (!XRegExp.isRegExp(regex)) + throw TypeError("type RegExp expected"); + var x = regex._xregexp; + regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); + if (x) { + regex._xregexp = { + source: x.source, + captureNames: x.captureNames ? x.captureNames.slice(0) : null + }; + } + return regex; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function runTokens (pattern, index, scope, context) { + var i = tokens.length, + result, match, t; + // Protect against constructing XRegExps within token handler and trigger functions + isInsideConstructor = true; + // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws + try { + while (i--) { // Run in reverse order + t = tokens[i]; + if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { + t.pattern.lastIndex = index; + match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. + if (match && match.index === index) { + result = { + output: t.handler.call(context, match, scope), + match: match + }; + break; + } + } + } + } catch (err) { + throw err; + } finally { + isInsideConstructor = false; + } + return result; + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + + + //--------------------------------- + // Built-in tokens + //--------------------------------- + + // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the + // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` + + // Comment pattern: (?# ) + XRegExp.addToken( + /\(\?#[^)]*\)/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + } + ); + + // Capturing group (match the opening parenthesis only). + // Required for support of named capturing groups + XRegExp.addToken( + /\((?!\?)/, + function () { + this.captureNames.push(null); + return "("; + } + ); + + // Named capturing group (match the opening delimiter only): (? + XRegExp.addToken( + /\(\?<([$\w]+)>/, + function (match) { + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return "("; + } + ); + + // Named backreference: \k + XRegExp.addToken( + /\\k<([\w$]+)>/, + function (match) { + var index = indexOf(this.captureNames, match[1]); + // Keep backreferences separate from subsequent literal numbers. Preserve back- + // references to named groups that are undefined at this point as literal strings + return index > -1 ? + "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : + match[0]; + } + ); + + // Empty character class: [] or [^] + XRegExp.addToken( + /\[\^?]/, + function (match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in Firefox + return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; + } + ); + + // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) + // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. + XRegExp.addToken( + /^\(\?([imsx]+)\)/, + function (match) { + this.setFlag(match[1]); + return ""; + } + ); + + // Whitespace and comments, in free-spacing (aka extended) mode only + XRegExp.addToken( + /(?:\s+|#.*)+/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + }, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("x");} + ); + + // Dot, in dotall (aka singleline) mode only + XRegExp.addToken( + /\./, + function () {return "[\\s\\S]";}, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("s");} + ); + + + //--------------------------------- + // Backward compatibility + //--------------------------------- + + // Uncomment the following block for compatibility with XRegExp 1.0-1.2: + /* + XRegExp.matchWithinChain = XRegExp.matchChain; + RegExp.prototype.addFlags = function (s) {return clone(this, s);}; + RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; + RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; + RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; + */ + +})(); + diff --git a/vendor/phpmailer/phpmailer/examples/scripts/shAutoloader.js b/vendor/phpmailer/phpmailer/examples/scripts/shAutoloader.js new file mode 100644 index 000000000..9f5942ee2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/examples/scripts/shAutoloader.js @@ -0,0 +1,122 @@ +(function() { + +var sh = SyntaxHighlighter; + +/** + * Provides functionality to dynamically load only the brushes that a needed to render the current page. + * + * There are two syntaxes that autoload understands. For example: + * + * SyntaxHighlighter.autoloader( + * [ 'applescript', 'Scripts/shBrushAppleScript.js' ], + * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ] + * ); + * + * or a more easily comprehendable one: + * + * SyntaxHighlighter.autoloader( + * 'applescript Scripts/shBrushAppleScript.js', + * 'actionscript3 as3 Scripts/shBrushAS3.js' + * ); + */ +sh.autoloader = function() +{ + var list = arguments, + elements = sh.findElements(), + brushes = {}, + scripts = {}, + all = SyntaxHighlighter.all, + allCalled = false, + allParams = null, + i + ; + + SyntaxHighlighter.all = function(params) + { + allParams = params; + allCalled = true; + }; + + function addBrush(aliases, url) + { + for (var i = 0; i < aliases.length; i++) + brushes[aliases[i]] = url; + }; + + function getAliases(item) + { + return item.pop + ? item + : item.split(/\s+/) + ; + } + + // create table of aliases and script urls + for (i = 0; i < list.length; i++) + { + var aliases = getAliases(list[i]), + url = aliases.pop() + ; + + addBrush(aliases, url); + } + + // dynamically add