@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * Function to save record |
| 75 | - * @param <Vtiger_Request> $request - values of the record |
|
| 75 | + * @param Vtiger_Request $request - values of the record |
|
| 76 | 76 | * @return <RecordModel> - record Model of saved record |
| 77 | 77 | */ |
| 78 | 78 | public function saveRecord($request) |
@@ -87,8 +87,9 @@ discard block |
||
| 87 | 87 | $relatedRecordId = $recordModel->getId(); |
| 88 | 88 | |
| 89 | 89 | $relationModel = Vtiger_Relation_Model::getInstance($parentModuleModel, $relatedModule); |
| 90 | - if ($relationModel) |
|
| 91 | - $relationModel->addRelation($parentRecordId, $relatedRecordId); |
|
| 90 | + if ($relationModel) { |
|
| 91 | + $relationModel->addRelation($parentRecordId, $relatedRecordId); |
|
| 92 | + } |
|
| 92 | 93 | } |
| 93 | 94 | if ($request->get('imgDeleted')) { |
| 94 | 95 | $imageIds = $request->get('imageid'); |
@@ -144,8 +145,9 @@ discard block |
||
| 144 | 145 | $fieldValue = trim($fieldValue); |
| 145 | 146 | } |
| 146 | 147 | $recordModel->set($fieldName, $fieldValue); |
| 147 | - } else |
|
| 148 | - $recordModel->set($fieldName, null); |
|
| 148 | + } else { |
|
| 149 | + $recordModel->set($fieldName, null); |
|
| 150 | + } |
|
| 149 | 151 | } |
| 150 | 152 | return $recordModel; |
| 151 | 153 | } |
@@ -113,6 +113,9 @@ discard block |
||
| 113 | 113 | return []; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + /** |
|
| 117 | + * @param Vtiger_Widget_Model $widgetModel |
|
| 118 | + */ |
|
| 116 | 119 | public function setWidgetModel($widgetModel) |
| 117 | 120 | { |
| 118 | 121 | $this->widgetModel = $widgetModel; |
@@ -127,6 +130,9 @@ discard block |
||
| 127 | 130 | } |
| 128 | 131 | } |
| 129 | 132 | |
| 133 | + /** |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 130 | 136 | public function getType() |
| 131 | 137 | { |
| 132 | 138 | return $this->extraData['chartType']; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if (!isset($groupData[$displayValue]['count'])) { |
| 113 | 113 | $groupData[$displayValue]['count'] = 1; |
| 114 | 114 | } else { |
| 115 | - $groupData[$displayValue]['count'] ++; |
|
| 115 | + $groupData[$displayValue]['count']++; |
|
| 116 | 116 | } |
| 117 | 117 | if (!isset($groupData[$displayValue]['link'])) { |
| 118 | 118 | $moduleModel = $this->getTargetModuleModel(); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $count = []; |
| 126 | 126 | while ($row = $db->getRow($result)) { |
| 127 | 127 | $sectorId = $this->getSector($sectors, $row[$groupField]); |
| 128 | - if($sectorId !== false){ |
|
| 128 | + if ($sectorId !== false) { |
|
| 129 | 129 | if (!isset($count[$sectorId])) { |
| 130 | 130 | $count[$sectorId] = 1; |
| 131 | 131 | } else { |
@@ -134,15 +134,15 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | } |
| 137 | - foreach($sectors as $sectorId => $sectorValue){ |
|
| 137 | + foreach ($sectors as $sectorId => $sectorValue) { |
|
| 138 | 138 | $moduleModel = $this->getTargetModuleModel(); |
| 139 | 139 | $displayValue = $groupFieldModel->getDisplayValue($sectorValue); |
| 140 | - $displayValue .= ' - (' . (int)$count[$sectorId] .')'; |
|
| 141 | - $groupData[$displayValue]['count'] = (int)$sectorValue ; |
|
| 142 | - if($sectorId == 0){ |
|
| 143 | - $groupData[$displayValue]['link'] = $moduleModel->getListViewUrl() . "&viewname=$filterId" . '&search_params=' . json_encode([[[$fieldName, 'm', $sectorValue]]]);; |
|
| 140 | + $displayValue .= ' - (' . (int) $count[$sectorId] . ')'; |
|
| 141 | + $groupData[$displayValue]['count'] = (int) $sectorValue; |
|
| 142 | + if ($sectorId == 0) { |
|
| 143 | + $groupData[$displayValue]['link'] = $moduleModel->getListViewUrl() . "&viewname=$filterId" . '&search_params=' . json_encode([[[$fieldName, 'm', $sectorValue]]]); ; |
|
| 144 | 144 | } else { |
| 145 | - $groupData[$displayValue]['link'] = $moduleModel->getListViewUrl() . "&viewname=$filterId" . '&search_params=' . json_encode([[[$fieldName, 'm', $sectorValue],[$fieldName, 'g', $sectors[$sectorId - 1]]]]);; |
|
| 145 | + $groupData[$displayValue]['link'] = $moduleModel->getListViewUrl() . "&viewname=$filterId" . '&search_params=' . json_encode([[[$fieldName, 'm', $sectorValue], [$fieldName, 'g', $sectors[$sectorId - 1]]]]); ; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | } |
@@ -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() |
@@ -497,9 +497,9 @@ |
||
| 497 | 497 | $db = PearDatabase::getInstance(); |
| 498 | 498 | $query = sprintf('UPDATE `%s` SET sequence = CASE id ', $this->getTableName('fields')); |
| 499 | 499 | foreach ($sequenceList as $sequence => $id) { |
| 500 | - $query .=' WHEN ' . $id . ' THEN ' . $sequence; |
|
| 500 | + $query .= ' WHEN ' . $id . ' THEN ' . $sequence; |
|
| 501 | 501 | } |
| 502 | - $query .=' END '; |
|
| 502 | + $query .= ' END '; |
|
| 503 | 503 | $query .= sprintf(' WHERE id IN (%s)', generateQuestionMarks($sequenceList)); |
| 504 | 504 | return $db->pquery($query, array_values($sequenceList)); |
| 505 | 505 | } |
@@ -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() |
@@ -169,8 +169,9 @@ |
||
| 169 | 169 | $headerFieldModels = []; |
| 170 | 170 | $headerFields = $listViewContoller->getListViewHeaderFields(); |
| 171 | 171 | foreach ($headerFields as $fieldName => $webserviceField) { |
| 172 | - if ($webserviceField && !in_array($webserviceField->getPresence(), [0, 2])) |
|
| 173 | - continue; |
|
| 172 | + if ($webserviceField && !in_array($webserviceField->getPresence(), [0, 2])) { |
|
| 173 | + continue; |
|
| 174 | + } |
|
| 174 | 175 | $headerFieldModels[$fieldName] = Vtiger_Field_Model::getInstance($fieldName, $module); |
| 175 | 176 | } |
| 176 | 177 | return $headerFieldModels; |
@@ -24,6 +24,9 @@ discard block |
||
| 24 | 24 | return $this->get('id'); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $key |
|
| 29 | + */ |
|
| 27 | 30 | public function get($key) |
| 28 | 31 | { |
| 29 | 32 | if (in_array($key, ['conditions', 'params']) && !is_array(parent::get($key))) { |
@@ -33,16 +36,25 @@ discard block |
||
| 33 | 36 | } |
| 34 | 37 | } |
| 35 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $key |
|
| 41 | + */ |
|
| 36 | 42 | public function getRaw($key) |
| 37 | 43 | { |
| 38 | 44 | return parent::get($key); |
| 39 | 45 | } |
| 40 | 46 | |
| 47 | + /** |
|
| 48 | + * @return boolean |
|
| 49 | + */ |
|
| 41 | 50 | public function getModule() |
| 42 | 51 | { |
| 43 | 52 | return Vtiger_Module_Model::getInstance($this->getName()); |
| 44 | 53 | } |
| 45 | 54 | |
| 55 | + /** |
|
| 56 | + * @return boolean |
|
| 57 | + */ |
|
| 46 | 58 | public function getRelatedModule() |
| 47 | 59 | { |
| 48 | 60 | return Vtiger_Module_Model::getInstance($this->getRelatedName()); |
@@ -66,6 +78,10 @@ discard block |
||
| 66 | 78 | } |
| 67 | 79 | } |
| 68 | 80 | |
| 81 | + /** |
|
| 82 | + * @param integer $recordId |
|
| 83 | + * @param string $view |
|
| 84 | + */ |
|
| 69 | 85 | public function getActiveTemplatesForRecord($recordId, $view, $moduleName = false) |
| 70 | 86 | { |
| 71 | 87 | $log = LoggerManager::getInstance(); |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | protected $listviewRecords; |
| 21 | 21 | protected $targetModuleModel; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param Vtiger_Widget_Model $widgetModel |
|
| 25 | + */ |
|
| 23 | 26 | public function setWidgetModel($widgetModel) |
| 24 | 27 | { |
| 25 | 28 | $this->widgetModel = $widgetModel; |
@@ -42,8 +42,9 @@ |
||
| 42 | 42 | public function getTargetFields() |
| 43 | 43 | { |
| 44 | 44 | $fields = $this->extraData['fields']; |
| 45 | - if (!in_array("id", $fields)) |
|
| 46 | - $fields[] = "id"; |
|
| 45 | + if (!in_array("id", $fields)) { |
|
| 46 | + $fields[] = "id"; |
|
| 47 | + } |
|
| 47 | 48 | return $fields; |
| 48 | 49 | } |
| 49 | 50 | |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | $targetModuleFocus = CRMEntity::getInstance($targetModuleName); |
| 141 | 141 | $filterId = $this->widgetModel->get('filterid'); |
| 142 | 142 | $filterModel = CustomView_Record_Model::getInstanceById($filterId); |
| 143 | - if(!empty($filterModel->get('sort'))){ |
|
| 143 | + if (!empty($filterModel->get('sort'))) { |
|
| 144 | 144 | $sort = $filterModel->get('sort'); |
| 145 | 145 | $query .= sprintf(' ORDER BY %s ', str_replace(',', ' ', $sort)); |
| 146 | 146 | } else if ($targetModuleFocus->default_order_by && $targetModuleFocus->default_sort_order) { |
@@ -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 | { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Function to get the Module to which the record belongs |
| 72 | - * @return Vtiger_Module_Model |
|
| 72 | + * @return boolean |
|
| 73 | 73 | */ |
| 74 | 74 | public function getModule() |
| 75 | 75 | { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** |
| 220 | 220 | * Function to retieve display value for a field |
| 221 | 221 | * @param <String> $fieldName - field name for which values need to get |
| 222 | - * @return <String> |
|
| 222 | + * @return string |
|
| 223 | 223 | */ |
| 224 | 224 | public function getDisplayValue($fieldName, $recordId = false, $rawText = false) |
| 225 | 225 | { |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | /** |
| 326 | 326 | * Static Function to get the instance of the Vtiger Record Model given the recordid and the module name |
| 327 | 327 | * @param <Number> $recordId |
| 328 | - * @param <String> $moduleName |
|
| 328 | + * @param <String> $module |
|
| 329 | 329 | * @return Vtiger_Record_Model or Module Specific Record Model instance |
| 330 | 330 | */ |
| 331 | 331 | public static function getInstanceById($recordId, $module = null) |
@@ -493,7 +493,6 @@ discard block |
||
| 493 | 493 | |
| 494 | 494 | /** |
| 495 | 495 | * Function to get Display value for RelatedList |
| 496 | - * @param <String> $value |
|
| 497 | 496 | * @return <String> |
| 498 | 497 | */ |
| 499 | 498 | public function getRelatedListDisplayValue($fieldName) |
@@ -596,6 +595,7 @@ discard block |
||
| 596 | 595 | /** |
| 597 | 596 | * Function to set record module field values |
| 598 | 597 | * @param parent record model |
| 598 | + * @param Vtiger_Record_Model $parentRecordModel |
|
| 599 | 599 | */ |
| 600 | 600 | public function setRecordFieldValues($parentRecordModel) |
| 601 | 601 | { |