@@ -221,7 +221,7 @@ |
||
| 221 | 221 | /** |
| 222 | 222 | * Checks if given record has valid pdf template |
| 223 | 223 | * @param Vtiger_Request $request |
| 224 | - * @return boolean true if valid template exists for this record |
|
| 224 | + * @return boolean|null true if valid template exists for this record |
|
| 225 | 225 | */ |
| 226 | 226 | public function hasValidTemplate(Vtiger_Request $request) |
| 227 | 227 | { |
@@ -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']; |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | if (!isset($groupData[$displayValue]['count'])) { |
| 93 | 93 | $groupData[$displayValue]['count'] = 1; |
| 94 | 94 | } else { |
| 95 | - $groupData[$displayValue]['count'] ++; |
|
| 95 | + $groupData[$displayValue]['count']++; |
|
| 96 | 96 | } |
| 97 | 97 | if (!isset($groupData[$displayValue]['link'])) { |
| 98 | 98 | $moduleModel = $this->getTargetModuleModel(); |
@@ -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 | |
@@ -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 | { |