@@ -96,10 +96,11 @@ discard block |
||
| 96 | 96 | $currentModule = vglobal('currentModule'); |
| 97 | 97 | |
| 98 | 98 | $sortorder = $this->default_sort_order; |
| 99 | - if (!AppRequest::isEmpty('sorder')) |
|
| 100 | - $sortorder = $this->db->sql_escape_string(AppRequest::get('sorder')); |
|
| 101 | - else if ($_SESSION[$currentModule . '_Sort_Order']) |
|
| 102 | - $sortorder = $_SESSION[$currentModule . '_Sort_Order']; |
|
| 99 | + if (!AppRequest::isEmpty('sorder')) { |
|
| 100 | + $sortorder = $this->db->sql_escape_string(AppRequest::get('sorder')); |
|
| 101 | + } else if ($_SESSION[$currentModule . '_Sort_Order']) { |
|
| 102 | + $sortorder = $_SESSION[$currentModule . '_Sort_Order']; |
|
| 103 | + } |
|
| 103 | 104 | |
| 104 | 105 | return $sortorder; |
| 105 | 106 | } |
@@ -114,10 +115,11 @@ discard block |
||
| 114 | 115 | } |
| 115 | 116 | |
| 116 | 117 | $orderby = $use_default_order_by; |
| 117 | - if (!AppRequest::isEmpty('order_by')) |
|
| 118 | - $orderby = $this->db->sql_escape_string(AppRequest::get('order_by')); |
|
| 119 | - else if ($_SESSION[$currentModule . '_Order_By']) |
|
| 120 | - $orderby = $_SESSION[$currentModule . '_Order_By']; |
|
| 118 | + if (!AppRequest::isEmpty('order_by')) { |
|
| 119 | + $orderby = $this->db->sql_escape_string(AppRequest::get('order_by')); |
|
| 120 | + } else if ($_SESSION[$currentModule . '_Order_By']) { |
|
| 121 | + $orderby = $_SESSION[$currentModule . '_Order_By']; |
|
| 122 | + } |
|
| 121 | 123 | return $orderby; |
| 122 | 124 | } |
| 123 | 125 | |
@@ -146,8 +148,9 @@ discard block |
||
| 146 | 148 | $joinedTables = array(); |
| 147 | 149 | |
| 148 | 150 | // Select Custom Field Table Columns if present |
| 149 | - if (!empty($this->customFieldTable)) |
|
| 150 | - $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 151 | + if (!empty($this->customFieldTable)) { |
|
| 152 | + $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 153 | + } |
|
| 151 | 154 | |
| 152 | 155 | $query .= " FROM $this->table_name"; |
| 153 | 156 | |
@@ -285,10 +288,11 @@ discard block |
||
| 285 | 288 | |
| 286 | 289 | $where_auto = " vtiger_crmentity.deleted=0"; |
| 287 | 290 | |
| 288 | - if ($where != '') |
|
| 289 | - $query .= " WHERE ($where) && $where_auto"; |
|
| 290 | - else |
|
| 291 | - $query .= " WHERE $where_auto"; |
|
| 291 | + if ($where != '') { |
|
| 292 | + $query .= " WHERE ($where) && $where_auto"; |
|
| 293 | + } else { |
|
| 294 | + $query .= " WHERE $where_auto"; |
|
| 295 | + } |
|
| 292 | 296 | |
| 293 | 297 | require('user_privileges/user_privileges_' . $current_user->id . '.php'); |
| 294 | 298 | require('user_privileges/sharing_privileges_' . $current_user->id . '.php'); |
@@ -317,8 +321,9 @@ discard block |
||
| 317 | 321 | $select_clause = sprintf('SELECT %s.%s AS recordid, vtiger_users_last_import.deleted, %s', $this->table_name, $this->table_index, $table_cols); |
| 318 | 322 | |
| 319 | 323 | // Select Custom Field Table Columns if present |
| 320 | - if (isset($this->customFieldTable)) |
|
| 321 | - $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 324 | + if (isset($this->customFieldTable)) { |
|
| 325 | + $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 326 | + } |
|
| 322 | 327 | |
| 323 | 328 | $from_clause = " FROM $this->table_name"; |
| 324 | 329 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $db = PearDatabase::getInstance(); |
| 19 | 19 | |
| 20 | 20 | $query = 'UPDATE vtiger_field SET '; |
| 21 | - $query .=' quickcreatesequence= CASE '; |
|
| 21 | + $query .= ' quickcreatesequence= CASE '; |
|
| 22 | 22 | foreach ($blockFieldSequence as $newFieldSequence) { |
| 23 | 23 | $fieldId = $newFieldSequence['fieldid']; |
| 24 | 24 | $sequence = $newFieldSequence['sequence']; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $query .= ' WHEN fieldid=' . $fieldId . ' THEN ' . $sequence; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $query .=' END '; |
|
| 30 | + $query .= ' END '; |
|
| 31 | 31 | $query .= sprintf(' WHERE fieldid IN (%s)', generateQuestionMarks($fieldIdList)); |
| 32 | 32 | $db->pquery($query, array($fieldIdList)); |
| 33 | 33 | } |
@@ -37,13 +37,15 @@ |
||
| 37 | 37 | //To get the first element |
| 38 | 38 | $firstElement = reset($menuModelsList); |
| 39 | 39 | $sourceModule = array($firstElement->get('name')); |
| 40 | - } else |
|
| 41 | - $sourceModule = array($sourceModule); |
|
| 40 | + } else { |
|
| 41 | + $sourceModule = array($sourceModule); |
|
| 42 | + } |
|
| 42 | 43 | |
| 43 | 44 | $quickCreateContents = array(); |
| 44 | 45 | |
| 45 | - if (in_array('Calendar', $sourceModule)) |
|
| 46 | - $sourceModule = array('Calendar', 'Events'); |
|
| 46 | + if (in_array('Calendar', $sourceModule)) { |
|
| 47 | + $sourceModule = array('Calendar', 'Events'); |
|
| 48 | + } |
|
| 47 | 49 | |
| 48 | 50 | foreach ($sourceModule as $module) { |
| 49 | 51 | $recordModel = Vtiger_Record_Model::getCleanInstance($module); |
@@ -237,10 +237,11 @@ |
||
| 237 | 237 | $viewer->assign('MODULENAME', $moduleName); |
| 238 | 238 | $viewer->assign('SAVE', 'Save'); |
| 239 | 239 | $viewer->assign('CANCEL', 'Cancel'); |
| 240 | - if (\vtlib\Functions::userIsAdministrator($current_user)) |
|
| 241 | - $viewer->assign('ISADMIN', 1); |
|
| 242 | - else |
|
| 243 | - $viewer->assign('ISADMIN', 0); |
|
| 240 | + if (\vtlib\Functions::userIsAdministrator($current_user)) { |
|
| 241 | + $viewer->assign('ISADMIN', 1); |
|
| 242 | + } else { |
|
| 243 | + $viewer->assign('ISADMIN', 0); |
|
| 244 | + } |
|
| 244 | 245 | |
| 245 | 246 | // encryption variables |
| 246 | 247 | $viewer->assign('CONFIG', (!$config ? false : array('key' => $config['key']))); |
@@ -52,8 +52,9 @@ discard block |
||
| 52 | 52 | $query = "SELECT vtiger_crmentity.*, $this->table_name.*"; |
| 53 | 53 | |
| 54 | 54 | // Select Custom Field Table Columns if present |
| 55 | - if (!empty($this->customFieldTable)) |
|
| 56 | - $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 55 | + if (!empty($this->customFieldTable)) { |
|
| 56 | + $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 57 | + } |
|
| 57 | 58 | |
| 58 | 59 | $query .= " FROM $this->table_name"; |
| 59 | 60 | |
@@ -180,10 +181,11 @@ discard block |
||
| 180 | 181 | $query .= $this->getNonAdminAccessControlQuery($thismodule, $current_user); |
| 181 | 182 | $where_auto = " vtiger_crmentity.deleted=0"; |
| 182 | 183 | |
| 183 | - if ($where != '') |
|
| 184 | - $query .= " WHERE ($where) && $where_auto"; |
|
| 185 | - else |
|
| 186 | - $query .= " WHERE $where_auto"; |
|
| 184 | + if ($where != '') { |
|
| 185 | + $query .= " WHERE ($where) && $where_auto"; |
|
| 186 | + } else { |
|
| 187 | + $query .= " WHERE $where_auto"; |
|
| 188 | + } |
|
| 187 | 189 | |
| 188 | 190 | return $query; |
| 189 | 191 | } |
@@ -196,8 +198,9 @@ discard block |
||
| 196 | 198 | $select_clause = sprintf("SELECT %s.%s AS recordid, vtiger_users_last_import.deleted,%s", $this->table_name, $this->table_index, $table_cols); |
| 197 | 199 | |
| 198 | 200 | // Select Custom Field Table Columns if present |
| 199 | - if (isset($this->customFieldTable)) |
|
| 200 | - $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 201 | + if (isset($this->customFieldTable)) { |
|
| 202 | + $query .= ", " . $this->customFieldTable[0] . ".* "; |
|
| 203 | + } |
|
| 201 | 204 | |
| 202 | 205 | $from_clause = " FROM $this->table_name"; |
| 203 | 206 | |
@@ -22,10 +22,11 @@ |
||
| 22 | 22 | $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'TransferOwnership', $module); |
| 23 | 23 | $transferModel = new $modelClassName(); |
| 24 | 24 | |
| 25 | - if (empty($record)) |
|
| 26 | - $recordIds = $this->getBaseModuleRecordIds($request); |
|
| 27 | - else |
|
| 28 | - $recordIds = [$record]; |
|
| 25 | + if (empty($record)) { |
|
| 26 | + $recordIds = $this->getBaseModuleRecordIds($request); |
|
| 27 | + } else { |
|
| 28 | + $recordIds = [$record]; |
|
| 29 | + } |
|
| 29 | 30 | if (!empty($recordIds)) { |
| 30 | 31 | $transferModel->transferRecordsOwnership($module, $transferOwnerId, $recordIds); |
| 31 | 32 | } |
@@ -144,7 +144,7 @@ |
||
| 144 | 144 | $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($editViewLinks); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - if (($recordModel->isEditable() && $recordModel->editFieldByModalPermission() ) || $recordModel->editFieldByModalPermission(true)) { |
|
| 147 | + if (($recordModel->isEditable() && $recordModel->editFieldByModalPermission()) || $recordModel->editFieldByModalPermission(true)) { |
|
| 148 | 148 | $fieldByEditData = $recordModel->getFieldToEditByModal(); |
| 149 | 149 | $basicActionLink = [ |
| 150 | 150 | 'linktype' => 'DETAILVIEW', |
@@ -306,8 +306,9 @@ |
||
| 306 | 306 | */ |
| 307 | 307 | public function getWidgets() |
| 308 | 308 | { |
| 309 | - if (count($this->widgetsList) > 0) |
|
| 310 | - return; |
|
| 309 | + if (count($this->widgetsList) > 0) { |
|
| 310 | + return; |
|
| 311 | + } |
|
| 311 | 312 | $moduleModel = $this->getModule(); |
| 312 | 313 | $module = $this->getModuleName(); |
| 313 | 314 | $record = $this->getRecord()->getId(); |
@@ -133,8 +133,9 @@ discard block |
||
| 133 | 133 | $columns = []; |
| 134 | 134 | foreach ($this->getFields() as $key => $field) { |
| 135 | 135 | $column = $field->getColumnName(); |
| 136 | - if (!empty($column) && $column != '-') |
|
| 137 | - $columns[] = $column; |
|
| 136 | + if (!empty($column) && $column != '-') { |
|
| 137 | + $columns[] = $column; |
|
| 138 | + } |
|
| 138 | 139 | foreach ($field->getCustomColumn() as $name => $field) { |
| 139 | 140 | $columns[] = $name; |
| 140 | 141 | } |
@@ -187,8 +188,9 @@ discard block |
||
| 187 | 188 | } |
| 188 | 189 | $fields = []; |
| 189 | 190 | foreach ($fieldPaths as $fieldPath) { |
| 190 | - if (!is_dir($fieldPath)) |
|
| 191 | - continue; |
|
| 191 | + if (!is_dir($fieldPath)) { |
|
| 192 | + continue; |
|
| 193 | + } |
|
| 192 | 194 | foreach (new DirectoryIterator($fieldPath) as $fileinfo) { |
| 193 | 195 | if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { |
| 194 | 196 | $fieldName = str_replace('.php', '', $fileinfo->getFilename()); |
@@ -39,8 +39,9 @@ |
||
| 39 | 39 | $fieldModel->set('fieldvalue', $recordModel->get($fieldName)); |
| 40 | 40 | } else { |
| 41 | 41 | $defaultValue = $fieldModel->getDefaultFieldValue(); |
| 42 | - if (!empty($defaultValue) && !$recordId) |
|
| 43 | - $fieldModel->set('fieldvalue', $defaultValue); |
|
| 42 | + if (!empty($defaultValue) && !$recordId) { |
|
| 43 | + $fieldModel->set('fieldvalue', $defaultValue); |
|
| 44 | + } |
|
| 44 | 45 | } |
| 45 | 46 | $values[$blockLabel][$fieldName] = $fieldModel; |
| 46 | 47 | } |