update v1.0.5.1

This commit is contained in:
sujitprasad
2016-01-27 19:46:55 +05:30
parent 366acf316e
commit b1d1ebbbef
699 changed files with 148371 additions and 1404 deletions

View File

@@ -91,8 +91,19 @@ class HelptopicController extends Controller {
*/
public function store(Help_topic $topic, HelptopicRequest $request) {
try {
if($request->custom_form){
$custom_form = $request->custom_form;
} else {
$custom_form = null;
}
if($request->auto_assign){
$auto_assign = $request->auto_assign;
} else {
$auto_assign = null;
}
/* Check whether function success or not */
$topic->fill($request->input())->save();
$topic->fill($request->except('custom_form','auto_assign'))->save();
// $topics->fill($request->except('custom_form','auto_assign'))->save();
/* redirect to Index page with Success Message */
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
} catch (Exception $e) {

View File

@@ -88,7 +88,7 @@ class LanguageController extends Controller {
*/
public function getLanguages()
{
$path = 'code/resources/lang';
$path = '../resources/lang';
$values = scandir($path); //Extracts names of directories present in lang directory
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
return \Datatable::collection(new Collection($values))
@@ -150,7 +150,7 @@ class LanguageController extends Controller {
//Checking if package already exists or not in lang folder
$path = 'code/resources/lang';
$path = '../resources/lang';
if (in_array(Input::get('iso-code'), scandir($path))) {
//sending back with error message
@@ -168,10 +168,9 @@ class LanguageController extends Controller {
// checking file is valid.
if (Input::file('File')->isValid()) {
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
$destinationPath = 'code/public/uploads/'; // defining uploading path
$extractpath = 'code/resources/lang/'.Input::get('iso-code');//defining extracting path
$destinationPath = '../public/uploads/'; // defining uploading path
$extractpath = '../resources/lang/'.Input::get('iso-code');//defining extracting path
mkdir($extractpath); //creating directroy for extracting uploadd file
//mkdir($destinationPath);
Input::file('File')->move($destinationPath, $name); // uploading file to given path
@@ -183,42 +182,32 @@ class LanguageController extends Controller {
if(!empty($directories)){ //if extract folder contains subfolder
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
//$success2 = File::delete($destinationPath.'/'.$name);
if($success){
//sending back with error message
Session::flash('fails', 'Error in directory structure. Zip file must contain language php files only. Try Again.');
return Redirect::back()->withInput();
}
}
} else {
// sending back with success message
Session::flash('success', "uploaded successfully.");
Session::flash('link',"change-language/".Input::get('iso-code'));
return Redirect::route('LanguageController');
}
} else {
// sending back with error message.
Session::flash('fails', 'uploaded file is not valid');
return Redirect::route('form');
}
}
}
}
/**
*allow user to download language template file
*@return type
*/
Public function download()
{
return response()->download('code/public/downloads/en.zip');
Public function download() {
return response()->download('../public/downloads/en.zip');
}
/**
@@ -228,9 +217,9 @@ class LanguageController extends Controller {
*/
public function deleteLanguage($lang){
if($lang !== App::getLocale()){
$deletePath = 'code/resources/lang/'.$lang; //define file path to delete
$deletePath = '../resources/lang/'.$lang; //define file path to delete
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
if($success){
if($success) {
//sending back with success message
Session::flash('success', 'Language package deleted successfully.');
return Redirect::back();
@@ -245,6 +234,4 @@ class LanguageController extends Controller {
return redirect('languages');
}
}
}

View File

@@ -80,21 +80,19 @@ class SettingsController extends Controller {
* @param type CompanyRequest $request
* @return Response
*/
public function postcompany($id, Company $company, CompanyRequest $request) {
public function postcompany($id, Company $company, CompanyRequest $request) {
/* fetch the values of company request */
$companys = $company->whereId('1')->first();
if (Input::file('logo')) {
$name = Input::file('logo')->getClientOriginalName();
$destinationPath = 'lb-faveo/dist/';
$destinationPath = 'lb-faveo/media/company/';
$fileName = rand(0000, 9999) . '.' . $name;
Input::file('logo')->move($destinationPath, $fileName);
$companys->logo = $fileName;
}
if($request->input('use_logo')==null)
{
$companys->use_logo = '0';
}
if($request->input('use_logo')==null) {
$companys->use_logo = '0';
}
/* Check whether function success or not */
try {
$companys->fill($request->except('logo'))->save();