本文整理汇总了PHP中Settings_Roles_Record_Model::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings_Roles_Record_Model::getAll方法的具体用法?PHP Settings_Roles_Record_Model::getAll怎么用?PHP Settings_Roles_Record_Model::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings_Roles_Record_Model
的用法示例。
在下文中一共展示了Settings_Roles_Record_Model::getAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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');
}
示例4: 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 ...");
}
示例5: 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);
}
示例6: assignValueToRole
/**
* Function which will assign existing values to the roles
* @param Vtiger_Request $request
*/
public function assignValueToRole(Vtiger_Request $request)
{
$pickListFieldName = $request->get('picklistName');
$valueToAssign = $request->get('assign_values');
$userSelectedRoles = $request->get('rolesSelected');
$roleIdList = array();
//selected all roles option
if (in_array('all', $userSelectedRoles)) {
$roleRecordList = Settings_Roles_Record_Model::getAll();
foreach ($roleRecordList as $roleRecord) {
$roleIdList[] = $roleRecord->getId();
}
} else {
$roleIdList = $userSelectedRoles;
}
$moduleModel = new Settings_Picklist_Module_Model();
$response = new Vtiger_Response();
try {
$moduleModel->enableOrDisableValuesForRole($pickListFieldName, $valueToAssign, array(), $roleIdList);
$response->setResult(array('success', true));
} catch (Exception $e) {
$response->setError($e->getCode(), $e->getMessage());
}
$response->emit();
}
示例7: saveentity
/** Function to save the user information into the database
* @param $module -- module name:: Type varchar
*
*/
function saveentity($module)
{
global $current_user;
//$adb added by raju for mass mailing
$insertion_mode = $this->mode;
if (empty($this->column_fields['time_zone'])) {
$dbDefaultTimeZone = DateTimeField::getDBTimeZone();
$this->column_fields['time_zone'] = $dbDefaultTimeZone;
$this->time_zone = $dbDefaultTimeZone;
}
if (empty($this->column_fields['currency_id'])) {
$this->column_fields['currency_id'] = CurrencyField::getDBCurrencyId();
}
if (empty($this->column_fields['date_format'])) {
$this->column_fields['date_format'] = 'yyyy-mm-dd';
}
if (empty($this->column_fields['start_hour'])) {
$this->column_fields['start_hour'] = '08:00';
}
if (empty($this->column_fields['dayoftheweek'])) {
$this->column_fields['dayoftheweek'] = 'Monday';
}
if (empty($this->column_fields['callduration'])) {
$this->column_fields['callduration'] = 5;
}
if (empty($this->column_fields['othereventduration'])) {
$this->column_fields['othereventduration'] = 5;
}
if (empty($this->column_fields['hour_format'])) {
$this->column_fields['hour_format'] = 24;
}
if (empty($this->column_fields['activity_view'])) {
$this->column_fields['activity_view'] = 'This Month';
}
if (empty($this->column_fields['calendarsharedtype'])) {
$this->column_fields['calendarsharedtype'] = 'public';
}
if (empty($this->column_fields['default_record_view'])) {
$this->column_fields['default_record_view'] = 'Summary';
}
if (empty($this->column_fields['status'])) {
$this->column_fields['status'] = 'Active';
}
if (empty($this->column_fields['currency_decimal_separator']) && $this->column_fields['currency_decimal_separator'] != ' ') {
$this->column_fields['currency_decimal_separator'] = '.';
}
if (empty($this->column_fields['currency_grouping_separator']) && $this->column_fields['currency_grouping_separator'] != ' ') {
$this->column_fields['currency_grouping_separator'] = ' ';
}
$this->db->println("TRANS saveentity starts {$module}");
$this->db->startTransaction();
foreach ($this->tab_name as $table_name) {
if ($table_name == 'vtiger_attachments') {
$this->insertIntoAttachment($this->id, $module);
} else {
$this->insertIntoEntityTable($table_name, $module);
}
}
if (Settings_Roles_Record_Model::getInstanceById($this->column_fields['roleid']) == null) {
$roleid = Settings_Roles_Record_Model::getInstanceByName($this->column_fields['roleid']);
if ($roleid) {
$this->column_fields['roleid'] = $roleid->getId();
} else {
$roles = Settings_Roles_Record_Model::getAll();
$this->column_fields['roleid'] = key($roles);
}
}
require_once 'modules/Users/CreateUserPrivilegeFile.php';
createUserPrivilegesfile($this->id);
unset($_SESSION['next_reminder_interval']);
unset($_SESSION['next_reminder_time']);
if ($insertion_mode != 'edit') {
$this->createAccessKey();
}
$this->db->completeTransaction();
$this->db->println("TRANS saveentity ends");
}
示例8: picklists
public function picklists()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::picklists() method ...");
$addPicklists = [];
$addPicklists['ProjectMilestone'][] = array('name' => 'projectmilestonetype', 'uitype' => '15', 'add_values' => array('PLL_INTERNAL', 'PLL_EXTERNAL', 'PLL_SHARED'), 'remove_values' => array('administrative', 'operative', 'other'));
$addPicklists['LettersOut'][] = array('name' => 'lout_status', 'uitype' => '16', 'add_values' => array('PLL_NEW', 'PLL_SETTLED'), 'remove_values' => array('PLL_A', 'PLL_B'));
$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('Draft', 'Realization proceeding', 'Warranty proceeding', 'Delivered to Organization'));
$addPicklists['Calculations'][] = array('name' => 'calculationsstatus', 'uitype' => '15', 'add_values' => array('PLL_DRAFT', 'PLL_IN_REALIZATION', 'PLL_WAITING_FOR_QUOTATION', 'PLL_WAITING_FOR_ACCEPTANCE', 'PLL_ACCEPTED', 'PLL_REQUIRES_AMENDMENTS'), 'remove_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'));
$addPicklists['OSSMailView'][] = array('name' => 'ossmailview_sendtype', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Sent'));
$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, $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'] . " = ? LIMIT 1", array($newValue));
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'));
}
// replace ?
/*if($piscklist['name'] == 'PLL_A' && $moduleName == 'LettersOut'){
$adb->pquery("UPDATE `vtiger_lettersout` SET `lout_status` = ? WHERE `lout_status` = ? ;", array($piscklist['name'], 'PLL_NEW'));
}if($piscklist['name'] == 'PLL_B' && $moduleName == 'LettersOut'){
$adb->pquery("UPDATE `vtiger_lettersout` SET `lout_status` = ? WHERE `lout_status` = ? ;", array($piscklist['name'], 'PLL_SETTLED'));
}*/
if ($piscklist['name'] == 'Draft' && $moduleName == 'Assets') {
$adb->pquery("UPDATE `vtiger_assets` SET `assetstatus` = ? WHERE `assetstatus` = ? ;", array($piscklist['name'], 'PLL_DRAFT'));
}
// replace ?
/*
if($piscklist['name'] == 'Realization proceeding' && $moduleName == 'Assets'){
$adb->pquery("UPDATE `vtiger_assets` SET `assetstatus` = ? WHERE `assetstatus` = ? ;", array($piscklist['name'], 'PLL_WARRANTY_SUPPORT'));
}if($piscklist['name'] == 'Warranty proceeding' && $moduleName == 'Assets'){
$adb->pquery("UPDATE `vtiger_assets` SET `assetstatus` = ? WHERE `assetstatus` = ? ;", array($piscklist['name'], 'PLL_POST_WARRANTY_SUPPORT'));
}if($piscklist['name'] == 'Delivered to Organization' && $moduleName == 'Assets'){
$adb->pquery("UPDATE `vtiger_assets` SET `assetstatus` = ? WHERE `assetstatus` = ? ;", array($piscklist['name'], 'PLL_NO_SUPPORT'));
}
*/
}
}
}
$log->debug("Exiting YetiForceUpdate::picklists() method ...");
}
示例9: 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;
}
示例10: 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);
}
示例11: 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;
}
示例12: 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;
}
示例13: 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 ...");
}
示例14: step1
function step1(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$record = $request->get('record');
$reportModel = Reports_Record_Model::getCleanInstance($record);
if (!$reportModel->has('folderid')) {
$reportModel->set('folderid', $request->get('folder'));
}
$data = $request->getAll();
foreach ($data as $name => $value) {
$reportModel->set($name, $value);
}
$modulesList = $reportModel->getModulesList();
if (!empty($record)) {
$viewer->assign('MODE', 'edit');
} else {
$firstModuleName = reset($modulesList);
if ($firstModuleName) {
$reportModel->setPrimaryModule($firstModuleName);
}
$viewer->assign('MODE', '');
}
$reportModuleModel = $reportModel->getModule();
$reportFolderModels = $reportModuleModel->getFolders();
$relatedModules = $reportModel->getReportRelatedModules();
foreach ($relatedModules as $primaryModule => $relatedModuleList) {
$translatedRelatedModules = array();
foreach ($relatedModuleList as $relatedModuleName) {
$translatedRelatedModules[$relatedModuleName] = vtranslate($relatedModuleName, $relatedModuleName);
}
$relatedModules[$primaryModule] = $translatedRelatedModules;
}
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('SCHEDULEDREPORTS', $reportModel->getScheduledReport());
$viewer->assign('MODULELIST', $modulesList);
$viewer->assign('RELATED_MODULES', $relatedModules);
$viewer->assign('REPORT_MODEL', $reportModel);
$viewer->assign('REPORT_FOLDERS', $reportFolderModels);
$viewer->assign('RECORD_ID', $record);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('CURRENT_USER', $currentUserModel);
$viewer->assign('ROLES', Settings_Roles_Record_Model::getAll());
$admin = Users::getActiveAdminUser();
$viewer->assign('ACTIVE_ADMIN', $admin);
if ($request->get('isDuplicate')) {
$viewer->assign('IS_DUPLICATE', true);
}
$viewer->view('Step1.tpl', $moduleName);
}
示例15: picklists
function picklists()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::picklists() method ...");
$addPicklists = [];
$addPicklists['OSSMailTemplates'][] = ['name' => 'ossmailtemplates_type', 'uitype' => '16', 'add_values' => ['PLL_MAIL', 'PLL_LIST'], 'remove_values' => []];
$addPicklists['Calculations'][] = ['name' => 'calculations_cons', 'uitype' => '33', 'add_values' => ['PLL_LONGTERM_REALIZATION'], 'remove_values' => []];
$addPicklists['Calculations'][] = ['name' => 'calculations_pros', 'uitype' => '33', 'add_values' => [], 'remove_values' => ['PLL_LONGTERM_REALIZATION']];
$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, $rolesSelected);
}
}
foreach ($piscklist['remove_values'] as $newValue) {
if (!in_array($newValue, $pickListValues)) {
continue;
}
if ($piscklist['uitype'] != '16') {
$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));
}
}
}
$log->debug("Exiting YetiForceUpdate::picklists() method ...");
}