Merge remote-tracking branch 'refs/remotes/origin/arindam-bugg'

# Conflicts:
#	app/Http/Controllers/Agent/helpdesk/UserController.php
#	resources/lang/en/lang.php
This commit is contained in:
Manish Verma
2016-10-28 12:17:58 +05:30
3 changed files with 238 additions and 16 deletions

View File

@@ -752,13 +752,49 @@ class UserController extends Controller
public function UserAssignOrg($id)
{
$org_name = Input::get('org');
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
$user_org = new User_org();
$user_org->org_id = $org;
$user_org->user_id = $id;
$user_org->save();
if ($org_name) {
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
if ($org) {
$user_org = new User_org();
$user_org->org_id = $org;
$user_org->user_id = $id;
$user_org->save();
return 1;
return 1;
} else {
return 0;
}
} else {
return 2;
}
}
/**
* Assigning an user to an organization.
*
* @param type $id
*
* @return type boolean
*/
public function UsereditAssignOrg($id)
{
$org_name = Input::get('org');
if ($org_name) {
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
if ($org) {
$user_org = User_org::where('user_id', '=', $id)->first();
$user_org->org_id = $org;
$user_org->user_id = $id;
$user_org->save();
return 1;
} else {
return 0;
}
} else {
return 2;
}
}
public function orgAssignUser($id)

View File

@@ -645,6 +645,7 @@ Route::group(['middleware' => ['web']], function () {
// Route::get('message' , 'MessageController@show');
Route::post('lock', ['as' => 'lock', 'uses' => 'Agent\helpdesk\TicketController@lock']);
Route::patch('user-org-assign/{id}', ['as' => 'user.assign.org', 'uses' => 'Agent\helpdesk\UserController@UserAssignOrg']);
Route::patch('user-org-edit-assign/{id}', ['as' => 'user.editassign.org', 'uses' => 'Agent\helpdesk\UserController@UsereditAssignOrg']);
Route::patch('/user-org/{id}', 'Agent\helpdesk\UserController@User_Create_Org');
Route::patch('/head-org/{id}', 'Agent\helpdesk\OrganizationController@Head_Org');
// Department ticket