update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -9,6 +9,7 @@ use App\Http\Controllers\Controller;
use App\Model\helpdesk\Email\Emails;
// models
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Followup;
use App\Model\helpdesk\Ticket\Ticket_Status;
use App\Model\helpdesk\Ticket\Ticket_Thread;
use App\Model\helpdesk\Ticket\Tickets;
@@ -316,4 +317,101 @@ class UnAuthController extends Controller
} else {
}
}
/**
*@category function to change system's language
*
*@param string $lang //desired language's iso code
*
*@return response
*/
public static function changeLanguage($lang)
{
//if(Cache::has('language'))
//{
// return Cache::get('language');
//} else return 'false';
// Cache::put('language',$)
$path = base_path('resources/lang'); // Path to check available language packages
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
// dd(array_key_exists($lang, Config::get('languages')));
// app()->setLocale($lang);
\Cache::forever('language', $lang);
// dd(Cache::get('language'));
// dd()
} else {
return false;
}
return true;
}
// Follow up tickets
public function followup()
{
$followup = Followup::whereId('1')->first();
$condition = $followup->condition;
// dd($condition);
switch ($condition) {
case 'everyMinute':
$followup_set = ' + 1 minute';
break;
case 'everyFiveMinutes':
$followup_set = ' + 5 minute';
break;
case 'everyTenMinutes':
$followup_set = ' + 10 minute';
break;
case 'everyThirtyMinutes':
$followup_set = ' + 30 minute';
break;
case 'hourly':
$followup_set = ' + 1 hours';
break;
case 'daily':
$followup_set = ' + 1 day';
break;
case 'weekly':
$followup_set = ' + 7 day';
break;
case 'monthly':
$followup_set = ' + 30 day';
break;
case 'yearly':
$followup_set = ' + 365 day';
break;
}
if ($followup->status = 1) {
$tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get();
// dd( $tickets);
// $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id');
// dd( $tickets);
// $id=1;
foreach ($tickets as $ticket) {
// $id=1;
// $id++;
// $ticket=Tickets::where('status', '!=', 5)->get();
// dd($ticket);
// if($ticket != null){
// dd('here');
$ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set));
// dd($ck);
$current_time = date('Y-m-d H:i:s');
if ($current_time > $ck) {
$ticket->follow_up = 1;
$ticket->save();
// Tickets::where('id', '=',$id)
// ->update(['follow_up' => 1]);
// }
}
// if($id=2)
// {dd($ticket);}
}
}
}
}