本文整理汇总了PHP中Settings_Roles_Record_Model类的典型用法代码示例。如果您正苦于以下问题:PHP Settings_Roles_Record_Model类的具体用法?PHP Settings_Roles_Record_Model怎么用?PHP Settings_Roles_Record_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Settings_Roles_Record_Model类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$record = $request->get('record');
$parentRoleId = $request->get('parent_roleid');
$roleDirectlyRelated = false;
if (!empty($record)) {
$recordModel = Settings_Roles_Record_Model::getInstanceById($record);
$viewer->assign('MODE', 'edit');
} else {
$recordModel = new Settings_Roles_Record_Model();
$recordModel->setParent(Settings_Roles_Record_Model::getInstanceById($parentRoleId));
$viewer->assign('MODE', '');
$roleDirectlyRelated = true;
}
$profileId = $recordModel->getDirectlyRelatedProfileId();
if ($profileId) {
$viewer->assign('PROFILE_ID', $profileId);
$roleDirectlyRelated = true;
}
$viewer->assign('PROFILE_DIRECTLY_RELATED_TO_ROLE', $roleDirectlyRelated);
$viewer->assign('ALL_PROFILES', Settings_Profiles_Record_Model::getAll());
$viewer->assign('ROLE_USERS', $recordModel->getUsers());
$viewer->assign('RECORD_MODEL', $recordModel);
$viewer->assign('RECORD_ID', $record);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->view('EditView.tpl', $qualifiedModuleName);
}
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:31,代码来源:Edit.php
示例2: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->get('record');
$roleName = $request->get('rolename');
$allowassignedrecordsto = $request->get('allowassignedrecordsto');
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
if (!empty($recordId)) {
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
} else {
$recordModel = new Settings_Roles_Record_Model();
}
if ($request->get('profile_directly_related_to_role') == '1') {
$profileId = $request->get('profile_directly_related_to_role_id');
$profileName = $request->get('profilename');
if (empty($profileName)) {
$profileName = $roleName . '+' . vtranslate('LBL_PROFILE', $qualifiedModuleName);
}
if ($profileId) {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceById($profileId);
} else {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceByName($profileName, true);
if (empty($profileRecordModel)) {
$profileRecordModel = new Settings_Profiles_Record_Model();
}
}
$profileRecordModel->set('directly_related_to_role', '1');
$profileRecordModel->set('profilename', $profileName)->set('profile_permissions', $request->get('permissions'));
$profileRecordModel->set('viewall', $request->get('viewall'));
$profileRecordModel->set('editall', $request->get('editall'));
$savedProfileId = $profileRecordModel->save();
$roleProfiles = array($savedProfileId);
} else {
$roleProfiles = $request->get('profiles');
}
$parentRoleId = $request->get('parent_roleid');
if ($recordModel && !empty($parentRoleId)) {
$parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId);
if (!empty($allowassignedrecordsto)) {
$recordModel->set('allowassignedrecordsto', $allowassignedrecordsto);
}
// set the value of assigned records to
if ($parentRole && !empty($roleName) && !empty($roleProfiles)) {
$recordModel->set('rolename', $roleName);
$recordModel->set('profileIds', $roleProfiles);
$parentRole->addChildRole($recordModel);
}
//After role updation recreating user privilege files
if ($roleProfiles) {
foreach ($roleProfiles as $profileId) {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceById($profileId);
$profileRecordModel->recalculate(array($recordId));
}
}
}
$redirectUrl = $moduleModel->getDefaultUrl();
header("Location: {$redirectUrl}");
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:59,代码来源:Save.php
示例3: getDisplayValue
/**
* Function to get display value
* @param <String> $value
* @param <Number> $recordId
* @return <String> display value
*/
public function getDisplayValue($value, $recordId)
{
$displayValue = $this->getEditViewDisplayValue($value);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
if ($currentUserModel->isAdminUser()) {
$roleRecordModel = new Settings_Roles_Record_Model();
$roleRecordModel->set('roleid', $value);
return '<a href="' . $roleRecordModel->getEditViewUrl() . '">' . textlength_check($displayValue) . '</a>';
}
return $displayValue;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:17,代码来源:UserRole.php
示例4: process
function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$sourceRecord = $request->get('src_record');
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$sourceRole = Settings_Roles_Record_Model::getInstanceById($sourceRecord);
$rootRole = Settings_Roles_Record_Model::getBaseRole();
$allRoles = Settings_Roles_Record_Model::getAll();
$viewer->assign('SOURCE_ROLE', $sourceRole);
$viewer->assign('ROOT_ROLE', $rootRole);
$viewer->assign('ROLES', $allRoles);
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('TYPE', $request->get('type'));
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('COMPANY_LOGO', $companyLogo);
$viewer->view('Popup.tpl', $qualifiedModuleName);
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:25,代码来源:Popup.php
示例5: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$qualifiedModuleName = $request->getModule(false);
$rootRole = Settings_Roles_Record_Model::getBaseRole();
$allRoles = Settings_Roles_Record_Model::getAll();
$viewer->assign('ROOT_ROLE', $rootRole);
$viewer->assign('ROLES', $allRoles);
$viewer->view('Index.tpl', $qualifiedModuleName);
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:10,代码来源:Index.php
示例6: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->get('record');
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('RECORD_MODEL', $recordModel);
echo $viewer->view('DeleteTransferForm.tpl', $qualifiedModuleName, true);
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:12,代码来源:DeleteAjax.php
示例7: checkDuplicate
public function checkDuplicate(Vtiger_Request $request)
{
$roleName = $request->get('rolename');
$recordId = $request->get('record');
$recordModel = Settings_Roles_Record_Model::getInstanceByName($roleName, array($recordId));
$response = new Vtiger_Response();
if (!empty($recordModel)) {
$response->setResult(array('success' => true, 'message' => vtranslate('LBL_DUPLICATES_EXIST', $request->getModule(false))));
} else {
$response->setResult(array('success' => false));
}
$response->emit();
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:13,代码来源:EditAjax.php
示例8: generateMenuAfterModuleDelete
/**
* A function to generating menu files after deleting the module
*/
static function generateMenuAfterModuleDelete()
{
self::log(__CLASS__ . '::' . __METHOD__ . ' | Start');
$menuRecordModel = new Settings_Menu_Record_Model();
$allRoles = Settings_Roles_Record_Model::getAll();
$menuRecordModel->generateFileMenu(0);
foreach ($allRoles as $role) {
$roleId = str_replace('H', '', $role->getId());
if (file_exists('user_privileges/menu_' . $roleId . '.php')) {
$menuRecordModel->generateFileMenu($roleId);
}
}
self::log(__CLASS__ . '::' . __METHOD__ . ' | End');
}
开发者ID:noclav,项目名称:UpdatePackages,代码行数:17,代码来源:Menu.php
示例9: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->get('record');
$transferRecordId = $request->get('transfer_record');
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
$transferToRole = Settings_Roles_Record_Model::getInstanceById($transferRecordId);
if ($recordModel && $transferToRole) {
$recordModel->delete($transferToRole);
}
$redirectUrl = $moduleModel->getDefaultUrl();
header("Location: {$redirectUrl}");
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:15,代码来源:Delete.php
示例10: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$recordId = $request->get('record');
$parentRoleId = $request->get('parent_roleid');
$parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId);
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
try {
$recordModel->moveTo($parentRole);
} catch (AppException $e) {
$response->setError('Move Role Failed');
}
$response->emit();
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:16,代码来源:MoveAjax.php
示例11: process
public function process(Vtiger_Request $request)
{
$log = vglobal('log');
$log->debug("Entering Settings_WidgetsManagement_Configuration_View::process() method ...");
$currentUser = Users_Record_Model::getCurrentUserModel();
$sourceModule = $request->get('sourceModule');
$dashboardModules = Settings_WidgetsManagement_Module_Model::getSelectableDashboard();
if (empty($sourceModule)) {
$sourceModule = 'Home';
}
$moduleName = $request->getModule();
$viewer = $this->getViewer($request);
// get widgets list
$widgets = $dashboardModules[$sourceModule];
$dashboardStored = Settings_WidgetsManagement_Module_Model::getDashboardForModule($sourceModule);
$defaultValues = Settings_WidgetsManagement_Module_Model::getDefaultValues();
$size = Settings_WidgetsManagement_Module_Model::getSize();
$widgetsWithLimit = Settings_WidgetsManagement_Module_Model::getWidgetsWithLimit();
$authorization = Settings_Roles_Record_Model::getAll();
$bloks = Settings_WidgetsManagement_Module_Model::getBlocksId();
$specialWidgets = Settings_WidgetsManagement_Module_Model::getSpecialWidgets($sourceModule);
$filterSelect = Settings_WidgetsManagement_Module_Model::getFilterSelect();
$filterSelectDefault = Settings_WidgetsManagement_Module_Model::getFilterSelectDefault();
$widgetsWithFilterUsers = Settings_WidgetsManagement_Module_Model::getWidgetsWithFilterUsers();
$restrictFilter = Settings_WidgetsManagement_Module_Model::getRestrictFilter();
$viewer->assign('FILTER_SELECT', $filterSelect);
$viewer->assign('FILTER_SELECT_DEFAULT', $filterSelectDefault);
$viewer->assign('WIDGETS_WITH_FILTER_USERS', $widgetsWithFilterUsers);
$viewer->assign('ALL_AUTHORIZATION', $authorization);
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
$viewer->assign('SUPPORTED_MODULES', array_keys($dashboardModules));
$viewer->assign('DASHBOARD_AUTHORIZATION_BLOCKS', $bloks[$sourceModule]);
$viewer->assign('WIDGETS_AUTHORIZATION_INFO', $dashboardStored);
$viewer->assign('SPECIAL_WIDGETS', $specialWidgets);
$viewer->assign('CURRENTUSER', $currentUser);
$viewer->assign('WIDGETS', $widgets);
$viewer->assign('SIZE', $size);
$viewer->assign('DEFAULTVALUES', $defaultValues);
$viewer->assign('TITLE_OF_LIMIT', $widgetsWithLimit);
$viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
$viewer->assign('RESTRICT_FILTER', $restrictFilter);
echo $viewer->view('Configuration.tpl', $request->getModule(false), true);
$log->debug("Exiting Settings_WidgetsManagement_Configuration_View::process() method ...");
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:44,代码来源:Configuration.php
示例12: getGroupsList
function getGroupsList(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$currentUser = Users_Record_Model::getCurrentUserModel();
$roleInstance = Settings_Roles_Record_Model::getInstanceById($currentUser->get('roleid'));
$clendarallorecords = $roleInstance->get('clendarallorecords');
switch ($clendarallorecords) {
case 1:
$groups = [];
break;
case 2:
case 3:
default:
$groups = $currentUser->getAccessibleGroups();
break;
}
$viewer->assign('MODULE', $moduleName);
$viewer->assign('ALL_ACTIVEGROUP_LIST', $groups);
$viewer->view('RightPanel.tpl', $moduleName);
}
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:21,代码来源:RightPanel.php
示例13: process
public function process(Vtiger_Request $request)
{
$sourceModule = $request->get('source_module');
$pickListSupportedModules = Settings_Picklist_Module_Model::getPicklistSupportedModules();
if (empty($sourceModule)) {
//take the first module as the source module
$sourceModule = $pickListSupportedModules[0]->name;
}
$moduleModel = Settings_Picklist_Module_Model::getInstance($sourceModule);
$viewer = $this->getViewer($request);
$qualifiedName = $request->getModule(FALSE);
$viewer->assign('PICKLIST_MODULES', $pickListSupportedModules);
//TODO: see if you needs to optimize this , since its will gets all the fields and filter picklist fields
$pickListFields = $moduleModel->getFieldsByType(array('picklist', 'multipicklist'));
if (count($pickListFields) > 0) {
$selectedPickListFieldModel = reset($pickListFields);
$selectedFieldAllPickListValues = Vtiger_Util_Helper::getPickListValues($selectedPickListFieldModel->getName());
$viewer->assign('PICKLIST_FIELDS', $pickListFields);
$viewer->assign('SELECTED_PICKLIST_FIELDMODEL', $selectedPickListFieldModel);
$viewer->assign('SELECTED_PICKLISTFIELD_ALL_VALUES', $selectedFieldAllPickListValues);
$viewer->assign('ROLES_LIST', Settings_Roles_Record_Model::getAll());
} else {
$viewer->assign('NO_PICKLIST_FIELDS', true);
$createPicklistUrl = '';
$settingsLinks = $moduleModel->getSettingLinks();
foreach ($settingsLinks as $linkDetails) {
if ($linkDetails['linklabel'] == 'LBL_EDIT_FIELDS') {
$createPicklistUrl = $linkDetails['linkurl'];
break;
}
}
$viewer->assign('CREATE_PICKLIST_URL', $createPicklistUrl);
}
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
$viewer->assign('QUALIFIED_NAME', $qualifiedName);
$viewer->view('Index.tpl', $qualifiedName);
}
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:37,代码来源:Index.php
示例14: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->get('record');
$roleName = $request->get('rolename');
$allowassignedrecordsto = $request->get('allowassignedrecordsto');
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
if (!empty($recordId)) {
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
} else {
$recordModel = new Settings_Roles_Record_Model();
}
$roleProfiles = $request->get('profiles');
$parentRoleId = $request->get('parent_roleid');
if ($recordModel && !empty($parentRoleId)) {
$parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId);
$recordModel->set('change_owner', $request->get('change_owner'))->set('searchunpriv', $request->get('searchunpriv'))->set('listrelatedrecord', $request->get('listRelatedRecord'))->set('previewrelatedrecord', $request->get('previewRelatedRecord'))->set('editrelatedrecord', $request->get('editRelatedRecord'))->set('permissionsrelatedfield', $request->get('permissionsRelatedField'))->set('globalsearchadv', $request->get('globalSearchAdvanced'))->set('clendarallorecords', $request->get('clendarallorecords'));
if (!empty($allowassignedrecordsto)) {
$recordModel->set('allowassignedrecordsto', $allowassignedrecordsto);
}
// set the value of assigned records to
if ($parentRole && !empty($roleName) && !empty($roleProfiles)) {
$recordModel->set('rolename', $roleName);
$recordModel->set('profileIds', $roleProfiles);
$parentRole->addChildRole($recordModel);
}
//After role updation recreating user privilege files
if ($roleProfiles) {
foreach ($roleProfiles as $profileId) {
$profileRecordModel = Settings_Profiles_Record_Model::getInstanceById($profileId);
$profileRecordModel->recalculate(array($recordId));
}
}
}
$redirectUrl = $moduleModel->getDefaultUrl();
header("Location: {$redirectUrl}");
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:38,代码来源:Save.php
示例15: getAllRoles
/**
* Function returns all the User Roles
* @return
*/
public function getAllRoles()
{
$roleModels = Settings_Roles_Record_Model::getAll();
$roles = array();
foreach ($roleModels as $roleId => $roleModel) {
$roleName = $roleModel->getName();
$roles[$roleName] = $roleId;
}
return $roles;
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:14,代码来源:Field.php
示例16: showAssignValueToRoleView
/**
* Function which will assign existing values to the roles
* @param Vtiger_Request $request
*/
public function showAssignValueToRoleView(Vtiger_Request $request)
{
$sourceModule = $request->get('source_module');
$pickFieldId = $request->get('pickListFieldId');
$fieldModel = Settings_Picklist_Field_Model::getInstance($pickFieldId);
$moduleName = $request->getModule();
$qualifiedName = $request->getModule(false);
$selectedFieldAllPickListValues = Vtiger_Util_Helper::getPickListValues($fieldModel->getName());
$selectedFieldAllPickListValues = array_map('Vtiger_Util_Helper::toSafeHTML', $selectedFieldAllPickListValues);
$viewer = $this->getViewer($request);
$viewer->assign('SELECTED_PICKLIST_FIELDMODEL', $fieldModel);
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('QUALIFIED_MODULE', $qualifiedName);
$viewer->assign('ROLES_LIST', Settings_Roles_Record_Model::getAll());
$viewer->assign('SELECTED_PICKLISTFIELD_ALL_VALUES', $selectedFieldAllPickListValues);
$viewer->view('AssignValueToRole.tpl', $qualifiedName);
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:22,代码来源:IndexAjax.php
示例17: picklists
public function picklists()
{
global $log, $adb;
$log->debug("Entering VT620_to_YT::picklists() method ...");
$addPicklists = array();
$addPicklists['Assets'][] = array('name' => 'assetstatus', 'uitype' => '15', 'add_values' => array('PLL_DRAFT', 'PLL_WARRANTY_SUPPORT', 'PLL_POST_WARRANTY_SUPPORT', 'PLL_NO_SUPPORT'), 'remove_values' => array('Out-of-service', 'In Service'));
$addPicklists['HelpDesk'][] = array('name' => 'ticketstatus', 'uitype' => '15', 'add_values' => array('Answered', 'Rejected'), 'remove_values' => array());
$addPicklists['Users'][] = array('name' => 'date_format', 'uitype' => '16', 'add_values' => array('dd.mm.yyyy', 'mm.dd.yyyy', 'yyyy.mm.dd', 'dd/mm/yyyy', 'mm/dd/yyyy', 'yyyy/mm/dd'), 'remove_values' => array());
$addPicklists['Users'][] = array('name' => 'end_hour', 'add_values' => array("00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"), 'remove_values' => array());
$addPicklists['Invoice'][] = array('name' => 'invoicestatus', 'uitype' => '15', 'add_values' => array("Derecognized", "Invoice entered"), 'remove_values' => array('Sent', 'Credit Invoice', 'Paid'));
$addPicklists['Leads'][] = array('name' => 'leadsource', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Existing Customer', 'Employee', 'Partner', 'Public Relations', 'Direct Mail'));
$addPicklists['Leads'][] = array('name' => 'leadstatus', 'uitype' => '15', 'add_values' => array('LBL_TO_REALIZE', 'LBL_REQUIRES_VERIFICATION', 'LBL_PRELIMINARY_ANALYSIS_OF', 'LBL_ADVANCED_ANALYSIS', 'LBL_INITIAL_ACQUISITION', 'LBL_CONTACTS_IN_THE_FUTURE', 'LBL_LEAD_UNTAPPED', 'LBL_LEAD_ACQUIRED'), 'remove_values' => array('Attempted to Contact', 'Cold', 'Contact in Future', 'Contacted', 'Hot', 'Junk Lead', 'Lost Lead', 'Not Contacted', 'Pre Qualified', 'Qualified', 'Warm'));
$addPicklists['Leads'][] = array('name' => 'salutationtype', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('--None--'));
$addPicklists['Leads'][] = array('name' => 'industry', 'uitype' => '15', 'add_values' => array('Administration', 'Construction Industry', 'Power Industry', 'Trade', 'Hotels and Restaurants', 'Health Care', 'Industry / Manufacturing', 'Uniformed Services', 'Transport & Logistics', 'Technologies'), 'remove_values' => array('--None--', 'Apparel', 'Banking', 'Biotechnology', 'Chemicals', 'Communications', 'Construction', 'Consulting', 'Electronics', 'Energy', 'Engineering', 'Entertainment', 'Environmental', 'Food & Beverage', 'Government', 'Healthcare', 'Hospitality', 'Insurance', 'Machinery', 'Manufacturing', 'Media', 'Not For Profit', 'Recreation', 'Retail', 'Shipping', 'Technology', 'Telecommunications', 'Transportation', 'Utilities', 'Other'));
$addPicklists['Project'][] = array('name' => 'projecttype', 'uitype' => '15', 'add_values' => array('PLL_INTERNAL', 'PLL_EXTERNAL', 'PLL_COMMON'), 'remove_values' => array('administrative', 'operative', 'other'));
$addPicklists['SalesOrder'][] = array('name' => 'payment_duration', 'uitype' => '16', 'add_values' => array('payment:+0 day', 'payment:+1 day', 'payment:+7 days', 'payment:+14 days', 'payment:+21 days', 'payment:+30 days', 'payment:+60 days', 'payment:+90 days', 'payment:+180 days', 'payment:+360 days', 'payment:+1 month', 'payment:+3 months', 'payment:+6 months', 'payment:+1 year', 'payment:monday next week', 'payment:friday next week', 'payment:first day of next month', 'payment:last day of next month', 'payment:first day of +3 months', 'payment:last day of +3 months'), 'remove_values' => array('Net 30 days', 'Net 45 days', 'Net 60 days'));
$addPicklists['SalesOrder'][] = array('name' => 'recurring_frequency', 'uitype' => '16', 'add_values' => array('+1 day', '+7 days', '+14 days', '+21 days', '+30 days', '+60 days', '+90 days', '+180 days', '+360 days', '+1 month', '+3 months', '+6 months', '+1 year', 'monday next week', 'friday next week', 'first day of next month', 'last day of next month', 'first day of +3 months', 'last day of +3 months'), 'remove_values' => array('Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'));
$addPicklists['Quotes'][] = array('name' => 'quotestage', 'uitype' => '15', 'add_values' => array('PLL_WAITING_FOR_PREPARATION', 'PLL_INTERNAL_CONSULTATION_REQUIRED', 'PLL_EXTERNAL_CONSULTATION_REQUIRED', 'PLL_WAITING_FOR_CUSTOMERS_REPLY', 'PLL_IN_PREPARATION', 'PLL_DECLINED', 'PLL_ACCEPTED'), 'remove_values' => array('Created', 'Delivered', 'Reviewed', 'Accepted', 'Rejected'));
$addPicklists['Calendar'][] = array('name' => 'activitytype', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Mobile Call'));
$addPicklists['Users'][] = array('name' => 'defaulteventstatus', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Planned'));
$addPicklists['Calendar'][] = array('name' => 'eventstatus', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Planned'));
$addPicklists['Potentials'][] = array('name' => 'sales_stage', 'uitype' => '15', 'add_values' => array('Accepted for processing', 'Data verification', 'Customer internal analysis', 'First contact with a customer', 'Advanced business analysis', 'Perception Analysis', 'Preparation of calculations', 'Preparation of offers', 'Awaiting a decision', 'Negotiations', 'Order and contract', 'Documentation verification', 'Closed Lost', 'Closed Waiting for processing', 'Closed Order/contract processing', 'Closed Presale activities', 'Closed Won'), 'remove_values' => array('Prospecting', 'Qualification', 'Needs Analysis', 'Value Proposition', 'Id. Decision Makers', 'Proposal or Price Quote', 'Negotiation or Review'));
$addPicklists['Calendar'][] = array('name' => 'taskstatus', 'uitype' => '15', 'add_values' => array('Cancelled'), 'remove_values' => array('Planned'));
$addPicklists['ProjectMilestone'][] = array('name' => 'projectmilestonetype', 'uitype' => '15', 'add_values' => array('PLL_INTERNAL', 'PLL_EXTERNAL', 'PLL_SHARED'), 'remove_values' => array('administrative', 'operative', 'other'));
$roleRecordList = Settings_Roles_Record_Model::getAll();
$rolesSelected = array();
foreach ($roleRecordList as $roleRecord) {
$rolesSelected[] = $roleRecord->getId();
}
foreach ($addPicklists as $moduleName => $piscklists) {
$moduleModel = Settings_Picklist_Module_Model::getInstance($moduleName);
if (!$moduleModel) {
continue;
}
foreach ($piscklists as $piscklist) {
$fieldModel = Settings_Picklist_Field_Model::getInstance($piscklist['name'], $moduleModel);
if (!$fieldModel) {
continue;
}
$pickListValues = Vtiger_Util_Helper::getPickListValues($piscklist['name']);
foreach ($piscklist['add_values'] as $newValue) {
if (!in_array($newValue, $pickListValues)) {
//$moduleModel->addPickListValues($fieldModel, $newValue);
$moduleModel->addPickListValues($fieldModel, $newValue, $rolesSelected);
}
}
foreach ($piscklist['remove_values'] as $newValue) {
if (!in_array($newValue, $pickListValues)) {
continue;
}
if ($piscklist['uitype'] == '15') {
$deletePicklistValueId = self::getPicklistId($piscklist['name'], $newValue);
if ($deletePicklistValueId) {
$adb->pquery("DELETE FROM `vtiger_role2picklist` WHERE picklistvalueid = ? ", array($deletePicklistValueId));
}
}
$adb->pquery("DELETE FROM `vtiger_" . $piscklist['name'] . "` WHERE " . $piscklist['name'] . " = ? ", array($newValue));
if ($piscklist['name'] == 'Net 30 days') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `payment_duration` = ? WHERE `payment_duration` = ? ;", array($piscklist['name'], 'payment:+30 days'));
}
if ($piscklist['name'] == 'Net 60 days') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `payment_duration` = ? WHERE `payment_duration` = ? ;", array($piscklist['name'], 'payment:+60 days'));
}
if ($piscklist['name'] == 'Daily') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `recurring_frequency` = ? WHERE `recurring_frequency` = ? ;", array($piscklist['name'], '+1 day'));
}
if ($piscklist['name'] == 'Weekly') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `recurring_frequency` = ? WHERE `recurring_frequency` = ? ;", array($piscklist['name'], '+7 days'));
}
if ($piscklist['name'] == 'Monthly') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `recurring_frequency` = ? WHERE `recurring_frequency` = ? ;", array($piscklist['name'], '+1 month'));
}
if ($piscklist['name'] == 'Quarterly') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `recurring_frequency` = ? WHERE `recurring_frequency` = ? ;", array($piscklist['name'], '+3 months'));
}
if ($piscklist['name'] == 'Yearly') {
$adb->pquery("UPDATE `vtiger_invoice_recurring_info` SET `recurring_frequency` = ? WHERE `recurring_frequency` = ? ;", array($piscklist['name'], '+1 year'));
}
if ($piscklist['name'] == 'defaulteventstatus' && $moduleName == 'Users') {
$adb->pquery("UPDATE `vtiger_users` SET `defaulteventstatus` = ? WHERE `defaulteventstatus` = ? ;", array($piscklist['name'], 'Not Held'));
}
if ($piscklist['name'] == 'administrative' && $moduleName == 'ProjectMilestone') {
$adb->pquery("UPDATE `vtiger_projectmilestone` SET `projectmilestonetype` = ? WHERE `projectmilestonetype` = ? ;", array($piscklist['name'], 'PLL_INTERNAL'));
}
if ($piscklist['name'] == 'operative' && $moduleName == 'ProjectMilestone') {
$adb->pquery("UPDATE `vtiger_projectmilestone` SET `projectmilestonetype` = ? WHERE `projectmilestonetype` = ? ;", array($piscklist['name'], 'PLL_EXTERNAL'));
}
if ($piscklist['name'] == 'other' && $moduleName == 'ProjectMilestone') {
$adb->pquery("UPDATE `vtiger_projectmilestone` SET `projectmilestonetype` = ? WHERE `projectmilestonetype` = ? ;", array($piscklist['name'], 'PLL_SHARED'));
}
//$moduleModel->remove($piscklist['name'], $deletePicklistId, '', $moduleName); // remove and replace in records
}
}
$adb->pquery("UPDATE `vtiger_projecttaskstatus` SET `projecttaskstatus` = ? WHERE `projecttaskstatus` = ? ;", array('Cancelled', 'Canceled'));
}
$log->debug("Exiting VT620_to_YT::picklists() method ...");
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:97,代码来源:VT620_to_YT.php
示例18: getAll
/**
* Function to get all the rule members
* @return <Array> - Array of Settings_SharingAccess_RuleMember_Model instances
*/
public static function getAll()
{
$rules = [];
$allGroups = Settings_Groups_Record_Model::getAll();
foreach ($allGroups as $groupId => $groupModel) {
$qualifiedId = self::getQualifiedId(self::RULE_MEMBER_TYPE_GROUPS, $groupId);
$rule = new self();
$rules[self::RULE_MEMBER_TYPE_GROUPS][$qualifiedId] = $rule->set('id', $qualifiedId)->set('name', $groupModel->getName());
}
$allRoles = Settings_Roles_Record_Model::getAll();
foreach ($allRoles as $roleId => $roleModel) {
$qualifiedId = self::getQualifiedId(self::RULE_MEMBER_TYPE_ROLES, $roleId);
$rule = new self();
$rules[self::RULE_MEMBER_TYPE_ROLES][$qualifiedId] = $rule->set('id', $qualifiedId)->set('name', $roleModel->getName());
$qualifiedId = self::getQualifiedId(self::RULE_MEMBER_TYPE_ROLE_AND_SUBORDINATES, $roleId);
$rule = new self();
$rules[self::RULE_MEMBER_TYPE_ROLE_AND_SUBORDINATES][$qualifiedId] = $rule->set('id', $qualifiedId)->set('name', $roleModel->getName());
}
$allUsers = Users_Record_Model::getAll();
foreach ($allUsers as $userId => $userModel) {
$qualifiedId = self::getQualifiedId(self::RULE_MEMBER_TYPE_USERS, $userId);
$rule = new self();
$rules[self::RULE_MEMBER_TYPE_USERS][$qualifiedId] = $rule->set('id', $qualifiedId)->set('name', $userModel->getDisplayName());
}
return $rules;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:30,代码来源:RuleMember.php
示例19: getAll
/**
* Function to get all the groups
* @return <Array> - Array of Settings_Groups_Record_Model instances
*/
public static function getAll($onlyActive = true)
{
$members = array();
$allUsers = Users_Record_Model::getAll($onlyActive);
foreach ($allUsers as $userId => $userModel) {
$qualifiedId = self::getQualifiedId(self::MEMBER_TYPE_USERS, $userId);
$member = new self();
$members[self::MEMBER_TYPE_USERS][$qualifiedId] = $member->set('id', $qualifiedId)->set('name', $userModel->getName());
}
$allGroups = Settings_Groups_Record_Model::getAll();
foreach ($allGroups as $groupId => $groupModel) {
$qualifiedId = self::getQualifiedId(self::MEMBER_TYPE_GROUPS, $groupId);
$member = new self();
$members[self::MEMBER_TYPE_GROUPS][$qualifiedId] = $member->set('id', $qualifiedId)->set('name', $groupModel->getName());
}
$allRoles = Settings_Roles_Record_Model::getAll();
foreach ($allRoles as $roleId => $roleModel) {
$qualifiedId = self::getQualifiedId(self::MEMBER_TYPE_ROLES, $roleId);
$member = new self();
$members[self::MEMBER_TYPE_ROLES][$qualifiedId] = $member->set('id', $qualifiedId)->set('name', $roleModel->getName());
$qualifiedId = self::getQualifiedId(self::MEMBER_TYPE_ROLE_AND_SUBORDINATES, $roleId);
$member = new self();
$members[self::MEMBER_TYPE_ROLE_AND_SUBORDINATES][$qualifiedId] = $member->set('id', $qualifiedId)->set('name', $roleModel->getName());
}
return $members;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:30,代码来源:Member.php
示例20: picklists
public function picklists()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::picklists() method ...");
$addPicklists = array();
$addPicklists['SalesOrder'][] = array('name' => 'payment_duration', 'uitype' => '16', 'add_values' => array('payment:+0 day', 'payment:+1 day', 'payment:+7 days', 'payment:+14 days', 'payment:+21 days', 'payment:+30 days', 'payment:+60 days', 'payment:+90 days', 'payment:+180 days', 'payment:+360 days', 'payment:+1 month', 'payment:+3 months', 'payment:+6 months', 'payment:+1 year', 'payment:monday next week', 'payment:friday next week', 'payment:first day of next month', 'payment:last day of next month', 'payment:first day of +3 months', 'payment:last day of +3 months'), 'remove_values' => array('Net 30 days', 'Net 45 days', 'Net 60 days'));
$addPicklists['SalesOrder'][] = array('name' => 'recurring_frequency', 'uitype' => '16', 'add_values' => array('+1 day', '+7 days', '+14 days', '+21 days', '+30 days', '+60 days', '+90 days', '+180 days', '+360 days', '+1 month', '+3 months', '+6 months', '+1 year', 'monday next week', 'friday next week', 'first day of next month', 'last day of next month', 'first day of +3 months', 'last day of +3 months'), 'remove_values' => array('Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'));
$addPicklists['Calculations'][] = array('name' => 'calculationsstatus', 'uitype' => '15', 'add_values' => array('PLL_WAITING_FOR_VERIFICATION', 'PLL_VERIFICATION_PROCESS', 'PLL_INTERNAL_CONSULTATION_REQUIRED', 'PLL_EXTERNAL_CONSULTATION_REQUIRED', 'PLL_WAITING_FOR_VENDORS_QUOTE', 'PLL_WAITING_FOR_CUSTOMERS_REPLY', 'PLL_IN_PREPARATION', 'LBL_DECLINED', 'LBL_ACCEPTED'), 'remove_values' => array('LBL_IN_PREPARATION', 'Waiting for valuation', 'Waiting for acceptance', 'Accepted', 'Rejected', 'LBL_OBJECTIONS_ARE_RAISED'));
$addPicklists['Quotes'][] = array('name' => 'quotestage', 'uitype' => '15', 'add_values' => array('PLL_WAITING_FOR_PREPARATION', 'PLL_INTERNAL_CONSULTATION_REQUIRED', 'PLL_EXTERNAL_CONSULTATION_REQUIRED', 'PLL_WAITING_FOR_CUSTOMERS_REPLY', 'PLL_IN_PREPARATION', 'PLL_DECLINED', 'PLL_ACCEPTED'), 'remove_values' => array('Created', 'Delivered', 'Reviewed', 'Accepted', 'Rejected'));
$a
|
请发表评论