本文整理汇总了PHP中Vtiger_Util_Helper::getPickListValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Util_Helper::getPickListValues方法的具体用法?PHP Vtiger_Util_Helper::getPickListValues怎么用?PHP Vtiger_Util_Helper::getPickListValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Util_Helper
的用法示例。
在下文中一共展示了Vtiger_Util_Helper::getPickListValues方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: getPicklistValues
/**
* Function to get all the available picklist values for the current field
* @return <Array> List of picklist values if the field is of type picklist or multipicklist, null otherwise.
*/
public function getPicklistValues()
{
$fieldDataType = $this->getFieldDataType();
if ($this->getName() == 'hdnTaxType') {
return null;
}
if ($fieldDataType == 'picklist' || $fieldDataType == 'multipicklist') {
if ($this->isRoleBased()) {
$userModel = Users_Record_Model::getCurrentUserModel();
$picklistValues = Vtiger_Util_Helper::getRoleBasedPicklistValues($this->getName(), $userModel->get('roleid'));
} else {
$picklistValues = Vtiger_Util_Helper::getPickListValues($this->getName());
}
$fieldPickListValues = [];
foreach ($picklistValues as $value) {
$fieldPickListValues[$value] = vtranslate($value, $this->getModuleName());
}
return $fieldPickListValues;
} else {
if (method_exists($this->getUITypeModel(), 'getPicklistValues')) {
return $this->getUITypeModel()->getPicklistValues();
}
}
return null;
}
示例3: getPotentialTotalAmountBySalesStage
/**
* Function returns Potentials sum_invoices for each Sales Stage
* @return <Array>
*/
function getPotentialTotalAmountBySalesStage()
{
//$currentUser = Users_Record_Model::getCurrentUserModel();
$db = PearDatabase::getInstance();
$picklistValues = Vtiger_Util_Helper::getPickListValues('sales_stage');
$data = array();
foreach ($picklistValues as $key => $picklistValue) {
$result = $db->pquery('SELECT SUM(sum_invoices) AS sum_invoices FROM vtiger_potential
INNER JOIN vtiger_crmentity ON vtiger_potential.potentialid = vtiger_crmentity.crmid
AND deleted = 0 ' . Users_Privileges_Model::getNonAdminAccessControlQuery($this->getName()) . ' WHERE sales_stage = ?', array($picklistValue));
$num_rows = $db->num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
$values = array();
$sum_invoices = $db->query_result($result, $i, 'sum_invoices');
if (!empty($sum_invoices)) {
$values[0] = $db->query_result($result, $i, 'sum_invoices');
$values[1] = vtranslate($picklistValue, $this->getName());
$data[] = $values;
}
}
}
return $data;
}
示例4: 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 ...");
}
示例5: 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);
}
示例6: getReccurencePicklistValues
/**
* Function which will give the picklist values for a recurrence field
* @param type $fieldName -- string
* @return type -- array of values
*/
public static function getReccurencePicklistValues()
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$fieldModel = Vtiger_Field_Model::getInstance('recurringtype', Vtiger_Module_Model::getInstance('Events'));
if ($fieldModel->isRoleBased() && !$currentUser->isAdminUser()) {
$userModel = Users_Record_Model::getCurrentUserModel();
$picklistValues = Vtiger_Util_Helper::getRoleBasedPicklistValues('recurringtype', $userModel->get('roleid'));
} else {
$picklistValues = Vtiger_Util_Helper::getPickListValues('recurringtype');
}
foreach ($picklistValues as $value) {
$fieldPickListValues[$value] = vtranslate($value, 'Events');
}
return $fieldPickListValues;
}
示例7: getComponentActivityStateLabel
/**
* The function gets the labels for a given status field
* @param string $key
* @return <Array>
*/
public static function getComponentActivityStateLabel($key = '')
{
$pickListValues = Vtiger_Util_Helper::getPickListValues('activitystatus');
if (!is_array($pickListValues)) {
return [];
}
$componentsActivityState = [];
foreach ($pickListValues as $value) {
switch ($value) {
case "PLL_PLANNED":
$componentsActivityState['not_started'] = $value;
break;
case "PLL_IN_REALIZATION":
$componentsActivityState['in_realization'] = $value;
break;
case "PLL_COMPLETED":
$componentsActivityState['completed'] = $value;
break;
case "PLL_POSTPONED":
$componentsActivityState['postponed'] = $value;
break;
case "PLL_OVERDUE":
$componentsActivityState['overdue'] = $value;
break;
case "PLL_CANCELLED":
$componentsActivityState['cancelled'] = $value;
break;
}
}
if ($key == 'current') {
$componentsActivityState = ['PLL_PLANNED', 'PLL_IN_REALIZATION', 'PLL_OVERDUE'];
} elseif ($key == 'history') {
$componentsActivityState = ['PLL_COMPLETED', 'PLL_POSTPONED', 'PLL_CANCELLED'];
} elseif ($key) {
return $componentsActivityState[$key];
}
return $componentsActivityState;
}
示例8: vtiger_profile2utility
Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,6,1)', array());
Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,10,0)', array());
Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,5,1)', array());
Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,6,1)', array());
Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,10,0)', array());
}
}
chdir(dirname(__FILE__) . '/../../../');
require_once 'includes/main/WebUI.php';
$pickListFieldName = 'no_of_currency_decimals';
$moduleModel = Settings_Picklist_Module_Model::getInstance('Users');
$fieldModel = Vtiger_Field_Model::getInstance($pickListFieldName, $moduleModel);
if ($fieldModel) {
$moduleModel->addPickListValues($fieldModel, 0);
$moduleModel->addPickListValues($fieldModel, 1);
$pickListValues = Vtiger_Util_Helper::getPickListValues($pickListFieldName);
$moduleModel->updateSequence($pickListFieldName, $pickListValues);
}
// SalesPlatform.ru begin
global $adb;
//Unlink unwanted resources
$unWanted = array("modules/Project/BURAK_Gantt.class.php", "modules/Settings/EmailTemplates/views/ListUI5.php", "modules/Vtiger/resources/validator/EmailValidator.js");
for ($i = 0; $i <= count($unWanted); $i++) {
if (file_exists($unWanted[$i])) {
unlink($unWanted[$i]);
}
}
// Begin Multiple organizations
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_organizationdetails ADD company varchar(200) COLLATE utf8_unicode_ci DEFAULT 'Default'", array());
Migration_Index_View::ExecuteQuery("UPDATE vtiger_organizationdetails SET company='Default'", array());
Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_spcompany (\n spcompanyid int(19) NOT NULL AUTO_INCREMENT,\n spcompany varchar(200) COLLATE utf8_unicode_ci NOT NULL,\n presence int(1) NOT NULL DEFAULT '1',\n picklist_valueid int(19) NOT NULL DEFAULT '0',\n sortorderid int(1) DEFAULT NULL,\n PRIMARY KEY (spcompanyid),\n UNIQUE KEY sp_spcompany_idx (spcompany)\n) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", array());
示例9: getCalendarTypes
public static function getCalendarTypes()
{
$calendarConfig = ['Task'];
$eventConfig = Vtiger_Util_Helper::getPickListValues('activitytype');
if (is_array($eventConfig)) {
$calendarConfig = array_merge($calendarConfig, $eventConfig);
}
return $calendarConfig;
}
示例10: getFilterColHtml
function getFilterColHtml(Vtiger_Request $request)
{
require_once 'modules/ITS4YouReports/ITS4YouReports.php';
$return_html = "";
$n_c = 3;
$n_r = 5;
$n = $n_c * $n_r;
$sfield_name = $request->get("sfield_name");
$r_sel_fields = $request->get("r_sel_fields");
$adb = PearDatabase::getInstance();
global $current_user;
//$roleid = $current_user->roleid;
//$sub = getSubordinateRoleAndUsers($roleid);
$roleid = $current_user->roleid;
$sub = getRoleSubordinates($roleid);
$picklistGroupValues = array();
$currField = $request->get("currField");
$currField_arr = explode(":", $currField);
// list($s_tablename,$columnname,$s_module_field_label_str,$fieldname) = explode(":",$currField);
$s_tablename = $currField_arr[0];
$columnname = $currField_arr[1];
$s_module_field_label_str = $currField_arr[2];
$fieldname = $currField_arr[3];
$last_key = count($currField_arr) - 1;
$s_tablename_clear = $s_tablename;
if (is_numeric($currField_arr[$last_key]) || in_array($currField_arr[$last_key], array("INV", "MIF"))) {
$s_tablename_clear = trim($s_tablename, "_" . $currField_arr[$last_key]);
}
$s_module_field_arr = explode("_", $s_module_field_label_str);
$moduleName = $s_module_field_arr[0];
$moduleTabId = getTabid($moduleName);
$uitypeSql = "SELECT uitype FROM vtiger_field WHERE tabid=? AND tablename=? AND columnname=?";
//$adb->setDebug(true);
$uitypeParams = array($moduleTabId, $s_tablename_clear, $columnname);
$uitypeResult = $adb->pquery($uitypeSql, $uitypeParams);
$num_rowuitype = $adb->num_rows($uitypeResult);
if ($num_rowuitype > 0) {
$uitype_row = $adb->fetchByAssoc($uitypeResult);
} elseif ($moduleName == "Leads" && $fieldname == "converted") {
$uitype_row = array("uitype" => "56");
} else {
$uitype_row = array("uitype" => "1");
}
if (!empty($uitype_row) && in_array($uitype_row["uitype"], ITS4YouReports::$s_users_uitypes)) {
$picklistValues = get_user_array(false);
$groups = get_group_array(false);
if (!empty($groups)) {
foreach ($groups as $g_key => $g_name) {
$picklistGroupValues[$g_key] = $g_name;
}
}
$valueArr = explode("|##|", $value);
} elseif (!empty($uitype_row) && $uitype_row['uitype'] == '56') {
$picklistValues = array("0" => "LBL_NO", "1" => "LBL_YES");
//$valueArr = explode("|##|", $r_sel_fields);
$valueArr = explode(",", $r_sel_fields);
} elseif (!empty($uitype_row) && $uitype_row['uitype'] == '26') {
$sql = "select foldername,folderid from vtiger_attachmentsfolder order by foldername asc ";
$res = $adb->pquery($sql, array());
for ($i = 0; $i < $adb->num_rows($res); $i++) {
$fid = $adb->query_result($res, $i, "folderid");
$picklistValues[$fid] = $adb->query_result($res, $i, "foldername");
}
$valueArr = explode(",", $r_sel_fields);
} elseif (!empty($uitype_row) && $uitype_row['uitype'] == '27') {
$picklistValues = array("I" => "LBL_INTERNAL", "E" => "LBL_EXTERNAL");
$valueArr = explode(",", $r_sel_fields);
} else {
require_once 'modules/PickList/PickListUtils.php';
if ($uitype_row["uitype"] == "16") {
$picklistValues = Vtiger_Util_Helper::getPickListValues($columnname);
} else {
$picklistValues = getAssignedPicklistValues($fieldname, $roleid, $adb);
$valueArr = explode("|##|", $value);
}
}
$pickcount = 0;
$sel_fields = array();
$field_uitype = $uitype_row["uitype"];
if (!empty($picklistValues)) {
foreach ($picklistValues as $order => $pickListValue) {
$pickListValue = trim($pickListValue);
if ($uitype_row['uitype'] == '56') {
$check_val = $pickListValue == "LBL_YES" ? "yes" : "no";
if (in_array(trim($order), array_map("trim", $valueArr)) || in_array($check_val, $valueArr)) {
$chk_val = "selected";
} else {
$chk_val = "";
}
$pickcount++;
} elseif (in_array(trim($pickListValue), array_map("trim", $valueArr))) {
$chk_val = "selected";
$pickcount++;
} else {
$chk_val = '';
}
if ($uitype_row['uitype'] == '56') {
$sel_fields[] = array(vtranslate($pickListValue, $s_module_field_arr[0]), $order, $chk_val);
} else {
$sel_fields[] = array(vtranslate($pickListValue, $s_module_field_arr[0]), $pickListValue, $chk_val);
//.........这里部分代码省略.........
示例11: process
//.........这里部分代码省略.........
${${"GLOBALS"}["fwfcprcjgeg"]}[] = ${$ynvjtpwfuypi};
}
${${"GLOBALS"}["blrdtf"]}[${${"GLOBALS"}["awzgfzlllo"]}["field"]][] = ${${"GLOBALS"}["qnejxfl"]}["field"];
if (${${"GLOBALS"}["wensssj"]} == "listview") {
${${"GLOBALS"}["nckkjvygiqsc"]} = Colorizer_VtUtils::getColumnName(${${"GLOBALS"}["awzgfzlllo"]}["field"], ${${"GLOBALS"}["xjhpotmljg"]});
} else {
$hvriqy = "value";
${${"GLOBALS"}["nckkjvygiqsc"]} = ${$hvriqy}["field"];
}
${${"GLOBALS"}["bftvncm"]}[] = array(${$zhipeeopqdn}, ${${"GLOBALS"}["nckkjvygiqsc"]}, ${${"GLOBALS"}["vhudblec"]}, intval(${$fdxjti}["not"]));
}
if (count(${${"GLOBALS"}["vdwdhgrefti"]}["actions"]) > 0) {
$dnixxrrhjbj = "actionsFktName";
$kuiwrh = "action";
${"GLOBALS"}["werpyvu"] = "row";
${$dnixxrrhjbj} = "actionFkt_" . ${${"GLOBALS"}["werpyvu"]}["id"];
${${"GLOBALS"}["kzcrkutnedo"]} = "function " . ${${"GLOBALS"}["erscuxob"]} . "(colorize, field) {";
$rnuqwokpq = "extraJavaScript";
foreach (${${"GLOBALS"}["vdwdhgrefti"]}["actions"] as ${$kuiwrh}) {
$pxutyxpvch = "action";
$ledcutam = "action";
${"GLOBALS"}["efmjnifbs"] = "confValues";
${${"GLOBALS"}["efmjnifbs"]} = -1;
if (${${"GLOBALS"}["wensssj"]} === "listview" && (!isset(${${"GLOBALS"}["wawdybuyk"]}["additionalActions"][${${"GLOBALS"}["vpxkzxidmxy"]}["action"]]) || ${${"GLOBALS"}["wawdybuyk"]}["additionalActions"][${${"GLOBALS"}["vpxkzxidmxy"]}["action"]]["listview"] == false)) {
continue;
}
${"GLOBALS"}["qhcydqrhke"] = "script";
if (!isset(${${"GLOBALS"}["wawdybuyk"]}["additionalActions"][${$pxutyxpvch}["action"]]) || ${${"GLOBALS"}["wawdybuyk"]}["additionalActions"][${${"GLOBALS"}["vpxkzxidmxy"]}["action"]]["configuration"] == "block") {
$nftrkn = "blockIndex";
$azoffnx = "action";
$nrqofqeem = "blockIndex";
${$nftrkn} = $moduleModel->getBlockIndex(${${"GLOBALS"}["xjhpotmljg"]}, ${$azoffnx}["value"]);
if (empty(${$nrqofqeem}) && ${${"GLOBALS"}["ngczlevt"]} !== 0) {
${${"GLOBALS"}["ngczlevt"]} = -1;
}
${${"GLOBALS"}["klmdwkj"]} = ${${"GLOBALS"}["ngczlevt"]};
} elseif (${${"GLOBALS"}["wawdybuyk"]}["additionalActions"][${$ledcutam}["action"]]["configuration"] == "select") {
${${"GLOBALS"}["klmdwkj"]} = array("value" => ${${"GLOBALS"}["vpxkzxidmxy"]}["value"]);
}
${${"GLOBALS"}["qhcydqrhke"]} .= "Colorizer.runAction('" . ${${"GLOBALS"}["vpxkzxidmxy"]}["action"] . "', " . json_encode(${${"GLOBALS"}["klmdwkj"]}) . ", colorize, field);";
}
${${"GLOBALS"}["kzcrkutnedo"]} .= "}";
$yaugixmgcb = "script";
${$rnuqwokpq}[] = ${$yaugixmgcb};
} else {
${"GLOBALS"}["kukrqmd"] = "actionsFktName";
${${"GLOBALS"}["kukrqmd"]} = false;
}
${${"GLOBALS"}["yrylcvcozpl"]} = array("condition" => ${${"GLOBALS"}["ltflusu"]}, "fieldSettings" => ${${"GLOBALS"}["vdwdhgrefti"]}["settings"], "labelSettings" => ${${"GLOBALS"}["vdwdhgrefti"]}["labelsettings"], "additional" => ${${"GLOBALS"}["vdwdhgrefti"]}["additional"], "action" => ${$uumqxmlk}, "view" => array("detailview" => ${${"GLOBALS"}["vdwdhgrefti"]}["detailview"], "listview" => ${$gxdpxhrlrqyc}["listview"], "summaryview" => ${$seoqjslhy}["summaryview"], "editview" => ${${"GLOBALS"}["nruvpxnhqtg"]}["editview"]));
}
${"GLOBALS"}["zccgyfpenw"] = "colorizeFunctions";
if (${${"GLOBALS"}["wensssj"]} == "listview") {
$gmqgcvy = "tabid";
$hhbjvrspgcc = "columnName";
${$hhbjvrspgcc} = Colorizer_VtUtils::getColumnName(${${"GLOBALS"}["vdwdhgrefti"]}["field"], ${$gmqgcvy});
} else {
${"GLOBALS"}["sbfykd"] = "row";
${"GLOBALS"}["btuwfoc"] = "columnName";
${${"GLOBALS"}["btuwfoc"]} = ${${"GLOBALS"}["sbfykd"]}["field"];
}
if (!isset(${${"GLOBALS"}["zccgyfpenw"]}[${$rdmvuqtbnfu}])) {
$kdtltcrtkxy = "colorizeFunctions";
${$kdtltcrtkxy}[${${"GLOBALS"}["nckkjvygiqsc"]}] = array();
}
${$pcgsqcqduyp}[${${"GLOBALS"}["nckkjvygiqsc"]}][] = ${${"GLOBALS"}["gbugqbyjk"]};
}
${$orbyqo}["additionalArguments"] = ${${"GLOBALS"}["gvqlwnq"]};
${"GLOBALS"}["rhsbmww"] = "colorizeFunctions";
${$thfqjyf}["colorizerCheckFktAlternative"] = ${${"GLOBALS"}["blrdtf"]};
${${"GLOBALS"}["gdoiwflj"]}["colorizeFunctions"] = ${${"GLOBALS"}["rhsbmww"]};
${$ylgqtyr}["extraJavaScript"] = implode("", ${$ytgiregldh});
${"GLOBALS"}["rrrxhscolpkm"] = "result";
$xltxsmljt = "response";
${${"GLOBALS"}["wawdybuyk"]}["dateFormat"] = $current_user->get("date_format");
${${"GLOBALS"}["rrrxhscolpkm"]}["availableUser"] = ${${"GLOBALS"}["yoxfqbyi"]};
global $current_language;
${${"GLOBALS"}["lpttleo"]} = array();
if (${${"GLOBALS"}["wensssj"]} == "listview" && ${${"GLOBALS"}["ykgbyos"]} != "en_us") {
$exekdqqwrph = "field";
$rmrkluuesh = "fields";
$gjtizfebxy = "fields";
${$rmrkluuesh} = Colorizer_VtUtils::getFieldsForModule(${${"GLOBALS"}["tkkmift"]}, array(15, 16, 33));
foreach (${$gjtizfebxy} as ${$exekdqqwrph}) {
$bqubeslnb = "value";
${"GLOBALS"}["bywcimcb"] = "values";
${${"GLOBALS"}["oqoiqexv"]} = Vtiger_Util_Helper::getPickListValues($field->name);
foreach (${${"GLOBALS"}["bywcimcb"]} as ${$bqubeslnb}) {
$jhccvtf = "value";
$zdufxcwq = "value";
${${"GLOBALS"}["lpttleo"]}[$field->column][getTranslatedString(${$jhccvtf}, ${${"GLOBALS"}["tkkmift"]})] = ${$zdufxcwq};
}
}
}
${$dynxbna}["picklists"] = ${${"GLOBALS"}["lpttleo"]};
${$incqeqvkin}["version"] = COLORIZER_VERSION;
${$xltxsmljt} = new Vtiger_Response();
$response->setResult(${${"GLOBALS"}["wawdybuyk"]});
$response->setEmitType(Vtiger_Response::${${"GLOBALS"}["ebbutvbxe"]});
$response->emit();
}
示例12: 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'));
$addPicklists['Calendar'][] = array('name' => 'activitytype', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Mobile Call'));
$addPicklists['Calendar'][] = array('name' => 'eventstatus', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Planned'));
$addPicklists['Users'][] = array('name' => 'defaulteventstatus', 'uitype' => '15', 'add_values' => array(), 'remove_values' => array('Planned'));
$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'] == 'Accepted' && $moduleName == 'Calculations') {
$adb->pquery("UPDATE `vtiger_calculations` SET `calculationsstatus` = ? WHERE `calculationsstatus` = ? ;", array($piscklist['name'], 'LBL_ACCEPTED'));
}
if ($piscklist['name'] == 'Rejected' && $moduleName == 'Calculations') {
$adb->pquery("UPDATE `vtiger_calculations` SET `calculationsstatus` = ? WHERE `calculationsstatus` = ? ;", array($piscklist['name'], 'LBL_DECLINED'));
}
if ($piscklist['name'] == 'Accepted' && $moduleName == 'Quotes') {
$adb->pquery("UPDATE `vtiger_calculations` SET `calculationsstatus` = ? WHERE `calculationsstatus` = ? ;", array($piscklist['name'], 'PLL_ACCEPTED'));
}
if ($piscklist['name'] == 'Rejected' && $moduleName == 'Quotes') {
$adb->pquery("UPDATE `vtiger_quotes` SET `quotestage` = ? WHERE `quotestage` = ? ;", array($piscklist['name'], 'PLL_DECLINED'));
}
//$moduleModel->remove($piscklist['name'], $deletePicklistId, '', $moduleName); // remove and replace in records
}
}
}
$log->debug("Exiting YetiForceUpdate::picklists() method ...");
}
示例13: 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 ...");
}
示例14: 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 ...");
}