@@ -122,6 +122,9 @@ discard block |
||
| 122 | 122 | return html_entity_decode($value); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $fileName |
|
| 127 | + */ |
|
| 125 | 128 | public function outputFile($fileName) |
| 126 | 129 | { |
| 127 | 130 | header("Content-Disposition:attachment;filename=$fileName.xml"); |
@@ -133,6 +136,9 @@ discard block |
||
| 133 | 136 | readfile($this->tmpXmlPath); |
| 134 | 137 | } |
| 135 | 138 | |
| 139 | + /** |
|
| 140 | + * @param string $fileName |
|
| 141 | + */ |
|
| 136 | 142 | protected function outputZipFile($fileName) |
| 137 | 143 | { |
| 138 | 144 | |
@@ -16,8 +16,6 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Create the name of the Inventory data table |
| 19 | - * @param string $module Module name |
|
| 20 | - * @param string $prefix Prefix table |
|
| 21 | 19 | * @return string Table name |
| 22 | 20 | */ |
| 23 | 21 | public function getTableName($type = 'data') |
@@ -118,8 +116,6 @@ discard block |
||
| 118 | 116 | |
| 119 | 117 | /** |
| 120 | 118 | * Get inventory columns |
| 121 | - * @param string $module Module name |
|
| 122 | - * @param boolean $returnInBlock Should the result be divided into blocks |
|
| 123 | 119 | * @return array Inventory columns |
| 124 | 120 | */ |
| 125 | 121 | public function getColumns() |
@@ -164,7 +160,6 @@ discard block |
||
| 164 | 160 | |
| 165 | 161 | /** |
| 166 | 162 | * Retrieve list of all fields |
| 167 | - * @param string $moduleName Module name |
|
| 168 | 163 | * @return array Fields instance Vtiger_Basic_InventoryField |
| 169 | 164 | */ |
| 170 | 165 | public function getAllFields() |
@@ -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()); |
@@ -332,7 +332,6 @@ |
||
| 332 | 332 | |
| 333 | 333 | /** |
| 334 | 334 | * Function to get the list view entries |
| 335 | - * @param Vtiger_Paging_Model $pagingModel |
|
| 336 | 335 | * @return <Array> - Associative array of record id mapped to Vtiger_Record_Model instance. |
| 337 | 336 | */ |
| 338 | 337 | public function getListViewCount() |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Functions returns webservices meta object |
| 45 | - * @return webservices meta |
|
| 45 | + * @return boolean meta |
|
| 46 | 46 | */ |
| 47 | 47 | public function getMeta() |
| 48 | 48 | { |
@@ -302,6 +302,9 @@ |
||
| 302 | 302 | return $viewer->view('DetailViewFullContents.tpl', $moduleName, true); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | + /** |
|
| 306 | + * @param Vtiger_Request $request |
|
| 307 | + */ |
|
| 305 | 308 | public function showModuleSummaryView($request) |
| 306 | 309 | { |
| 307 | 310 | $recordId = $request->get('record'); |
@@ -686,8 +686,9 @@ |
||
| 686 | 686 | $sortImage = 'glyphicon glyphicon-chevron-up'; |
| 687 | 687 | } |
| 688 | 688 | if (empty($orderBy) && empty($sortOrder)) { |
| 689 | - if (is_numeric($relatedModuleName)) |
|
| 690 | - $relatedModuleName = vtlib\Functions::getModuleName($relatedModuleName); |
|
| 689 | + if (is_numeric($relatedModuleName)) { |
|
| 690 | + $relatedModuleName = vtlib\Functions::getModuleName($relatedModuleName); |
|
| 691 | + } |
|
| 691 | 692 | $relatedInstance = CRMEntity::getInstance($relatedModuleName); |
| 692 | 693 | $orderBy = $relatedInstance->default_order_by; |
| 693 | 694 | $sortOrder = $relatedInstance->default_sort_order; |
@@ -81,6 +81,9 @@ discard block |
||
| 81 | 81 | return $mapping; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** |
|
| 85 | + * @param string $flag |
|
| 86 | + */ |
|
| 84 | 87 | public function idmap_storeRecordsInQueue($syncServerId, $recordDetails, $flag, $appid) |
| 85 | 88 | { |
| 86 | 89 | if (!is_array($recordDetails)) |
@@ -182,7 +185,7 @@ discard block |
||
| 182 | 185 | * @param <type> $appid |
| 183 | 186 | * @param <type> $serverid |
| 184 | 187 | * @param <type> $clientid |
| 185 | - * @param <type> $modifiedTime |
|
| 188 | + * @param <type> $clientModifiedTime |
|
| 186 | 189 | * update the mapping of server and client id |
| 187 | 190 | */ |
| 188 | 191 | public function idmap_update($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId) |
@@ -499,6 +502,9 @@ discard block |
||
| 499 | 502 | return $serverIds; |
| 500 | 503 | } |
| 501 | 504 | |
| 505 | + /** |
|
| 506 | + * @param string $flag |
|
| 507 | + */ |
|
| 502 | 508 | public function convertToQueueRecordFormat($record, $flag) |
| 503 | 509 | { |
| 504 | 510 | if ($flag != $this->delete) |
@@ -31,8 +31,9 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $db = PearDatabase::getInstance(); |
| 33 | 33 | $appidresult = $db->pquery("SELECT appid FROM vtiger_wsapp WHERE appkey=?", array($key)); |
| 34 | - if ($db->num_rows($appidresult)) |
|
| 35 | - return $db->query_result($appidresult, 0, 'appid'); |
|
| 34 | + if ($db->num_rows($appidresult)) { |
|
| 35 | + return $db->query_result($appidresult, 0, 'appid'); |
|
| 36 | + } |
|
| 36 | 37 | return false; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -42,8 +43,9 @@ discard block |
||
| 42 | 43 | */ |
| 43 | 44 | public function idmap_get_clientmap($appid, $serverids) |
| 44 | 45 | { |
| 45 | - if (!is_array($serverids)) |
|
| 46 | - $serverids = array($serverids); |
|
| 46 | + if (!is_array($serverids)) { |
|
| 47 | + $serverids = array($serverids); |
|
| 48 | + } |
|
| 47 | 49 | $db = PearDatabase::getInstance(); |
| 48 | 50 | ; |
| 49 | 51 | $result = $db->pquery(sprintf( |
@@ -65,8 +67,9 @@ discard block |
||
| 65 | 67 | */ |
| 66 | 68 | public function idmap_get_clientservermap($appid, $clientids) |
| 67 | 69 | { |
| 68 | - if (!is_array($clientids)) |
|
| 69 | - $clientids = array($clientids); |
|
| 70 | + if (!is_array($clientids)) { |
|
| 71 | + $clientids = array($clientids); |
|
| 72 | + } |
|
| 70 | 73 | |
| 71 | 74 | $db = PearDatabase::getInstance(); |
| 72 | 75 | |
@@ -83,8 +86,9 @@ discard block |
||
| 83 | 86 | |
| 84 | 87 | public function idmap_storeRecordsInQueue($syncServerId, $recordDetails, $flag, $appid) |
| 85 | 88 | { |
| 86 | - if (!is_array($recordDetails)) |
|
| 87 | - $recordDetails = array($recordDetails); |
|
| 89 | + if (!is_array($recordDetails)) { |
|
| 90 | + $recordDetails = array($recordDetails); |
|
| 91 | + } |
|
| 88 | 92 | $db = PearDatabase::getInstance(); |
| 89 | 93 | $params = array(); |
| 90 | 94 | $params[] = $syncServerId; |
@@ -99,8 +103,9 @@ discard block |
||
| 99 | 103 | $db = PearDatabase::getInstance(); |
| 100 | 104 | $checkQuery = "SELECT syncserverid FROM vtiger_wsapp_queuerecords WHERE syncserverid=?"; |
| 101 | 105 | $result = $db->pquery($checkQuery, array($syncServerId)); |
| 102 | - if ($db->num_rows($result) > 0) |
|
| 103 | - return true; |
|
| 106 | + if ($db->num_rows($result) > 0) { |
|
| 107 | + return true; |
|
| 108 | + } |
|
| 104 | 109 | return false; |
| 105 | 110 | } |
| 106 | 111 | |
@@ -148,19 +153,20 @@ discard block |
||
| 148 | 153 | public function idmap_put($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId, $mode = "save") |
| 149 | 154 | { |
| 150 | 155 | $db = PearDatabase::getInstance(); |
| 151 | - if ($mode == $this->create) |
|
| 152 | - $this->idmap_create($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 153 | - else if ($mode == $this->update) |
|
| 154 | - $this->idmap_update($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 155 | - else if ($mode == $this->save) { |
|
| 156 | + if ($mode == $this->create) { |
|
| 157 | + $this->idmap_create($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 158 | + } else if ($mode == $this->update) { |
|
| 159 | + $this->idmap_update($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 160 | + } else if ($mode == $this->save) { |
|
| 156 | 161 | $result = $db->pquery("SELECT * FROM vtiger_wsapp_recordmapping WHERE appid=? and serverid=? and clientid=?", array($appid, $serverid, $clientid)); |
| 157 | - if ($db->num_rows($result) <= 0) |
|
| 158 | - $this->idmap_create($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 159 | - else |
|
| 160 | - $this->idmap_update($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 162 | + if ($db->num_rows($result) <= 0) { |
|
| 163 | + $this->idmap_create($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 164 | + } else { |
|
| 165 | + $this->idmap_update($appid, $serverid, $clientid, $clientModifiedTime, $serverModifiedTime, $serverAppId); |
|
| 166 | + } |
|
| 167 | + } else if ($mode == $this->delete) { |
|
| 168 | + $this->idmap_delete($appid, $serverid, $clientid, $serverAppId); |
|
| 161 | 169 | } |
| 162 | - else if ($mode == $this->delete) |
|
| 163 | - $this->idmap_delete($appid, $serverid, $clientid, $serverAppId); |
|
| 164 | 170 | } |
| 165 | 171 | |
| 166 | 172 | /** |
@@ -229,11 +235,13 @@ discard block |
||
| 229 | 235 | if (empty($type)) { |
| 230 | 236 | throw new WebServiceException('WSAPP06', "No sync type specified"); |
| 231 | 237 | } |
| 232 | - if (is_array($name)) |
|
| 233 | - throw new WebServiceException("WSAPP07", "type is in the wrong format"); |
|
| 238 | + if (is_array($name)) { |
|
| 239 | + throw new WebServiceException("WSAPP07", "type is in the wrong format"); |
|
| 240 | + } |
|
| 234 | 241 | $type = strtolower($type); |
| 235 | - if (!in_array($type, $this->syncTypes)) |
|
| 236 | - throw new WebServiceException('WSAPP05', "Wrong sync type specified"); |
|
| 242 | + if (!in_array($type, $this->syncTypes)) { |
|
| 243 | + throw new WebServiceException('WSAPP05', "Wrong sync type specified"); |
|
| 244 | + } |
|
| 237 | 245 | $db = PearDatabase::getInstance(); |
| 238 | 246 | $uid = uniqid(); |
| 239 | 247 | $db->pquery("INSERT INTO vtiger_wsapp (name, appkey,type) VALUES(?,?,?)", array($name, $uid, $type)); |
@@ -267,10 +275,11 @@ discard block |
||
| 267 | 275 | throw new WebServiceException('WSAPP04', "Access restricted to app"); |
| 268 | 276 | } |
| 269 | 277 | |
| 270 | - if (!is_array($element)) |
|
| 271 | - $records = array($element); |
|
| 272 | - else |
|
| 273 | - $records = $element; |
|
| 278 | + if (!is_array($element)) { |
|
| 279 | + $records = array($element); |
|
| 280 | + } else { |
|
| 281 | + $records = $element; |
|
| 282 | + } |
|
| 274 | 283 | |
| 275 | 284 | //hardcoded since the destination handler will be vtigerCRM |
| 276 | 285 | $serverKey = wsapp_getAppKey("vtigerCRM"); |
@@ -293,13 +302,15 @@ discard block |
||
| 293 | 302 | $clientRecordId = $record['id']; |
| 294 | 303 | |
| 295 | 304 | // Missing client record id? |
| 296 | - if (empty($clientRecordId)) |
|
| 297 | - continue; |
|
| 305 | + if (empty($clientRecordId)) { |
|
| 306 | + continue; |
|
| 307 | + } |
|
| 298 | 308 | |
| 299 | 309 | $lookupRecordId = false; |
| 300 | 310 | $lookupResult = $db->pquery("SELECT serverid,clientmodifiedtime FROM vtiger_wsapp_recordmapping WHERE appid=? && clientid=?", array($appid, $clientRecordId)); |
| 301 | - if ($db->num_rows($lookupResult)) |
|
| 302 | - $lookupRecordId = $db->query_result($lookupResult, 0, 'serverid'); |
|
| 311 | + if ($db->num_rows($lookupResult)) { |
|
| 312 | + $lookupRecordId = $db->query_result($lookupResult, 0, 'serverid'); |
|
| 313 | + } |
|
| 303 | 314 | if (empty($lookupRecordId) && $record['mode'] != "delete") { |
| 304 | 315 | $createRecords[$clientRecordId] = $record['values']; |
| 305 | 316 | $createRecords[$clientRecordId]['module'] = $record['module']; |
@@ -309,8 +320,9 @@ discard block |
||
| 309 | 320 | $deleteRecords[$clientRecordId] = $lookupRecordId; |
| 310 | 321 | } else if (!(empty($lookupRecordId))) { |
| 311 | 322 | $clientLastModifiedTime = $db->query_result($lookupResult, 0, 'clientmodifiedtime'); |
| 312 | - if ($clientLastModifiedTime >= $record['values']['modifiedtime']) |
|
| 313 | - continue; |
|
| 323 | + if ($clientLastModifiedTime >= $record['values']['modifiedtime']) { |
|
| 324 | + continue; |
|
| 325 | + } |
|
| 314 | 326 | $record['values']['id'] = $lookupRecordId; |
| 315 | 327 | $updateRecords[$clientRecordId] = $record['values']; |
| 316 | 328 | $updateRecords[$clientRecordId]['module'] = $record['module']; |
@@ -446,8 +458,9 @@ discard block |
||
| 446 | 458 | */ |
| 447 | 459 | public function map($key, $element, $user) |
| 448 | 460 | { |
| 449 | - if (empty($element)) |
|
| 450 | - return; |
|
| 461 | + if (empty($element)) { |
|
| 462 | + return; |
|
| 463 | + } |
|
| 451 | 464 | $db = PearDatabase::getInstance(); |
| 452 | 465 | $appid = $this->appid_with_key($key); |
| 453 | 466 | $createDetails = $element["create"]; |
@@ -501,9 +514,9 @@ discard block |
||
| 501 | 514 | |
| 502 | 515 | public function convertToQueueRecordFormat($record, $flag) |
| 503 | 516 | { |
| 504 | - if ($flag != $this->delete) |
|
| 505 | - return $record; |
|
| 506 | - else { |
|
| 517 | + if ($flag != $this->delete) { |
|
| 518 | + return $record; |
|
| 519 | + } else { |
|
| 507 | 520 | $recordFormat = array(); |
| 508 | 521 | $recordFormat['id'] = $record['id']; |
| 509 | 522 | return $recordFormat; |
@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param boolean $interactive |
|
| 37 | + */ |
|
| 35 | 38 | public function setArguments($args, $interactive) |
| 36 | 39 | { |
| 37 | 40 | $this->arguments = $args; |
@@ -156,11 +159,18 @@ discard block |
||
| 156 | 159 | } while (true); |
| 157 | 160 | } |
| 158 | 161 | |
| 162 | + /** |
|
| 163 | + * @return string |
|
| 164 | + */ |
|
| 159 | 165 | protected function toAlphaNumeric($value) |
| 160 | 166 | { |
| 161 | 167 | return preg_replace("/[^a-zA-Z0-9_]/", "", $value); |
| 162 | 168 | } |
| 163 | 169 | |
| 170 | + /** |
|
| 171 | + * @param string $dir |
|
| 172 | + * @param string $file_pattern |
|
| 173 | + */ |
|
| 164 | 174 | protected function findFiles($dir, $file_pattern, &$files) |
| 165 | 175 | { |
| 166 | 176 | $items = glob($dir . '/*', GLOB_NOSORT); |
@@ -257,6 +267,9 @@ discard block |
||
| 257 | 267 | echo "DONE.\n"; |
| 258 | 268 | } |
| 259 | 269 | |
| 270 | + /** |
|
| 271 | + * @param string $name |
|
| 272 | + */ |
|
| 260 | 273 | public function find($name) |
| 261 | 274 | { |
| 262 | 275 | return vtlib\Module::getInstance($name); |
@@ -401,7 +401,7 @@ |
||
| 401 | 401 | if (!file_exists($tplpath . $tplname)) { |
| 402 | 402 | $initialContent = "{* License Text *}\n"; |
| 403 | 403 | // Enable debug to make it easy to implement. |
| 404 | - $initialContent.= "{debug}{* REMOVE THIS LINE AFTER IMPLEMENTATION *}\n\n"; |
|
| 404 | + $initialContent .= "{debug}{* REMOVE THIS LINE AFTER IMPLEMENTATION *}\n\n"; |
|
| 405 | 405 | file_put_contents($tplpath . $tplname, $initialContent); |
| 406 | 406 | } |
| 407 | 407 | file_put_contents($tplpath . $tplname, "{* $file *}\n", FILE_APPEND); |
@@ -116,8 +116,9 @@ discard block |
||
| 116 | 116 | protected function prompt($msg = '', $type = self::PROMPT_ANY) |
| 117 | 117 | { |
| 118 | 118 | do { |
| 119 | - if ($msg) |
|
| 120 | - echo $msg; |
|
| 119 | + if ($msg) { |
|
| 120 | + echo $msg; |
|
| 121 | + } |
|
| 121 | 122 | $value = trim(fgets(STDIN)); |
| 122 | 123 | |
| 123 | 124 | if (!$value && $type == self::PROMPT_OPTIONAL) { |
@@ -463,8 +464,9 @@ discard block |
||
| 463 | 464 | $filename = basename($file, true); |
| 464 | 465 | $dir = substr($file, 0, strpos($file, $filename)); |
| 465 | 466 | $dir = str_replace('languages/' . self::BASE_LANG_PREFIX, 'languages/' . $languageInformation['prefix'], $dir); |
| 466 | - if (!file_exists($dir)) |
|
| 467 | - mkdir($dir); |
|
| 467 | + if (!file_exists($dir)) { |
|
| 468 | + mkdir($dir); |
|
| 469 | + } |
|
| 468 | 470 | |
| 469 | 471 | if (isset($languageInformation['prefix_value'])) { |
| 470 | 472 | $contents = file_get_contents($file); |
@@ -146,6 +146,7 @@ |
||
| 146 | 146 | /** |
| 147 | 147 | * Create this field instance |
| 148 | 148 | * @param vtlib\Block Instance of the block to use |
| 149 | + * @param boolean $blockInstance |
|
| 149 | 150 | * @access private |
| 150 | 151 | */ |
| 151 | 152 | public function __create($blockInstance) |
@@ -253,10 +253,11 @@ |
||
| 253 | 253 | */ |
| 254 | 254 | public function save($blockInstance = false) |
| 255 | 255 | { |
| 256 | - if ($this->id) |
|
| 257 | - $this->__update(); |
|
| 258 | - else |
|
| 259 | - $this->__create($blockInstance); |
|
| 256 | + if ($this->id) { |
|
| 257 | + $this->__update(); |
|
| 258 | + } else { |
|
| 259 | + $this->__create($blockInstance); |
|
| 260 | + } |
|
| 260 | 261 | return $this->id; |
| 261 | 262 | } |
| 262 | 263 | |
@@ -56,6 +56,7 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Create this instance |
| 58 | 58 | * @param Module Instance of the module to which this filter should be associated with |
| 59 | + * @param boolean $moduleInstance |
|
| 59 | 60 | * @access private |
| 60 | 61 | */ |
| 61 | 62 | public function __create($moduleInstance) |
@@ -312,6 +313,7 @@ discard block |
||
| 312 | 313 | /** |
| 313 | 314 | * Delete filter associated for module |
| 314 | 315 | * @param Module Instance of module |
| 316 | + * @param ModuleBasic $moduleInstance |
|
| 315 | 317 | */ |
| 316 | 318 | static function deleteForModule($moduleInstance) |
| 317 | 319 | { |
@@ -71,10 +71,14 @@ discard block |
||
| 71 | 71 | $this->sequence = $result->rowCount() ? (int) $db->getSingleValue($result) + 1 : 0; |
| 72 | 72 | } |
| 73 | 73 | if (!isset($this->status)) { |
| 74 | - if ($this->presence == 0) |
|
| 75 | - $this->status = '0'; // Default |
|
| 76 | - else |
|
| 77 | - $this->status = '3'; // Public |
|
| 74 | + if ($this->presence == 0) { |
|
| 75 | + $this->status = '0'; |
|
| 76 | + } |
|
| 77 | + // Default |
|
| 78 | + else { |
|
| 79 | + $this->status = '3'; |
|
| 80 | + } |
|
| 81 | + // Public |
|
| 78 | 82 | } |
| 79 | 83 | |
| 80 | 84 | $db->insert('vtiger_customview', [ |
@@ -122,10 +126,11 @@ discard block |
||
| 122 | 126 | */ |
| 123 | 127 | public function save($moduleInstance = false) |
| 124 | 128 | { |
| 125 | - if ($this->id) |
|
| 126 | - $this->__update(); |
|
| 127 | - else |
|
| 128 | - $this->__create($moduleInstance); |
|
| 129 | + if ($this->id) { |
|
| 130 | + $this->__update(); |
|
| 131 | + } else { |
|
| 132 | + $this->__create($moduleInstance); |
|
| 133 | + } |
|
| 129 | 134 | return $this->id; |
| 130 | 135 | } |
| 131 | 136 | |
@@ -181,8 +186,9 @@ discard block |
||
| 181 | 186 | { |
| 182 | 187 | $adb = \PearDatabase::getInstance(); |
| 183 | 188 | |
| 184 | - if (empty($comparator)) |
|
| 185 | - return $this; |
|
| 189 | + if (empty($comparator)) { |
|
| 190 | + return $this; |
|
| 191 | + } |
|
| 186 | 192 | |
| 187 | 193 | $comparator = self::translateComparator($comparator); |
| 188 | 194 | $cvcolvalue = $this->__getColumnValue($fieldInstance); |
@@ -204,48 +210,50 @@ discard block |
||
| 204 | 210 | $comparator = false; |
| 205 | 211 | if ($tolongform) { |
| 206 | 212 | $comparator = strtolower($value); |
| 207 | - if ($comparator == 'e') |
|
| 208 | - $comparator = 'EQUALS'; |
|
| 209 | - else if ($comparator == 'n') |
|
| 210 | - $comparator = 'NOT_EQUALS'; |
|
| 211 | - else if ($comparator == 's') |
|
| 212 | - $comparator = 'STARTS_WITH'; |
|
| 213 | - else if ($comparator == 'ew') |
|
| 214 | - $comparator = 'ENDS_WITH'; |
|
| 215 | - else if ($comparator == 'c') |
|
| 216 | - $comparator = 'CONTAINS'; |
|
| 217 | - else if ($comparator == 'k') |
|
| 218 | - $comparator = 'DOES_NOT_CONTAINS'; |
|
| 219 | - else if ($comparator == 'l') |
|
| 220 | - $comparator = 'LESS_THAN'; |
|
| 221 | - else if ($comparator == 'g') |
|
| 222 | - $comparator = 'GREATER_THAN'; |
|
| 223 | - else if ($comparator == 'm') |
|
| 224 | - $comparator = 'LESS_OR_EQUAL'; |
|
| 225 | - else if ($comparator == 'h') |
|
| 226 | - $comparator = 'GREATER_OR_EQUAL'; |
|
| 213 | + if ($comparator == 'e') { |
|
| 214 | + $comparator = 'EQUALS'; |
|
| 215 | + } else if ($comparator == 'n') { |
|
| 216 | + $comparator = 'NOT_EQUALS'; |
|
| 217 | + } else if ($comparator == 's') { |
|
| 218 | + $comparator = 'STARTS_WITH'; |
|
| 219 | + } else if ($comparator == 'ew') { |
|
| 220 | + $comparator = 'ENDS_WITH'; |
|
| 221 | + } else if ($comparator == 'c') { |
|
| 222 | + $comparator = 'CONTAINS'; |
|
| 223 | + } else if ($comparator == 'k') { |
|
| 224 | + $comparator = 'DOES_NOT_CONTAINS'; |
|
| 225 | + } else if ($comparator == 'l') { |
|
| 226 | + $comparator = 'LESS_THAN'; |
|
| 227 | + } else if ($comparator == 'g') { |
|
| 228 | + $comparator = 'GREATER_THAN'; |
|
| 229 | + } else if ($comparator == 'm') { |
|
| 230 | + $comparator = 'LESS_OR_EQUAL'; |
|
| 231 | + } else if ($comparator == 'h') { |
|
| 232 | + $comparator = 'GREATER_OR_EQUAL'; |
|
| 233 | + } |
|
| 227 | 234 | } else { |
| 228 | 235 | $comparator = strtoupper($value); |
| 229 | - if ($comparator == 'EQUALS') |
|
| 230 | - $comparator = 'e'; |
|
| 231 | - else if ($comparator == 'NOT_EQUALS') |
|
| 232 | - $comparator = 'n'; |
|
| 233 | - else if ($comparator == 'STARTS_WITH') |
|
| 234 | - $comparator = 's'; |
|
| 235 | - else if ($comparator == 'ENDS_WITH') |
|
| 236 | - $comparator = 'ew'; |
|
| 237 | - else if ($comparator == 'CONTAINS') |
|
| 238 | - $comparator = 'c'; |
|
| 239 | - else if ($comparator == 'DOES_NOT_CONTAINS') |
|
| 240 | - $comparator = 'k'; |
|
| 241 | - else if ($comparator == 'LESS_THAN') |
|
| 242 | - $comparator = 'l'; |
|
| 243 | - else if ($comparator == 'GREATER_THAN') |
|
| 244 | - $comparator = 'g'; |
|
| 245 | - else if ($comparator == 'LESS_OR_EQUAL') |
|
| 246 | - $comparator = 'm'; |
|
| 247 | - else if ($comparator == 'GREATER_OR_EQUAL') |
|
| 248 | - $comparator = 'h'; |
|
| 236 | + if ($comparator == 'EQUALS') { |
|
| 237 | + $comparator = 'e'; |
|
| 238 | + } else if ($comparator == 'NOT_EQUALS') { |
|
| 239 | + $comparator = 'n'; |
|
| 240 | + } else if ($comparator == 'STARTS_WITH') { |
|
| 241 | + $comparator = 's'; |
|
| 242 | + } else if ($comparator == 'ENDS_WITH') { |
|
| 243 | + $comparator = 'ew'; |
|
| 244 | + } else if ($comparator == 'CONTAINS') { |
|
| 245 | + $comparator = 'c'; |
|
| 246 | + } else if ($comparator == 'DOES_NOT_CONTAINS') { |
|
| 247 | + $comparator = 'k'; |
|
| 248 | + } else if ($comparator == 'LESS_THAN') { |
|
| 249 | + $comparator = 'l'; |
|
| 250 | + } else if ($comparator == 'GREATER_THAN') { |
|
| 251 | + $comparator = 'g'; |
|
| 252 | + } else if ($comparator == 'LESS_OR_EQUAL') { |
|
| 253 | + $comparator = 'm'; |
|
| 254 | + } else if ($comparator == 'GREATER_OR_EQUAL') { |
|
| 255 | + $comparator = 'h'; |
|
| 256 | + } |
|
| 249 | 257 | } |
| 250 | 258 | return $comparator; |
| 251 | 259 | } |