本文整理汇总了PHP中VTCacheUtils::clearRoleSubordinates方法的典型用法代码示例。如果您正苦于以下问题:PHP VTCacheUtils::clearRoleSubordinates方法的具体用法?PHP VTCacheUtils::clearRoleSubordinates怎么用?PHP VTCacheUtils::clearRoleSubordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::clearRoleSubordinates方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateRole
/** Function to update the vtiger_role
* @param $roleName -- Role Name:: Type varchar
* @param $roleId -- Role Id:: Type varchar
* @param $roleProfileArray -- Profile to be associated with this vtiger_role:: Type Array
*
*/
function updateRole($roleId, $roleName, $roleProfileArray)
{
global $log;
$log->debug("Entering updateRole(" . $roleId . "," . $roleName . "," . $roleProfileArray . ") method ...");
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates($roleId);
global $adb;
$sql1 = "update vtiger_role set rolename=? where roleid=?";
$adb->pquery($sql1, array($roleName, $roleId));
//Updating the Role2Profile relation
$sql2 = "delete from vtiger_role2profile where roleId=?";
$adb->pquery($sql2, array($roleId));
foreach ($roleProfileArray as $profileId) {
if ($profileId != '') {
insertRole2ProfileRelation($roleId, $profileId);
}
}
$log->debug("Exiting updateRole method ...");
}
示例2: create_default_users_access
//.........这里部分代码省略.........
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",18,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",7,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",6,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",4,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",2,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",13,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",14,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile3_id . ",18,10,0)");
//Inserting into vtiger_profile2utility Guest Profile Read-Only
//Import Export BusinessCar Not Allowed.
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",2,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",2,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",4,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",4,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",6,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",6,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",7,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",7,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",8,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",7,8,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",6,8,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",4,8,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",13,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",13,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",13,8,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",14,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",14,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",7,9,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",18,5,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",18,6,1)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",7,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",6,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",4,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",2,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",13,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",14,10,0)");
$adb->query("insert into vtiger_profile2utility values (" . $profile4_id . ",18,10,0)");
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates();
// create default admin user
$user = new Users();
$user->column_fields["last_name"] = 'Administrator';
$user->column_fields["user_name"] = 'admin';
$user->column_fields["status"] = 'Active';
$user->column_fields["is_admin"] = 'on';
$user->column_fields["user_password"] = $admin_password;
$user->column_fields["tz"] = 'Europe/Berlin';
$user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
$user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
$user->column_fields["weekstart"] = '1';
$user->column_fields["namedays"] = '';
$user->column_fields["currency_id"] = 1;
$user->column_fields["reminder_interval"] = '1 Minute';
$user->column_fields["reminder_next_time"] = date('Y-m-d H:i');
$user->column_fields["date_format"] = 'yyyy-mm-dd';
$user->column_fields["hour_format"] = 'am/pm';
$user->column_fields["start_hour"] = '08:00';
$user->column_fields["end_hour"] = '23:00';
$user->column_fields["imagename"] = '';
$user->column_fields["internal_mailer"] = '1';
$user->column_fields["activity_view"] = 'This Week';
$user->column_fields["lead_view"] = 'Today';
//added by philip for default admin emailid
if ($admin_email == '') {
$admin_email = "admin@vtigeruser.com";
}
$user->column_fields["email1"] = $admin_email;
$role_query = "select roleid from vtiger_role where rolename='CEO'";
$adb->checkConnection();
$adb->database->SetFetchMode(ADODB_FETCH_ASSOC);
$role_result = $adb->query($role_query);
$role_id = $adb->query_result($role_result, 0, "roleid");
$user->column_fields["roleid"] = $role_id;
$user->save("Users");
$admin_user_id = $user->id;
//Inserting into vtiger_groups table
$group1_id = $adb->getUniqueID("vtiger_users");
$group2_id = $adb->getUniqueID("vtiger_users");
$group3_id = $adb->getUniqueID("vtiger_users");
$adb->query("insert into vtiger_groups values ('" . $group1_id . "','Team Selling','Group Related to Sales')");
$adb->query("insert into vtiger_group2role values ('" . $group1_id . "','H" . $role4_id . "')");
$adb->query("insert into vtiger_group2rs values ('" . $group1_id . "','H" . $role5_id . "')");
$adb->query("insert into vtiger_groups values ('" . $group2_id . "','Marketing Group','Group Related to Marketing Activities')");
$adb->query("insert into vtiger_group2role values ('" . $group2_id . "','H" . $role2_id . "')");
$adb->query("insert into vtiger_group2rs values ('" . $group2_id . "','H" . $role3_id . "')");
$adb->query("insert into vtiger_groups values ('" . $group3_id . "','Support Group','Group Related to providing Support to Customers')");
$adb->query("insert into vtiger_group2role values ('" . $group3_id . "','H" . $role3_id . "')");
$adb->query("insert into vtiger_group2rs values ('" . $group3_id . "','H" . $role3_id . "')");
// Setting user group relation for admin user
$adb->pquery("insert into vtiger_users2group values (?,?)", array($group2_id, $admin_user_id));
//Creating the flat files for admin user
createUserPrivilegesfile($admin_user_id);
createUserSharingPrivilegesfile($admin_user_id);
//Insert into vtiger_profile2field
insertProfile2field($profile1_id);
insertProfile2field($profile2_id);
insertProfile2field($profile3_id);
insertProfile2field($profile4_id);
insert_def_org_field();
}
示例3: explode
$parentRoleList = $adb->query_result($result, 0, 'parentrole');
$replace_with = $parentRoleList;
$orgDepth = $adb->query_result($result, 0, 'depth');
//echo 'replace with is '.$replace_with;
//echo '<BR>org depth '.$orgDepth;
$parentRoles = explode('::', $parentRoleList);
if (in_array($fromid, $parentRoles)) {
echo $mod_strings['ROLE_DRAG_ERR_MSG'];
die;
}
$roleInfo = getRoleAndSubordinatesInformation($fromid);
$fromRoleInfo = $roleInfo[$fromid];
$replaceToStringArr = explode('::' . $fromid, $fromRoleInfo[1]);
$replaceToString = $replaceToStringArr[0];
//echo '<BR>to be replaced string '.$replaceToString;
$stdDepth = $fromRoleInfo['2'];
//echo '<BR> std depth '.$stdDepth;
//Constructing the query
foreach ($roleInfo as $mvRoleId => $mvRoleInfo) {
$subPar = explode($replaceToString, $mvRoleInfo[1], 2);
//we have to spilit as two elements only
$mvParString = $replace_with . $subPar[1];
$subDepth = $mvRoleInfo[2];
$mvDepth = $orgDepth + ($subDepth - $stdDepth + 1);
$query = "update vtiger_role set parentrole=?,depth=? where roleid=?";
//echo $query;
$adb->pquery($query, array($mvParString, $mvDepth, $mvRoleId));
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates($roleId);
}
header("Location: index.php?action=SettingsAjax&module=Settings&file=listroles&ajax=true");
示例4: delete
public function delete($role)
{
$db = PearDatabase::getInstance();
$db->dieOnError = true;
$sql = "update vtiger_user2role set roleid=? where roleid=?";
$db->pquery($sql, array($role->getId(), $this->getId()));
//Deleteing from vtiger_role2profile vtiger_table
$sql = "delete from vtiger_role2profile where roleid=?";
$db->pquery($sql, array($this->getId()));
//delete handling for vtiger_groups
$sql = "delete from vtiger_group2role where roleid=?";
$db->pquery($sql, array($this->getId()));
$sql = "delete from vtiger_group2rs where roleandsubid=?";
$db->pquery($sql, array($this->getId()));
//delete handling for sharing rules
deleteRoleRelatedSharingRules($this->getId());
//delete from vtiger_role vtiger_table;
$sql = "delete from vtiger_role where roleid=?";
$db->pquery($sql, array($this->getId()));
$targetParentRoleSequence = $role->getParentRole();
$parentRoleSequence = $this->getParentRole();
$roleInfoList = getRoleAndSubordinatesInformation($roleId);
foreach ($roleInfoList as $roleId => $roleInfo) {
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates($roleId);
if ($roleId == $this->getId()) {
continue;
}
$currentParentRoleSequence = $roleInfo[1];
$currentParentRoleSequence = str_replace($parentRoleSequence, $targetParentRoleSequence, $currentParentRoleSequence);
$subDepth = count(explode('::', $currentParentRoleSequence)) - 1;
$query = "update vtiger_role set parentrole=?,depth=? where roleid=?";
$db->pquery($query, array($currentParentRoleSequence, $subDepth, $roleId));
}
}
示例5: createDefaultUsersAccess
//.........这里部分代码省略.........
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId3 . ",13,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId3 . ",14,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId3 . ",18,10,0)", array());
//Inserting into vtiger_profile2utility Guest Profile Read-Only
//Import Export BusinessCar Not Allowed.
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",8,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,9,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,10,0)", array());
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates();
$adminPassword = $_SESSION['config_file_info']['password'];
$userDateFormat = $_SESSION['config_file_info']['dateformat'];
$userTimeZone = $_SESSION['config_file_info']['timezone'];
//Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7974
$userFirstName = $_SESSION['config_file_info']['firstname'];
$userLastName = $_SESSION['config_file_info']['lastname'];
// create default admin user
$user = CRMEntity::getInstance('Users');
//Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7974
$user->column_fields["first_name"] = $userFirstName;
$user->column_fields["last_name"] = $userLastName;
//Ends
$user->column_fields["user_name"] = 'admin';
$user->column_fields["status"] = 'Active';
$user->column_fields["is_admin"] = 'on';
$user->column_fields["user_password"] = $adminPassword;
$user->column_fields["time_zone"] = $userTimeZone;
$user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
$user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
$user->column_fields["weekstart"] = '1';
$user->column_fields["namedays"] = '';
$user->column_fields["currency_id"] = 1;
$user->column_fields["reminder_interval"] = '1 Minute';
$user->column_fields["reminder_next_time"] = date('Y-m-d H:i');
$user->column_fields["date_format"] = $userDateFormat;
$user->column_fields["hour_format"] = 'am/pm';
$user->column_fields["start_hour"] = '08:00';
$user->column_fields["end_hour"] = '23:00';
$user->column_fields["imagename"] = '';
$user->column_fields["internal_mailer"] = '1';
$user->column_fields["activity_view"] = 'This Week';
$user->column_fields["lead_view"] = 'Today';
示例6: createDefaultUsersAccess
//.........这里部分代码省略.........
//Inserting into vtiger_profile2utility Guest Profile Read-Only
//Import Export BusinessCar Not Allowed.
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,6,1)", array());
// SalesPlatform.ru begin Added Potentials merge perms
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId1 . ",2,8,0)", array());
// SalesPlatform.ru end
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",8,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,8,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,9,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,5,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,6,1)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",7,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",6,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",4,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",2,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",13,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",14,10,0)", array());
$adb->pquery("INSERT INTO vtiger_profile2utility VALUES (" . $profileId4 . ",18,10,0)", array());
// Invalidate any cached information
VTCacheUtils::clearRoleSubordinates();
$adminPassword = $_SESSION['config_file_info']['password'];
$userDateFormat = $_SESSION['config_file_info']['dateformat'];
$userTimeZone = $_SESSION['config_file_info']['timezone'];
//Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7974
$userFirstName = $_SESSION['config_file_info']['firstname'];
$userLastName = $_SESSION['config_file_info']['lastname'];
// create default admin user
$user = CRMEntity::getInstance('Users');
// SalesPlatform.ru begin
$user->column_fields["last_name"] = 'Администратор';
//$user->column_fields["last_name"] = 'Administrator';
// SalesPlatform.ru end
$user->column_fields["user_name"] = 'admin';
$user->column_fields["status"] = 'Active';
$user->column_fields["is_admin"] = 'on';
$user->column_fields["user_password"] = $adminPassword;
$user->column_fields["time_zone"] = $userTimeZone;
// SalesPlatform.ru begin
$user->column_fields["holidays"] = 'ru,';
$user->column_fields["workdays"] = '1,2,3,4,5,6,0,';
//$user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
//$user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
// SalesPlatform.ru end
$user->column_fields["weekstart"] = '1';
$user->column_fields["namedays"] = '';
$user->column_fields["currency_id"] = 1;
$user->column_fields["reminder_interval"] = '1 Minute';
$user->column_fields["reminder_next_time"] = date('Y-m-d H:i');
$user->column_fields["date_format"] = $userDateFormat;
// SalesPlatform.ru begin
$user->column_fields["hour_format"] = '24';
//$user->column_fields["hour_format"] = 'am/pm';