From 89a56820d2dec1211bbad55b8d635e3f401ce950 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Wed, 20 May 2020 13:52:54 +0400 Subject: [PATCH] Formatting Corrections --- application/controllers/Config.php | 3 +-- application/models/Attribute.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 10814f4b0..719145fd8 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -33,8 +33,7 @@ class Config extends Secure_Controller $license[$i]['text'] = 'LICENSE file must be in OSPOS license directory. You are not allowed to use OSPOS application until the distribution copy of LICENSE file is present.'; } - // read all the files in the dir license - $dir = new DirectoryIterator('license'); + $dir = new DirectoryIterator('license'); // read all the files in the dir license foreach($dir as $fileinfo) { diff --git a/application/models/Attribute.php b/application/models/Attribute.php index d673c81b5..bff19d90f 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -96,10 +96,10 @@ class Attribute extends CI_Model } else { - //Get empty base parent object, as $item_id is NOT an item + //Get empty base parent object, as $item_id is NOT an item $item_obj = new stdClass(); - //Get all the fields from items table + //Get all the fields from items table foreach($this->db->list_fields('attribute_definitions') as $field) { $item_obj->$field = ''; @@ -360,7 +360,7 @@ class Attribute extends CI_Model //From DROPDOWN else if($from_type === DROPDOWN) { - //To TEXT + //To TEXT if(in_array($to_type, [TEXT, CHECKBOX], TRUE)) { $this->db->trans_start(); @@ -372,7 +372,7 @@ class Attribute extends CI_Model $this->db->trans_complete(); - //To CHECKBOX + //To CHECKBOX if($to_type === CHECKBOX) { $checkbox_attribute_values = $this->checkbox_attribute_values($definition_id); @@ -391,7 +391,7 @@ class Attribute extends CI_Model } } - //From any other type + //From any other type else { $success = TRUE; @@ -423,10 +423,10 @@ class Attribute extends CI_Model */ public function save_definition(&$definition_data, $definition_id = NO_DEFINITION_ID) { - //Run these queries as a transaction, we want to make sure we do all or nothing + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - //Definition doesn't exist + //Definition doesn't exist if($definition_id === NO_DEFINITION_ID || !$this->exists($definition_id)) { if($this->exists($definition_id,TRUE)) @@ -440,7 +440,7 @@ class Attribute extends CI_Model } } - //Definition already exists + //Definition already exists else { $this->db->select('definition_type, definition_name'); @@ -599,7 +599,7 @@ class Attribute extends CI_Model { $this->db->trans_start(); - //New Attribute + //New Attribute if(empty($attribute_id) || empty($item_id)) { if(in_array($definition_type, [TEXT, DROPDOWN, CHECKBOX], TRUE)) @@ -628,7 +628,7 @@ class Attribute extends CI_Model 'definition_id' => $definition_id)); } - //Existing Attribute + //Existing Attribute else { $this->db->where('attribute_id', $attribute_id);