From 45d19a08f1123950a513bfe3b8775c10a82dc37b Mon Sep 17 00:00:00 2001 From: shayaaniqbak <52407211+shayaaniqbak@users.noreply.github.com> Date: Tue, 19 Jan 2021 23:03:53 +0500 Subject: [PATCH 1/2] BSCS17045 -----------71-91---------- /controllers/form.php Line #3417- Line is greater then 80 characters /controllers/form.php Line #3426- Line is greater then 80 characters /controllers/form.php Line #3435- Line is greater then 80 characters /controllers/form.php Line #3492- Line is greater then 80 characters /controllers/form.php Line #3505- Line is greater then 80 characters /controllers/form.php Line #3511- Line is greater then 80 characters /controllers/form.php Line #3531- Line is greater then 80 characters /controllers/form.php Line #3617- Line is greater then 80 characters /controllers/form.php Line #3641- Line is greater then 80 characters /controllers/form.php Line #3642- Line is greater then 80 characters /controllers/form.php Line #3666- Line is greater then 80 characters /controllers/form.php Line #3684- Line is greater then 80 characters /controllers/form.php Line #3697- Line is greater then 80 characters /controllers/form.php Line #3736- Line is greater then 80 characters /controllers/form.php Line #3761- Line is greater then 80 characters /controllers/form.php Line #3774- Line is greater then 80 characters /controllers/form.php Line #3786- Line is greater then 80 characters /controllers/form.php Line #3803- Line is greater then 80 characters /controllers/form.php Line #3832- Line is greater then 80 characters /views/templates/header_iframe.php Line #5- Variable not defined in lower_snake_case /views/templates/header.php Line #66- Variable not defined in lower_snake_case --- application/controllers/form.php | 61 +++++++++++++------ application/views/templates/header.php | 20 +++--- application/views/templates/header_iframe.php | 2 +- 3 files changed, 53 insertions(+), 30 deletions(-) diff --git a/application/controllers/form.php b/application/controllers/form.php index 689e42a..bf233bf 100644 --- a/application/controllers/form.php +++ b/application/controllers/form.php @@ -3414,7 +3414,8 @@ public function update($slug) { $data['upgrade_from_google_play'] = $upgrade_from_google_play; $location_required = 1; - if (isset($app_general_setting->location_required) && $app_general_setting->location_required == 0) { + if (isset($app_general_setting->location_required) && + $app_general_setting->location_required == 0) { $location_required = 0; } $data['location_required'] = $location_required; @@ -3423,7 +3424,9 @@ public function update($slug) { if (!$this->acl->hasSuperAdmin()) { $login_data = $this->session->userdata('logged_in'); if ($request_app['department_id'] != $login_data['login_department_id']) { - $this->session->set_flashdata('validate', array('message' => "You don't have enough permissions to do this task.", 'type' => 'warning')); + $this->session->set_flashdata('validate', array('message' + => "You don't have enough permissions to do this task." + , 'type' => 'warning')); redirect(base_url() . 'apps'); } if ($request_app['user_id'] == $login_data['login_user_id']) { @@ -3432,7 +3435,8 @@ public function update($slug) { } else { $data['super_app_user'] = 'yes'; } - $settings_exist = get_app_general_settings($app_id); //$this->app_model->get_app_settings($app_id); + $settings_exist = get_app_general_settings($app_id); + //$this->app_model->get_app_settings($app_id); //print_r($app_general_setting); $data['app_settings'] = $settings_exist; $data['filter'] = $selected_form['filter']; @@ -3489,7 +3493,8 @@ public function update($slug) { $data['post_url'] = $selected_form['post_url']; } if ($history_id) { - $history_rec = $this->form_model->get_form_history($form_id, $view_id, $history_id); + $history_rec = $this->form_model->get_form_history + ($form_id, $view_id, $history_id); $data['description'] = $history_rec['description']; } $app = $this->app_model->get_app($app_id); @@ -3502,13 +3507,16 @@ public function update($slug) { $data['view_id'] = $view_id; $app_id = $selected_form['app_id']; if (!$this->acl->hasPermission('form', 'edit')) { - $this->session->set_flashdata('validate', array('message' => "You don't have enough permissions to do this task.", 'type' => 'warning')); + $this->session->set_flashdata('validate', array('message' + => "You don't have enough permissions to do this task." + , 'type' => 'warning')); redirect(base_url() . 'apps'); } $session_data = $this->session->userdata('logged_in'); session_to_page($session_data, $data); $data['active_tab'] = 'form_update'; - $data['pageTitle'] = $app['name'] . '-' . $selected_form['name'] . ' Edit-' . PLATFORM_NAME; + $data['pageTitle'] = $app['name'] . '-' + . $selected_form['name'] . ' Edit-' . PLATFORM_NAME; $this->load->view('templates/form_builder_header', $data); $this->load->view('form/update', $data); $this->load->view('templates/footer', $data); @@ -3528,7 +3536,8 @@ public function appbuilder($slug) { } $this->load->library('form_validation'); if ($this->input->post()) { - $this->form_validation->set_rules('app_name', 'App Name', 'trim|required|xss_clean'); + $this->form_validation->set_rules('app_name', 'App Name', + 'trim|required|xss_clean'); if ($this->form_validation->run() == FALSE) { echo json_encode(array('status' => '2')); exit; @@ -3614,7 +3623,8 @@ public function add($slug) { $data['app_id'] = $app_id; $data['app_name'] = $app['name']; if (!$this->acl->hasPermission('form', 'add')) { - $this->session->set_flashdata('validate', array('message' => "You don't have enough permissions to do this task.", 'type' => 'warning')); + $this->session->set_flashdata('validate', array('message' => + "You don't have enough permissions to do this task.", 'type' => 'warning')); redirect(base_url() . 'apps'); } $session_data = $this->session->userdata('logged_in'); @@ -3638,8 +3648,10 @@ public function add($slug) { $this->db->insert('form', $data); $form_id = $this->db->insert_id(); updateDataBase($form_id, ""); - //array parameters : action, description, before, after, app_id, app_name, form_id, form_name - $logary = array('action' => 'insert', 'description' => 'add new form', 'after' => json_encode($data)); + //array parameters : action, description, before, + //after, app_id, app_name, form_id, form_name + $logary = array('action' => 'insert', 'description' + => 'add new form', 'after' => json_encode($data)); addlog($logary); //Get last inserted form id $forms_by_app = $this->form_model->get_form_by_app($app_id); @@ -3663,7 +3675,10 @@ public function add($slug) { if (!$this->upload->do_upload('userfile_addform')) { $this->data['error'] = $this->upload->display_errors(); - $this->session->set_flashdata('validate', array('message' => $this->upload->display_errors() . ', Default icon has been embeded with your application.', 'type' => 'warning')); + $this->session->set_flashdata('validate', array('message' => + $this->upload->display_errors() + . ', Default icon has been embeded with your application.', + 'type' => 'warning')); } else { //success $imageData = $this->upload->data(); @@ -3681,7 +3696,8 @@ public function add($slug) { } } } else { - $from_path = FORM_IMG_DISPLAY_PATH . '../form_icons/default_' . $total_forms . '.png'; + $from_path = FORM_IMG_DISPLAY_PATH . '../form_icons/default_' + . $total_forms . '.png'; @copy($from_path,$abs_path.$iconName); // file_put_contents($abs_path . $iconName, file_get_contents($from_path)); @@ -3694,7 +3710,8 @@ public function add($slug) { ); $this->db->where('id', $form_id); $this->db->update('form', $change_next); - $this->session->set_flashdata('validate', array('message' => 'New form added successfully.', 'type' => 'success')); + $this->session->set_flashdata('validate', array('message' => + 'New form added successfully.', 'type' => 'success')); redirect(base_url() . 'app-form/' . $form_id); } @@ -3733,7 +3750,8 @@ public function movetoview($slug) { if($this->input->post()){ $form_id = $slug;//form_id which want to move to view - $view_id = $this->input->post('view_id');//view_id where want to move the selected form + $view_id = $this->input->post('view_id'); + //view_id where want to move the selected form $selected_form = $this->form_model->get_form($form_id,$view_id); $app_id = $selected_form['app_id']; $view_id_session = 0; @@ -3758,7 +3776,8 @@ public function movetoview($slug) { 'post_url' => $selected_form['post_url'] ); //file_write() - file_write($abs_path.'/'.$view_id.'_'.$file_name_html,$selected_form['full_description']); + file_write($abs_path.'/'.$view_id.'_'.$file_name_html, + $selected_form['full_description']); } else{ @@ -3771,7 +3790,8 @@ public function movetoview($slug) { 'full_description' => $selected_view_form['fv_full_description'], 'post_url' => $selected_view_form['fv_post_url'] ); - file_write($abs_path.'/'.$view_id.'_'.$file_name_html,$selected_view_form['fv_full_description']); + file_write($abs_path.'/'.$view_id.'_'.$file_name_html, + $selected_view_form['fv_full_description']); } @@ -3783,7 +3803,8 @@ public function movetoview($slug) { $this->db->insert('form_views', $form_move_data); } - $this->session->set_flashdata('validate', array('message' => 'Active form copied to your required view successfully', 'type' => 'success')); + $this->session->set_flashdata('validate', array('message' => + 'Active form copied to your required view successfully', 'type' => 'success')); redirect(base_url() . 'app-form/' . $form_id); } } else { @@ -3800,7 +3821,8 @@ public function copy($slug) { if ($this->session->userdata('logged_in')) { if($this->input->post()){ $form_id = $slug;//form_id which want to copy - $app_id = $this->input->post('app_id_popup');//app_id where want to copy the selected form + $app_id = $this->input->post('app_id_popup'); + //app_id where want to copy the selected form @@ -3829,7 +3851,8 @@ public function copy($slug) { ); $this->db->insert('form', $data); $form_id_new = $this->db->insert_id(); - $old_file = './assets/images/data/form_icons/' . $selected_form['app_id'] . '/formicon_' . $slug . '.png'; + $old_file = './assets/images/data/form_icons/' + $old_file .= $selected_form['app_id'] . '/formicon_' . $slug . '.png'; $new_file = './assets/images/data/form_icons/' . $app_id . '/formicon_' . $form_id_new . '.png'; $old = umask(0); @mkdir('./assets/images/data/form_icons/' . $app_id, 0777); diff --git a/application/views/templates/header.php b/application/views/templates/header.php index d65242f..f277f71 100644 --- a/application/views/templates/header.php +++ b/application/views/templates/header.php @@ -61,12 +61,12 @@