diff --git a/data/CRMEntity.php b/data/CRMEntity.php index 4c417531cbfb5b22da7c1ad389d3961bdad81e09..3a096d823147af80441a22dc76328af30aa23191 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -2398,7 +2398,7 @@ class CRMEntity { where vtiger_role.parentrole like '" . $current_user_parent_role_seq . "::%') or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=" . $current_user->id . " and tabid=" . $tabid . ") or ("; - if (sizeof($current_user_groups) > 0) { + if (php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_crmentity.smownerid in (" . implode(",", $current_user_groups) . ") or "; } $sec_query .= " vtiger_crmentity.smownerid in(select vtiger_tmp_read_group_sharing_per.sharedgroupid diff --git a/include/QueryGenerator/QueryGenerator.php b/include/QueryGenerator/QueryGenerator.php index 210515d4f5b731d69cc7acd560f7f2dd19ebe687..8844692dd9cc25e0ce0e222757b4ede1ec1596f6 100644 --- a/include/QueryGenerator/QueryGenerator.php +++ b/include/QueryGenerator/QueryGenerator.php @@ -1379,7 +1379,7 @@ class QueryGenerator { global $mod_strings; // Get all the keys for the for the Picklist value $mod_keys = array_keys($mod_strings, $value); - if(sizeof($mod_keys) >= 1) { + if(php7_sizeof($mod_keys) >= 1) { // Iterate on the keys, to get the first key which doesn't start with LBL_ (assuming it is not used in PickList) foreach($mod_keys as $mod_idx=>$mod_key) { $stridx = strpos($mod_key, 'LBL_'); diff --git a/include/Webservices/Create.php b/include/Webservices/Create.php index 8f72b7dd868a1c390a78a427602331b6b8064012..369180dc60db9d5858e86185f6376b84e7513bcc 100644 --- a/include/Webservices/Create.php +++ b/include/Webservices/Create.php @@ -72,7 +72,7 @@ function vtws_create($elementType, $element, $user) { if ($meta->hasMandatoryFields($element)) { $ownerFields = $meta->getOwnerFields(); - if (is_array($ownerFields) && sizeof($ownerFields) > 0) { + if (is_array($ownerFields) && php7_sizeof($ownerFields) > 0) { foreach ($ownerFields as $ownerField) { if (isset($element[$ownerField]) && $element[$ownerField] !== null && !$meta->hasAssignPrivilege($element[$ownerField])) { diff --git a/include/Webservices/Revise.php b/include/Webservices/Revise.php index 3d53d184180613344f2d21860f30bb14dc3355b2..02a1a0fd7580b1d57cfead5756498a5b49d870e5 100644 --- a/include/Webservices/Revise.php +++ b/include/Webservices/Revise.php @@ -78,7 +78,7 @@ $meta->isUpdateMandatoryFields($element); $ownerFields = $meta->getOwnerFields(); - if(is_array($ownerFields) && sizeof($ownerFields) >0){ + if(is_array($ownerFields) && php7_sizeof($ownerFields) >0){ foreach($ownerFields as $ownerField){ if(isset($element[$ownerField]) && $element[$ownerField]!==null && !$meta->hasAssignPrivilege($element[$ownerField])){ diff --git a/include/Webservices/Update.php b/include/Webservices/Update.php index 360f4fec7d8cc893325362930e29b656fde4adb7..ce008d80a4cfd36bb5692e51df181381af9d3a2f 100644 --- a/include/Webservices/Update.php +++ b/include/Webservices/Update.php @@ -79,7 +79,7 @@ $meta->hasMandatoryFields($element); $ownerFields = $meta->getOwnerFields(); - if(is_array($ownerFields) && sizeof($ownerFields) >0){ + if(is_array($ownerFields) && php7_sizeof($ownerFields) >0){ foreach($ownerFields as $ownerField){ if(isset($element[$ownerField]) && $element[$ownerField]!==null && !$meta->hasAssignPrivilege($element[$ownerField])){ diff --git a/include/Webservices/VTQL_Lexer.php b/include/Webservices/VTQL_Lexer.php index 4ea26e2c008d801e8e1dfc4e7757f9367ce7114e..8c5e1e1fffe70c467614835c8ac462ff2a0d23d4 100644 --- a/include/Webservices/VTQL_Lexer.php +++ b/include/Webservices/VTQL_Lexer.php @@ -12,7 +12,7 @@ incState($lexer); } function incState($lexer){ $lexer->current_state++; -if($lexer->current_state === sizeof($lexer->mandatory_states)){ +if($lexer->current_state === php7_sizeof($lexer->mandatory_states)){ $lexer->mandatory = false; } } diff --git a/include/Webservices/VTQL_Parser.php b/include/Webservices/VTQL_Parser.php index 0537eda0f3246a3bbcb87b92cb58f86873dcb7b6..03d8d2b579709f372449fc585cc1a9a7a255d03f 100644 --- a/include/Webservices/VTQL_Parser.php +++ b/include/Webservices/VTQL_Parser.php @@ -208,14 +208,14 @@ function buildSelectStmt($sqlDump){ // ensure init before use if(!isset($sqlDump['where_condition']['operators'])) $sqlDump['where_condition']['operators'] = array(); - if((sizeof($sqlDump['where_condition']['column_names']) == - sizeof($sqlDump['where_condition']['column_values'])) && - (sizeof($sqlDump['where_condition']['column_operators']) == sizeof($sqlDump['where_condition']['operators'])+1)){ + if((php7_sizeof($sqlDump['where_condition']['column_names']) == + php7_sizeof($sqlDump['where_condition']['column_values'])) && + (php7_sizeof($sqlDump['where_condition']['column_operators']) == php7_sizeof($sqlDump['where_condition']['operators'])+1)){ $this->query = $this->query.' WHERE ('; $i=0; $referenceFields = $meta->getReferenceFieldDetails(); $ownerFields = $meta->getOwnerFields(); - for(;$i<sizeof($sqlDump['where_condition']['column_values']);++$i){ + for(;$i<php7_sizeof($sqlDump['where_condition']['column_values']);++$i){ if(!$fieldcol[$sqlDump['where_condition']['column_names'][$i]]){ throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to access ".$sqlDump['where_condition']['column_names'][$i]." attribute denied."); } @@ -256,7 +256,7 @@ function buildSelectStmt($sqlDump){ } $this->query = $this->query.$columnTable[$fieldcol[$whereField]].'.'. $fieldcol[$whereField]." ".$whereOperator." ".$whereValue; - if($i <sizeof($sqlDump['where_condition']['column_values'])-1){ + if($i <php7_sizeof($sqlDump['where_condition']['column_values'])-1){ $this->query = $this->query.' '; $this->query = $this->query.$sqlDump['where_condition']['operators'][$i].' '; } @@ -301,7 +301,7 @@ function buildSelectStmt($sqlDump){ if($sqlDump['limit']){ $i=0; $offset =false; - if(sizeof($sqlDump['limit'])>1){ + if(php7_sizeof($sqlDump['limit'])>1){ $offset = true; } $this->query = $this->query.' LIMIT '; @@ -1215,7 +1215,7 @@ $this->out['where_condition']['operators'][] = $this->yystack[$this->yyidx + 0]- $this->out['columnDone']=true; $this->out['where_condition']['column_names'][] = $this->yystack[$this->yyidx + -2]->minor; if(strcmp($this->yystack[$this->yyidx + -2]->minor, 'id')===0){ -$prev = $this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1]; +$prev = $this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1]; if(is_array($prev)){ $new = array(); foreach($prev as $ind=>$val){ @@ -1223,21 +1223,21 @@ $val = trim($val,'\'"'); $value = vtws_getIdComponents($val); $new[] = $value[1]; } -$this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1] = $new; +$this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1] = $new; }else{ $prev = trim($prev,'\'"'); $value = vtws_getIdComponents($prev); -if(strcasecmp($this->out['where_condition']['column_operators'][sizeof($this->out['where_condition']['column_operators'])-1],'like')===0){ +if(strcasecmp($this->out['where_condition']['column_operators'][php7_sizeof($this->out['where_condition']['column_operators'])-1],'like')===0){ $value[1] = "'".$value[1]."'"; } -$this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1] = $value[1]; +$this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1] = $value[1]; } } } #line 1240 "e:\workspace\nonadmin\pkg\vtiger\extensions\Webservices\VTQL_parser.php" #line 82 "e:\workspace\nonadmin\pkg\vtiger\extensions\Webservices\VTQL_parser.y" function yy_r17(){ -$length = ($this->out['where_condition']['column_values'])? sizeof($this->out['where_condition']['column_values']):0; +$length = ($this->out['where_condition']['column_values'])? php7_sizeof($this->out['where_condition']['column_values']):0; $pos = $length - 1; if($pos < 0){ $pos = 0; diff --git a/include/Webservices/WebserviceField.php b/include/Webservices/WebserviceField.php index b34dc2144a412844df6cd1ee48bd48538ab852f9..58018452be69871808dbcb971fc6de36f8952682 100644 --- a/include/Webservices/WebserviceField.php +++ b/include/Webservices/WebserviceField.php @@ -412,7 +412,7 @@ class WebserviceField{ }else{ $user = VTWS_PreserveGlobal::getGlobal('current_user'); $details = getPickListValues($fieldName,$user->roleid); - for($i=0;$i<sizeof($details);++$i){ + for($i=0;$i<php7_sizeof($details);++$i){ $elem = array(); $picklistValue = decode_html($details[$i]); $elem["label"] = getTranslatedString($picklistValue, $moduleName, $language); diff --git a/include/utils/UserInfoUtil.php b/include/utils/UserInfoUtil.php index bfc9904f0810265c46bc695df4be2803937bd077..b66edb0a90df16a5f08f4ac752a37d907b48e830 100755 --- a/include/utils/UserInfoUtil.php +++ b/include/utils/UserInfoUtil.php @@ -656,7 +656,7 @@ function isReadPermittedBySharing($module,$tabid,$actionid,$record_id) foreach($relatedModuleArray as $parModId) { $parRecordOwner=getParentRecordOwner($tabid,$parModId,$record_id); - if(sizeof($parRecordOwner) > 0) + if(php7_sizeof($parRecordOwner) > 0) { $parModName=getTabname($parModId); $rel_var=$parModName."_".$module."_share_read_permission"; @@ -796,7 +796,7 @@ function isReadWritePermittedBySharing($module,$tabid,$actionid,$record_id) foreach($relatedModuleArray as $parModId) { $parRecordOwner=getParentRecordOwner($tabid,$parModId,$record_id); - if(sizeof($parRecordOwner) > 0) + if(php7_sizeof($parRecordOwner) > 0) { $parModName=getTabname($parModId); $rel_var=$parModName."_".$module."_share_write_permission"; @@ -1055,7 +1055,7 @@ function getRoleInformation($roleid) $parentrole=$adb->query_result($result,0,'parentrole'); $roledepth=$adb->query_result($result,0,'depth'); $parentRoleArr=explode('::',$parentrole); - $immediateParent=$parentRoleArr[sizeof($parentRoleArr)-2]; + $immediateParent=$parentRoleArr[php7_sizeof($parentRoleArr)-2]; $roleDet=Array(); $roleDet[]=$rolename; $roleDet[]=$parentrole; @@ -1236,7 +1236,7 @@ function deleteRoleRelatedSharingRules($roleId) $colNameArr=explode('::',$colname); $query="select shareid from ".$tablename." where ".$colNameArr[0]."=?"; $params = array($roleId); - if(sizeof($colNameArr) >1) + if(php7_sizeof($colNameArr) >1) { $query .=" or ".$colNameArr[1]."=?"; array_push($params, $roleId); @@ -1275,7 +1275,7 @@ function deleteGroupRelatedSharingRules($grpId) $colNameArr=explode('::',$colname); $query="select shareid from ".$tablename." where ".$colNameArr[0]."=?"; $params = array($grpId); - if(sizeof($colNameArr) >1) + if(php7_sizeof($colNameArr) >1) { $query .=" or ".$colNameArr[1]."=?"; array_push($params, $grpId); @@ -1455,7 +1455,7 @@ function getCombinedUserGlobalPermissions($userId) $log->debug("Entering getCombinedUserGlobalPermissions(".$userId.") method ..."); global $adb; $profArr=getUserProfile($userId); - $no_of_profiles=sizeof($profArr); + $no_of_profiles=php7_sizeof($profArr); $userGlobalPerrArr=Array(); $userGlobalPerrArr=getProfileGlobalPermission($profArr[0]); @@ -1501,7 +1501,7 @@ function getCombinedUserTabsPermissions($userId) $log->debug("Entering getCombinedUserTabsPermissions(".$userId.") method ..."); global $adb; $profArr=getUserProfile($userId); - $no_of_profiles=sizeof($profArr); + $no_of_profiles=php7_sizeof($profArr); $userTabPerrArr=Array(); $userTabPerrArr=getProfileTabsPermission($profArr[0]); @@ -1546,7 +1546,7 @@ function getCombinedUserActionPermissions($userId) $log->debug("Entering getCombinedUserActionPermissions(".$userId.") method ..."); global $adb; $profArr=getUserProfile($userId); - $no_of_profiles=sizeof($profArr); + $no_of_profiles=php7_sizeof($profArr); $actionPerrArr=Array(); $actionPerrArr=getProfileAllActionPermission($profArr[0]); @@ -1702,7 +1702,7 @@ function getCurrentUserGroupList($userid = false) { require('user_privileges/user_privileges_' . $userid . '.php'); $grpList = array(); - if (sizeof($current_user_groups) > 0) { + if (php7_sizeof($current_user_groups) > 0) { $i = 0; foreach ($current_user_groups as $grpid) { array_push($grpList, $grpid); @@ -1739,7 +1739,7 @@ function constructList($array,$data_type) global $log; $log->debug("Entering constructList(".$array.",".$data_type.") method ..."); $list= array(); - if(sizeof($array) > 0) + if(php7_sizeof($array) > 0) { $i=0; foreach($array as $value) @@ -1780,7 +1780,7 @@ function getListViewSecurityParameter($module) or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1792,7 +1792,7 @@ function getListViewSecurityParameter($module) "or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') " . "or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1805,7 +1805,7 @@ function getListViewSecurityParameter($module) "or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') " . "or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1820,7 +1820,7 @@ function getListViewSecurityParameter($module) $sec_query .= " or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1832,7 +1832,7 @@ function getListViewSecurityParameter($module) $sec_query .= " and (vtiger_crmentity.smownerid in($current_user->id) or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") "; $sec_query .= " or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1854,7 +1854,7 @@ function getListViewSecurityParameter($module) $condition = null; $sec_query .= " and (vtiger_crmentity.smownerid in($current_user->id) $condition or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%')"; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " or ((vtiger_groups.groupid in (". implode(",", $current_user_groups) .")))"; } @@ -1867,7 +1867,7 @@ function getListViewSecurityParameter($module) //Adding crteria for group sharing $sec_query .= " or (("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1878,7 +1878,7 @@ function getListViewSecurityParameter($module) { $sec_query .= " and (vtiger_crmentity.smownerid in($current_user->id) or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1892,7 +1892,7 @@ function getListViewSecurityParameter($module) //Adding crteria for group sharing $sec_query .= " or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1906,7 +1906,7 @@ function getListViewSecurityParameter($module) //Adding crteria for group sharing $sec_query .= " or (("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1918,7 +1918,7 @@ function getListViewSecurityParameter($module) $sec_query .= " and (vtiger_crmentity.smownerid in($current_user->id) or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or (("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1931,7 +1931,7 @@ function getListViewSecurityParameter($module) { $sec_query .= " and (vtiger_crmentity.smownerid in($current_user->id) or vtiger_crmentity.smownerid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%') or vtiger_crmentity.smownerid in(select shareduserid from vtiger_tmp_read_user_sharing_per where userid=".$current_user->id." and tabid=".$tabid.") or (("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } @@ -1947,7 +1947,7 @@ function getListViewSecurityParameter($module) $sec_query .= " or ("; - if(sizeof($current_user_groups) > 0) + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid in (". implode(",", $current_user_groups) .") or "; } diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php index d34eb446f2c0625d10f68c4e23b997137317c17b..bc2233942ef6c127cdcd59588cac13129aa79297 100644 --- a/include/utils/VtlibUtils.php +++ b/include/utils/VtlibUtils.php @@ -968,4 +968,9 @@ function php7_count($value) { return count($value); } +function php7_sizeof($value) { + // PHP 8.x does not allow sizeof(null) + return php7_count($value); +} + ?> diff --git a/layouts/v7/modules/Settings/Vtiger/Sidebar.tpl b/layouts/v7/modules/Settings/Vtiger/Sidebar.tpl index 68be5b099bb70175560ecf4f62fbbc792e8fa30c..5a4babb060de45dc4ca07f0a12b6518d9ef68a5f 100644 --- a/layouts/v7/modules/Settings/Vtiger/Sidebar.tpl +++ b/layouts/v7/modules/Settings/Vtiger/Sidebar.tpl @@ -19,7 +19,7 @@ {foreach item=BLOCK_MENUS from=$SETTINGS_MENUS} {assign var=BLOCK_NAME value=$BLOCK_MENUS->getLabel()} {assign var=BLOCK_MENU_ITEMS value=$BLOCK_MENUS->getMenuItems()} - {assign var=NUM_OF_MENU_ITEMS value= $BLOCK_MENU_ITEMS|@sizeof} + {assign var=NUM_OF_MENU_ITEMS value= $BLOCK_MENU_ITEMS|@php7_sizeof} {if $NUM_OF_MENU_ITEMS gt 0} <div class="settingsgroup-panel panel panel-default instaSearch"> <div id="{$BLOCK_NAME}_accordion" class="app-nav" role="tab"> diff --git a/layouts/v7/modules/Users/UsersSidebar.tpl b/layouts/v7/modules/Users/UsersSidebar.tpl index bfb41ac0d933f99ee1729d7beab8ed05246f80c7..5d8e17dbb7b0657589b9a041269a818fecdca439 100644 --- a/layouts/v7/modules/Users/UsersSidebar.tpl +++ b/layouts/v7/modules/Users/UsersSidebar.tpl @@ -12,7 +12,7 @@ <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="settingsgroup-panel panel panel-default"> {foreach item=BLOCK_MENUS key=BLOCK_NAME from=$SETTINGS_MENU_LIST} - {assign var=NUM_OF_MENU_ITEMS value= $BLOCK_MENUS|@sizeof} + {assign var=NUM_OF_MENU_ITEMS value= $BLOCK_MENUS|@php7_sizeof} {if $NUM_OF_MENU_ITEMS gt 0} <div id="{$BLOCK_NAME}_accordion" class="app-nav" role="tab"> <div class="app-settings-accordion"> diff --git a/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl b/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl index b4d8eee92f22cd5565578cca6cba004d193da764..51cc1b3fde8be07cc12b2ceafb400b44755b32d5 100644 --- a/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl +++ b/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl @@ -51,7 +51,7 @@ </tr> </thead> {foreach item=LISTVIEW_ENTRY key=GROUP_NAME from=$LISTVIEW_ENTRIES} - {assign var=groupCount value=$LISTVIEW_ENTRY|@sizeof} + {assign var=groupCount value=$LISTVIEW_ENTRY|@php7_sizeof} {assign var=recordCount value=0} {foreach item=RECORD from=$LISTVIEW_ENTRY name=listview} <tr class="listViewEntries" data-id='{$RECORD.recordid}' id="{$MODULE}_listView_row_{$smarty.foreach.listview.index+1}"> diff --git a/layouts/vlayout/modules/Vtiger/FindDuplicateContents.tpl b/layouts/vlayout/modules/Vtiger/FindDuplicateContents.tpl index 6b52fca0baddedc1bae77ce5786254059e06219e..5d4abd529083a342f68ccd4fe89553cc21b89769 100644 --- a/layouts/vlayout/modules/Vtiger/FindDuplicateContents.tpl +++ b/layouts/vlayout/modules/Vtiger/FindDuplicateContents.tpl @@ -55,7 +55,7 @@ </thead> {assign var=mergeRecordCount value=0} {foreach item=LISTVIEW_ENTRY key=GROUP_NAME from=$LISTVIEW_ENTRIES} - {assign var=groupCount value=$LISTVIEW_ENTRY|@sizeof} + {assign var=groupCount value=$LISTVIEW_ENTRY|@php7_sizeof} {assign var=recordCount value=0} {foreach item=RECORD from=$LISTVIEW_ENTRY name=listview} <tr class="listViewEntries" data-id='{$RECORD.recordid}' id="{$MODULE}_listView_row_{$smarty.foreach.listview.index+1}"> diff --git a/modules/CustomView/CustomView.php b/modules/CustomView/CustomView.php index ba543ef414d5f5df01cca64dd6e37d13fed22153..8c5876b48ee1ad02c8504a222cae291793a6f6fe 100644 --- a/modules/CustomView/CustomView.php +++ b/modules/CustomView/CustomView.php @@ -2028,7 +2028,7 @@ class CustomView extends CRMEntity { $temp_result[] = $row['id']; } $user_array = $temp_result; - if (sizeof($user_array) > 0) { + if (php7_sizeof($user_array) > 0) { if (!in_array($current_user->id, $user_array)) $permission = "no"; else diff --git a/modules/Reports/Reports.php b/modules/Reports/Reports.php index 1b69d955525307b612525e591ff1880605cedd44..920f8714d205a86965066e55a8241386bd7f3233 100644 --- a/modules/Reports/Reports.php +++ b/modules/Reports/Reports.php @@ -1400,7 +1400,7 @@ function getEscapedColumns($selectedfields) list($tablename,$colname,$module_field,$fieldname,$single) = split(":",$fieldcolname); require('user_privileges/user_privileges_'.$current_user->id.'.php'); list($module,$field) = split("_",$module_field); - if(sizeof($permitted_fields) == 0 && $is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) + if(php7_sizeof($permitted_fields) == 0 && $is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { $permitted_fields = $this->getaccesfield($module); } diff --git a/modules/Users/CreateUserPrivilegeFile.php b/modules/Users/CreateUserPrivilegeFile.php index 6f6a6f6ae738d45daea56b4b2a8acfb760970db1..ab133756c4108bce8ac28a7f6b4da9facfb9fe17 100644 --- a/modules/Users/CreateUserPrivilegeFile.php +++ b/modules/Users/CreateUserPrivilegeFile.php @@ -1369,7 +1369,7 @@ function constructArray($var) function constructSingleStringValueArray($var) { - $size = sizeof($var); + $size = php7_sizeof($var); $i=1; if (is_array($var)) { @@ -1399,7 +1399,7 @@ function constructSingleStringValueArray($var) function constructSingleStringKeyAndValueArray($var) { - $size = sizeof($var); + $size = php7_sizeof($var); $i=1; if (is_array($var)) { @@ -1430,7 +1430,7 @@ function constructSingleStringKeyAndValueArray($var) */ function constructSingleStringKeyValueArray($var) { global $adb; - $size = sizeof($var); + $size = php7_sizeof($var); $i=1; if (is_array($var)) { $code = 'array('; @@ -1669,7 +1669,7 @@ function populateSharingPrivileges($enttype,$userid,$module,$pertype, $var_name_ // Lookup for the variable if not set through function argument if(!$var_name_arr) $var_name_arr=$$var_name; $user_arr=Array(); - if(sizeof($var_name_arr['ROLE']) > 0) + if(php7_sizeof($var_name_arr['ROLE']) > 0) { foreach($var_name_arr['ROLE'] as $roleid=>$roleusers) { @@ -1685,7 +1685,7 @@ function populateSharingPrivileges($enttype,$userid,$module,$pertype, $var_name_ } } } - if(sizeof($var_name_arr['GROUP']) > 0) + if(php7_sizeof($var_name_arr['GROUP']) > 0) { foreach($var_name_arr['GROUP'] as $grpid=>$grpusers) { @@ -1718,7 +1718,7 @@ function populateSharingPrivileges($enttype,$userid,$module,$pertype, $var_name_ // Lookup for the variable if not set through function argument if(!$var_name_arr) $var_name_arr=$$var_name; $grp_arr=Array(); - if(sizeof($var_name_arr['GROUP']) > 0) + if(php7_sizeof($var_name_arr['GROUP']) > 0) { foreach($var_name_arr['GROUP'] as $grpid=>$grpusers) @@ -1772,7 +1772,7 @@ function populateRelatedSharingPrivileges($enttype,$userid,$module,$relmodule,$p // Lookup for the variable if not set through function argument if(!$var_name_arr) $var_name_arr=$$var_name; $user_arr=Array(); - if(sizeof($var_name_arr['ROLE']) > 0) + if(php7_sizeof($var_name_arr['ROLE']) > 0) { foreach($var_name_arr['ROLE'] as $roleid=>$roleusers) { @@ -1788,7 +1788,7 @@ function populateRelatedSharingPrivileges($enttype,$userid,$module,$relmodule,$p } } } - if(sizeof($var_name_arr['GROUP']) > 0) + if(php7_sizeof($var_name_arr['GROUP']) > 0) { foreach($var_name_arr['GROUP'] as $grpid=>$grpusers) { @@ -1821,7 +1821,7 @@ function populateRelatedSharingPrivileges($enttype,$userid,$module,$relmodule,$p // Lookup for the variable if not set through function argument if(!$var_name_arr) $var_name_arr=$$var_name; $grp_arr=Array(); - if(sizeof($var_name_arr['GROUP']) > 0) + if(php7_sizeof($var_name_arr['GROUP']) > 0) { foreach($var_name_arr['GROUP'] as $grpid=>$grpusers) diff --git a/modules/Vtiger/CRMEntity.php b/modules/Vtiger/CRMEntity.php index f6e02223f8f2b5b3c7b803489221bda1e2e5f3ce..546268c9b9ae8d90db9c0dc6dea6693d6c0197da 100644 --- a/modules/Vtiger/CRMEntity.php +++ b/modules/Vtiger/CRMEntity.php @@ -117,7 +117,7 @@ class Vtiger_CRMEntity extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_crmentity.smownerid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_crmentity.smownerid IN diff --git a/pkg/vtiger/extensions/Webservices/VTQL_parser.y b/pkg/vtiger/extensions/Webservices/VTQL_parser.y index 852af34b20f2bb12bf04c30de550a40b8c97c134..367dafc404f11c76ccc870cf42deca02c9dee6e7 100644 --- a/pkg/vtiger/extensions/Webservices/VTQL_parser.y +++ b/pkg/vtiger/extensions/Webservices/VTQL_parser.y @@ -58,7 +58,7 @@ expr ::= COLUMNNAME(ECNAME) logical_term valuelist.{ $this->out['columnDone']=true; $this->out['where_condition']['column_names'][] = ECNAME; if(strcmp(ECNAME, 'id')===0){ -$prev = $this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1]; +$prev = $this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1]; if(is_array($prev)){ $new = array(); foreach($prev as $ind=>$val){ @@ -66,21 +66,21 @@ $val = trim($val,'\'"'); $value = vtws_getIdComponents($val); $new[] = $value[1]; } -$this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1] = $new; +$this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1] = $new; }else{ $prev = trim($prev,'\'"'); $value = vtws_getIdComponents($prev); -if(strcasecmp($this->out['where_condition']['column_operators'][sizeof($this->out['where_condition']['column_operators'])-1],'like')===0){ +if(strcasecmp($this->out['where_condition']['column_operators'][php7_sizeof($this->out['where_condition']['column_operators'])-1],'like')===0){ $value[1] = "'".$value[1]."'"; } -$this->out['where_condition']['column_values'][sizeof($this->out['where_condition']['column_values'])-1] = $value[1]; +$this->out['where_condition']['column_values'][php7_sizeof($this->out['where_condition']['column_values'])-1] = $value[1]; } } } valuelist ::= PARENOPEN valueref PARENCLOSE. valuelist ::= valueref. valueref ::= value_exp VALUE(VAL).{ -$length = sizeof($this->out['where_condition']['column_values']); +$length = php7_sizeof($this->out['where_condition']['column_values']); $pos = $length - 1; if($pos < 0){ $pos = 0; @@ -299,14 +299,14 @@ function buildSelectStmt($sqlDump){ $accessControlQuery = $meta->getEntityAccessControlQuery(); $this->query = $this->query.' '.$accessControlQuery; if($sqlDump['where_condition']){ - if((sizeof($sqlDump['where_condition']['column_names']) == - sizeof($sqlDump['where_condition']['column_values'])) && - (sizeof($sqlDump['where_condition']['column_operators']) == sizeof($sqlDump['where_condition']['operators'])+1)){ + if((php7_sizeof($sqlDump['where_condition']['column_names']) == + php7_sizeof($sqlDump['where_condition']['column_values'])) && + (php7_sizeof($sqlDump['where_condition']['column_operators']) == php7_sizeof($sqlDump['where_condition']['operators'])+1)){ $this->query = $this->query.' WHERE ('; $i=0; $referenceFields = $meta->getReferenceFieldDetails(); $ownerFields = $meta->getOwnerFields(); - for(;$i<sizeof($sqlDump['where_condition']['column_values']);++$i){ + for(;$i<php7_sizeof($sqlDump['where_condition']['column_values']);++$i){ if(!$fieldcol[$sqlDump['where_condition']['column_names'][$i]]){ throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to access ".$sqlDump['where_condition']['column_names'][$i]." attribute denied."); } @@ -347,7 +347,7 @@ function buildSelectStmt($sqlDump){ } $this->query = $this->query.$columnTable[$fieldcol[$whereField]].'.'. $fieldcol[$whereField]." ".$whereOperator." ".$whereValue; - if($i <sizeof($sqlDump['where_condition']['column_values'])-1){ + if($i <php7_sizeof($sqlDump['where_condition']['column_values'])-1){ $this->query = $this->query.' '; $this->query = $this->query.$sqlDump['where_condition']['operators'][$i].' '; } @@ -392,7 +392,7 @@ function buildSelectStmt($sqlDump){ if($sqlDump['limit']){ $i=0; $offset =false; - if(sizeof($sqlDump['limit'])>1){ + if(php7_sizeof($sqlDump['limit'])>1){ $offset = true; } $this->query = $this->query.' LIMIT '; diff --git a/pkg/vtiger/modules/Assets/modules/Assets/Assets.php b/pkg/vtiger/modules/Assets/modules/Assets/Assets.php index 817ed14412f8fd645c51cf96e83d9422550ae0ca..0c012a9800a2ee01c0e4468c684ce1beac939ecc 100644 --- a/pkg/vtiger/modules/Assets/modules/Assets/Assets.php +++ b/pkg/vtiger/modules/Assets/modules/Assets/Assets.php @@ -192,7 +192,7 @@ class Assets extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRecentRecords.php b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRecentRecords.php index dbceef6076b5143ece48103786e53ef18d90352d..bc3e7b824044cbee28b9b725a39f92ee8fd43f6a 100644 --- a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRecentRecords.php +++ b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRecentRecords.php @@ -73,7 +73,7 @@ class CustomerPortal_FetchRecentRecords extends CustomerPortal_API_Abstract { } else { $queryResult = vtws_query_related($sql, $parentId, CustomerPortal_Utils::getRelatedModuleLabel($module), $current_user, $filterClause); } - $num_rows = sizeof($queryResult); + $num_rows = php7_sizeof($queryResult); $records = array(); $recordIds = array(); diff --git a/pkg/vtiger/modules/Import/modules/Import/actions/Data.php b/pkg/vtiger/modules/Import/modules/Import/actions/Data.php index d61641bcf0175b26fee6c4496fe8fee40e1451a5..3020bbc1e7c034e3126ebadd3150c365fcea2dc5 100644 --- a/pkg/vtiger/modules/Import/modules/Import/actions/Data.php +++ b/pkg/vtiger/modules/Import/modules/Import/actions/Data.php @@ -633,7 +633,7 @@ class Import_Data_Action extends Vtiger_Action_Controller { $picklistValueInLowerCase = strtolower($fieldValue); $allPicklistValuesInLowerCase = array_map('strtolower', $allPicklistValues); - if (sizeof($allPicklistValuesInLowerCase) > 0 && sizeof($allPicklistValues) > 0) { + if (php7_sizeof($allPicklistValuesInLowerCase) > 0 && php7_sizeof($allPicklistValues) > 0) { $picklistDetails = array_combine($allPicklistValuesInLowerCase, $allPicklistValues); } @@ -1078,7 +1078,7 @@ class Import_Data_Action extends Vtiger_Action_Controller { $fieldValueInLowerCase = strtolower($fieldValue); $picklistValuesInLowerCase = array_map('strtolower', $picklistValues); - if (sizeof($picklistValuesInLowerCase)&& sizeof($picklistValues)) { + if (php7_sizeof($picklistValuesInLowerCase)&& php7_sizeof($picklistValues)) { $picklistDetails = array_combine($picklistValuesInLowerCase, $picklistValues); } diff --git a/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Utils.php b/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Utils.php index 1a2cdcc45d774caa97ec083ee5fc9b20d0ce54fb..2a190619ec06b838e55313673b85d383e9cf99e3 100644 --- a/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Utils.php +++ b/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Utils.php @@ -312,7 +312,7 @@ class Mobile_WS_Utils { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $querySuffix .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $querySuffix .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php b/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php index 2bc9a16c44fbc6ce04d28b3f331fcd270235d840..0140d60e00e9efbd0e18adb2fffc002e45d4c5d1 100644 --- a/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php +++ b/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php @@ -224,7 +224,7 @@ class ModCommentsCore extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php b/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php index 8438409e6b46de943066279500eb769ebfd63a74..cc9b421278824dae39a9b66cd7079c15d5a99614 100644 --- a/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php +++ b/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php @@ -204,7 +204,7 @@ class Project extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/Projects/ProjectMilestone/modules/ProjectMilestone/ProjectMilestone.php b/pkg/vtiger/modules/Projects/ProjectMilestone/modules/ProjectMilestone/ProjectMilestone.php index 706bbefab0803ef98f5bb5dd0f0efcf8d1d7c726..f1300f9dac3dc8d809596cf483e3b5457998393e 100644 --- a/pkg/vtiger/modules/Projects/ProjectMilestone/modules/ProjectMilestone/ProjectMilestone.php +++ b/pkg/vtiger/modules/Projects/ProjectMilestone/modules/ProjectMilestone/ProjectMilestone.php @@ -200,7 +200,7 @@ class ProjectMilestone extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php index c48c3e82dc5fb65d0497162200663e00349a00c2..ea6f5d07784ef0fb6899ba4e01cea13691bd3bf7 100644 --- a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php +++ b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php @@ -207,7 +207,7 @@ class ProjectTask extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/SMSNotifierBase.php b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/SMSNotifierBase.php index adfbe91185d8aebdc08c25d5dcd74ddd05751bbe..ff1aa51e60d72da52ef3d7475e3a2f01adb9727e 100644 --- a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/SMSNotifierBase.php +++ b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/SMSNotifierBase.php @@ -207,7 +207,7 @@ class SMSNotifierBase extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php b/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php index 9185eb5c2776897b329346b87205fc98098501a3..96822dcb420115bd46d5826a19c15a384cfd7c99 100644 --- a/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php +++ b/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php @@ -204,7 +204,7 @@ class ServiceContracts extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN diff --git a/pkg/vtiger/modules/Services/modules/Services/Services.php b/pkg/vtiger/modules/Services/modules/Services/Services.php index ff8e98917efb32e54c3225aaa93e6a5da0594040..7d69f5a982672f2dc827e7802e58dcdbf5c379b3 100644 --- a/pkg/vtiger/modules/Services/modules/Services/Services.php +++ b/pkg/vtiger/modules/Services/modules/Services/Services.php @@ -332,7 +332,7 @@ class Services extends CRMEntity { ("; // Build the query based on the group association of current user. - if(sizeof($current_user_groups) > 0) { + if(php7_sizeof($current_user_groups) > 0) { $sec_query .= " vtiger_groups.groupid IN (". implode(",", $current_user_groups) .") OR "; } $sec_query .= " vtiger_groups.groupid IN