@@ -54,8 +54,9 @@ |
||
| 54 | 54 | |
| 55 | 55 | private function addWidgetToListView($moduleNames, $widgetName, $widgetType = 'LIST_VIEW_HEADER') |
| 56 | 56 | { |
| 57 | - if (empty($moduleNames)) |
|
| 58 | - return; |
|
| 57 | + if (empty($moduleNames)) { |
|
| 58 | + return; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | if (is_string($moduleNames)) { |
| 61 | 62 | $moduleNames = array($moduleNames); |
@@ -52,6 +52,10 @@ |
||
| 52 | 52 | VALUES (?,?,?,?,?,?,?)", array($fieldid, $blockid, $sequence, 'Project Templates', '', 'LBL_PROJECT_TEMPLATES_DESCRIPTION', 'index.php?module=' . $moduleName . '&parent=Settings&view=Index')); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $moduleNames |
|
| 57 | + * @param string $widgetName |
|
| 58 | + */ |
|
| 55 | 59 | private function addWidgetToListView($moduleNames, $widgetName, $widgetType = 'LIST_VIEW_HEADER') |
| 56 | 60 | { |
| 57 | 61 | if (empty($moduleNames)) |
@@ -97,8 +97,9 @@ |
||
| 97 | 97 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments'); |
| 98 | 98 | if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) { |
| 99 | 99 | include_once 'modules/ModComments/ModComments.php'; |
| 100 | - if (class_exists('ModComments')) |
|
| 101 | - ModComments::addWidgetTo(array('Ideas')); |
|
| 100 | + if (class_exists('ModComments')) { |
|
| 101 | + ModComments::addWidgetTo(array('Ideas')); |
|
| 102 | + } |
|
| 102 | 103 | } |
| 103 | 104 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModTracker'); |
| 104 | 105 | if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) { |
@@ -87,8 +87,9 @@ |
||
| 87 | 87 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments'); |
| 88 | 88 | if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) { |
| 89 | 89 | include_once 'modules/ModComments/ModComments.php'; |
| 90 | - if (class_exists('ModComments')) |
|
| 91 | - ModComments::addWidgetTo(array('SSalesProcesses')); |
|
| 90 | + if (class_exists('ModComments')) { |
|
| 91 | + ModComments::addWidgetTo(array('SSalesProcesses')); |
|
| 92 | + } |
|
| 92 | 93 | } |
| 93 | 94 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModTracker'); |
| 94 | 95 | if ($modcommentsModuleInstance && file_exists('modules/ModTracker/ModTracker.php')) { |
@@ -213,6 +213,7 @@ |
||
| 213 | 213 | * @param integer $id - ssalesprocessesid |
| 214 | 214 | * @param array $parentSSalesProcesses - Array of all the parent sales |
| 215 | 215 | * returns All the parent Sales of the given ssalesprocessesid in array format |
| 216 | + * @param integer[] $encounteredSalesProcesses |
|
| 216 | 217 | */ |
| 217 | 218 | public function getParentSales($id, &$parentSSalesProcesses, &$encounteredSalesProcesses, $depthBase = 0) |
| 218 | 219 | { |
@@ -28,23 +28,25 @@ |
||
| 28 | 28 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
| 29 | 29 | $vatId = $recordModel->get('vat_id'); |
| 30 | 30 | } else { |
| 31 | - if (array_key_exists('vat_id', $recordForm)) |
|
| 32 | - $vatId = $recordForm['vat_id']; |
|
| 31 | + if (array_key_exists('vat_id', $recordForm)) { |
|
| 32 | + $vatId = $recordForm['vat_id']; |
|
| 33 | + } |
|
| 33 | 34 | } |
| 34 | 35 | if ($ID != 0 && $ID != '' && !array_key_exists('accountname', $recordForm)) { |
| 35 | 36 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
| 36 | 37 | $accountName = $recordModel->get('accountname'); |
| 37 | 38 | } else { |
| 38 | - if (array_key_exists('accountname', $recordForm)) |
|
| 39 | - $accountName = $recordForm['accountname']; |
|
| 39 | + if (array_key_exists('accountname', $recordForm)) { |
|
| 40 | + $accountName = $recordForm['accountname']; |
|
| 41 | + } |
|
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | $moduleModel = Vtiger_Module_Model::getInstance($moduleName); |
| 43 | 45 | $hierarchyField = Vtiger_Field_Model::getInstance('account_id', $moduleModel); |
| 44 | 46 | if ($hierarchyField->isActiveField()) { |
| 45 | - if (array_key_exists('account_id', $recordForm)) |
|
| 46 | - $hierarchyValue = $recordForm['account_id']; |
|
| 47 | - elseif ($ID != 0 && $ID != '' && !array_key_exists('account_id', $recordForm)) { |
|
| 47 | + if (array_key_exists('account_id', $recordForm)) { |
|
| 48 | + $hierarchyValue = $recordForm['account_id']; |
|
| 49 | + } elseif ($ID != 0 && $ID != '' && !array_key_exists('account_id', $recordForm)) { |
|
| 48 | 50 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
| 49 | 51 | $hierarchyValue = $recordModel->get('account_id'); |
| 50 | 52 | } |
@@ -104,8 +104,9 @@ |
||
| 104 | 104 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments'); |
| 105 | 105 | if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) { |
| 106 | 106 | include_once 'modules/ModComments/ModComments.php'; |
| 107 | - if (class_exists('ModComments')) |
|
| 108 | - ModComments::addWidgetTo(array('OSSTimeControl')); |
|
| 107 | + if (class_exists('ModComments')) { |
|
| 108 | + ModComments::addWidgetTo(array('OSSTimeControl')); |
|
| 109 | + } |
|
| 109 | 110 | } |
| 110 | 111 | } else if ($event_type == 'module.disabled') { |
| 111 | 112 | // TODO Handle actions when this module is disabled. |
@@ -37,17 +37,19 @@ |
||
| 37 | 37 | $sourceData = $entity->column_fields; |
| 38 | 38 | if ($sourceModule == 'HelpDesk') { |
| 39 | 39 | $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['contact_id']); |
| 40 | - if (vtlib\Functions::getCRMRecordType($sourceData['parent_id']) != 'Accounts') |
|
| 41 | - unset($sourceData['parent_id']); |
|
| 42 | - else |
|
| 43 | - $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['parent_id']); |
|
| 40 | + if (vtlib\Functions::getCRMRecordType($sourceData['parent_id']) != 'Accounts') { |
|
| 41 | + unset($sourceData['parent_id']); |
|
| 42 | + } else { |
|
| 43 | + $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['parent_id']); |
|
| 44 | + } |
|
| 44 | 45 | } else if ($sourceModule == 'Project') { |
| 45 | 46 | $query = sprintf("select * from vtiger_account where accountid = %s", $sourceData['linktoaccountscontacts']); |
| 46 | 47 | $ifExist = $adb->query($query, true, "Błąd podczas pobierania danych z vtiger_crmentityrel"); |
| 47 | - if ($adb->num_rows($ifExist) > 0) |
|
| 48 | - $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
| 49 | - else |
|
| 50 | - $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
| 48 | + if ($adb->num_rows($ifExist) > 0) { |
|
| 49 | + $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
| 50 | + } else { |
|
| 51 | + $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
| 52 | + } |
|
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | |
@@ -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); |