本文整理汇总了PHP中getSqlCacheData函数的典型用法代码示例。如果您正苦于以下问题:PHP getSqlCacheData函数的具体用法?PHP getSqlCacheData怎么用?PHP getSqlCacheData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSqlCacheData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: send_webmail
/** Function used to send email
* $module -- current module
* $to_email -- to email address
* $from_name -- currently loggedin user name
* $from_email -- currently loggedin ec_users's email id. you can give as '' if you are not in HelpDesk module
* $subject -- subject of the email you want to send
* $contents -- body of the email you want to send
* $cc -- add email ids with comma seperated. - optional
* $bcc -- add email ids with comma seperated. - optional.
* $attachment -- whether we want to attach the currently selected file or all ec_files.[values = current,all] - optional
* $emailid -- id of the email object which will be used to get the ec_attachments
*/
function send_webmail($to_email, $subject, $contents, $cc = '', $bcc = '', $attachment = '', $emailid = '')
{
global $adb, $log;
global $current_user;
$log->debug("Entering send_webmail() method ...");
$key = "webmail_array_" . $current_user->id;
$webmail_array = getSqlCacheData($key);
if (!$webmail_array) {
$webmail_array = $adb->getFirstLine("select * from ec_systems where server_type='email' and smownerid='" . $current_user->id . "'");
if (empty($webmail_array)) {
return "No Smtp Server!";
}
setSqlCacheData($key, $webmail_array);
}
$from_email = $webmail_array['from_email'];
if ($from_email == '') {
$from_email = $webmail_array['server_username'];
}
require_once 'include/phpmailer/class.phpmailer.php';
$mail = new PHPMailer(true);
// the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP();
// telling the class to use SMTP
$result = "";
try {
$mail->CharSet = "UTF-8";
$mail->Host = $webmail_array['server'];
// SMTP server
//$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->Port = $webmail_array['server_port'];
// set the SMTP port for the GMAIL server
$mail->Username = $webmail_array['server_username'];
// SMTP account username
$mail->Password = $webmail_array['server_password'];
// SMTP account password
$mail->AddReplyTo($from_email, "");
$mail->AddAddress($to_email, "");
$mail->SetFrom($from_email, "");
$mail->Subject = $subject;
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
// optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($contents);
$mail->Send();
} catch (phpmailerException $e) {
$result = $e->errorMessage();
//Pretty error messages from PHPMailer
} catch (Exception $e) {
$result = $e->getMessage();
//Boring error messages from anything else!
}
$log->debug("Exit send_webmail() method ...");
return $result;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:67,代码来源:mail.php
示例2: getSplitDBValidationData
/**
* merged with getDBValidationData and split_validationdataArray functions for performance
*/
function getSplitDBValidationData($tablearray, $tabid = '')
{
global $log;
$log->debug("Entering getSplitDBValidationData() method ...");
$key = "split_validationdata_" . $tabid;
$validationData = getSqlCacheData($key);
if (!$validationData) {
$fieldName_array = array();
$sql = '';
$tab_con = "";
$numValues = count($tablearray);
global $adb, $mod_strings;
if ($tabid != '') {
$tab_con = ' and tabid=' . $tabid;
}
for ($i = 0; $i < $numValues; $i++) {
if (in_array("emails", $tablearray)) {
if ($numValues > 1 && $i != $numValues - 1) {
$sql .= "select fieldlabel,fieldname,typeofdata from ec_field where tablename='" . $tablearray[$i] . "'and tabid=10 and displaytype <> 2 union ";
} else {
$sql .= "select fieldlabel,fieldname,typeofdata from ec_field where tablename='" . $tablearray[$i] . "' and tabid=10 and displaytype <> 2 ";
}
} else {
if ($numValues > 1 && $i != $numValues - 1) {
$sql .= "select fieldlabel,fieldname,typeofdata from ec_field where tablename='" . $tablearray[$i] . "'" . $tab_con . " and displaytype=1 union ";
} else {
$sql .= "select fieldlabel,fieldname,typeofdata from ec_field where tablename='" . $tablearray[$i] . "'" . $tab_con . " and displaytype=1";
}
}
}
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
$fieldName_array = array();
for ($i = 0; $i < $noofrows; $i++) {
$fieldlabel = $mod_strings[$adb->query_result($result, $i, 'fieldlabel')];
$fieldname = $adb->query_result($result, $i, 'fieldname');
$typeofdata = $adb->query_result($result, $i, 'typeofdata');
//echo '<br> '.$fieldlabel.'....'.$fieldname.'....'.$typeofdata;
$fldLabel_array = array();
$fldLabel_array[$fieldlabel] = $typeofdata;
$fieldName_array[$fieldname] = $fldLabel_array;
}
$validationData = split_validationdataArray($fieldName_array);
setSqlCacheData($key, $validationData);
}
$log->debug("Exiting getSplitDBValidationData method ...");
return $validationData;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:51,代码来源:FormValidationUtil.php
示例3: send_webmail
function send_webmail($mail, $to_email, $subject, $contents, $smownerid, $callback)
{
global $adb, $log;
global $current_user;
$log->debug("Entering send_webmail() method ...");
$key = "webmail_array_" . $smownerid;
$webmail_array = getSqlCacheData($key);
if (!$webmail_array) {
$webmail_array = $adb->getFirstLine("select * from ec_systems where server_type='email' and smownerid='" . $current_user->id . "'");
if (empty($webmail_array)) {
return "No Smtp Server!";
}
setSqlCacheData($key, $webmail_array);
}
$from_email = $webmail_array['from_email'];
if ($from_email == '') {
$from_email = $webmail_array['server_username'];
}
$options = array('from' => $from_email, 'to' => $to_email, 'cc' => '', 'smtp_host' => $webmail_array['server'], 'smtp_port' => $webmail_array['server_port'], 'smtp_username' => $webmail_array['server_username'], 'smtp_password' => $webmail_array['server_password'], 'subject' => $subject, 'content' => $contents, 'content_type' => "HTML", 'charset' => "utf8", 'tls' => "false", 'compress' => '', 'callback_url' => $callback);
$mail->setOpt($options);
$ret = $mail->send();
if ($ret === false) {
$errMsg = $mail->errmsg() . '<br>';
$log->info("send_webmail ::errormsg:" . $mail->errmsg());
}
$mail->clean();
// 重用此对象
$log->debug("Exit send_webmail() method ...");
return $errMsg;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:30,代码来源:getMemdayReminder.php
示例4: getOutputHtml
/** This function returns the ec_field details for a given ec_fieldname.
* Param $uitype - UI type of the ec_field
* Param $fieldname - Form ec_field name
* Param $fieldlabel - Form ec_field label name
* Param $maxlength - maximum length of the ec_field
* Param $col_fields - array contains the ec_fieldname and values
* Param $generatedtype - Field generated type (default is 1)
* Param $module_name - module name
* Return type is an array
*/
function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields, $generatedtype, $module_name, $mode = '', $mandatory = 0, $typeofdata = "")
{
global $log;
$log->debug("Entering getOutputHtml() method ...");
global $adb, $log;
global $theme;
global $mod_strings;
global $app_strings;
global $current_user;
global $noof_group_rows;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
//$fieldlabel = from_html($fieldlabel);
$fieldvalue = array();
$final_arr = array();
$value = $col_fields[$fieldname];
$custfld = '';
$ui_type[] = $uitype;
$editview_fldname[] = $fieldname;
if ($generatedtype == 2) {
$mod_strings[$fieldlabel] = $fieldlabel;
}
if (!isset($mod_strings[$fieldlabel])) {
$mod_strings[$fieldlabel] = $fieldlabel;
}
if ($uitype == 5) {
if ($value == '') {
if ($mandatory == 1) {
$disp_value = getNewDisplayDate();
}
} else {
$disp_value = getDisplayDate($value);
}
$editview_label[] = $mod_strings[$fieldlabel];
$fieldvalue[] = $disp_value;
} elseif ($uitype == 15 || $uitype == 16 || $uitype == 111) {
$editview_label[] = $mod_strings[$fieldlabel];
//changed by dingjianting on 2007-10-3 for cache pickListResult
$key = "picklist_array_" . $fieldname;
$picklist_array = getSqlCacheData($key);
if (!$picklist_array) {
$pick_query = "select colvalue from ec_picklist where colname='" . $fieldname . "' order by sequence asc";
$pickListResult = $adb->getList($pick_query);
$picklist_array = array();
foreach ($pickListResult as $row) {
$picklist_array[] = $row['colvalue'];
}
setSqlCacheData($key, $picklist_array);
}
//Mikecrowe fix to correctly default for custom pick lists
$options = array();
$found = false;
foreach ($picklist_array as $pickListValue) {
if ($value == $pickListValue) {
$chk_val = "selected";
$found = true;
} else {
$chk_val = '';
}
$options[] = array($pickListValue => $chk_val);
}
$fieldvalue[] = $options;
} elseif ($uitype == '1021' || $uitype == '1022' || $uitype == '1023') {
$typearr = explode("::", $typeofdata);
$multifieldid = $typearr[1];
$editview_label[] = $mod_strings[$fieldlabel];
$fieldvalue[] = getMultiFieldEditViewValue($multifieldid, $uitype, $col_fields);
$fieldvalue[] = $multifieldid;
//print_r($fieldvalue);
} elseif ($uitype == 10) {
$query = "SELECT ec_entityname.* FROM ec_crmentityrel inner join ec_entityname on ec_entityname.modulename=ec_crmentityrel.relmodule WHERE ec_crmentityrel.module='" . $module_name . "' and ec_entityname.entityidfield='" . $fieldname . "'";
$fldmod_result = $adb->query($query);
$rownum = $adb->num_rows($fldmod_result);
if ($rownum > 0) {
$rel_modulename = $adb->query_result($fldmod_result, 0, 'modulename');
$rel_tablename = $adb->query_result($fldmod_result, 0, 'tablename');
$rel_entityname = $adb->query_result($fldmod_result, 0, 'fieldname');
$rel_entityid = $adb->query_result($fldmod_result, 0, 'entityidfield');
}
if ($value != '') {
$module_entityname = getEntityNameForTen($rel_tablename, $rel_entityname, $fieldname, $value);
} elseif (isset($_REQUEST[$fieldname]) && $_REQUEST[$fieldname] != '') {
if ($_REQUEST['module'] == $rel_modulename) {
$module_entityname = '';
} else {
$value = $_REQUEST[$fieldname];
$module_entityname = getEntityNameForTen($rel_tablename, $rel_entityname, $fieldname, $value);
}
}
if (isset($app_strings[$fieldlabel])) {
//.........这里部分代码省略.........
开发者ID:Pengzw,项目名称:c3crm,代码行数:101,代码来源:EditViewUtils.php
示例5: getQuickValidationData
/**
* merged with getDBValidationData and split_validationdataArray functions for performance
*/
function getQuickValidationData($tabid, $display_type_check)
{
global $log;
$log->debug("Entering getQuickValidationData() method ...");
$key = "quickedit_validationdata_" . $tabid;
$validationData = getSqlCacheData($key);
if (!$validationData) {
$sql = '';
global $adb, $mod_strings, $current_user;
//retreive the ec_profileList from database
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
$sql = "SELECT ec_field.* FROM ec_field INNER JOIN ec_def_org_field ON ec_def_org_field.fieldid=ec_field.fieldid AND ec_def_org_field.visible=0 WHERE ec_field.tabid=" . $tabid . " AND ec_field.block IN " . $blockid_list . " AND " . $display_type_check . " ORDER BY block,sequence";
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
$fieldName_array = array();
for ($i = 0; $i < $noofrows; $i++) {
$fieldlabel = $mod_strings[$adb->query_result($result, $i, 'fieldlabel')];
$fieldname = $adb->query_result($result, $i, 'fieldname');
$typeofdata = $adb->query_result($result, $i, 'typeofdata');
$fldLabel_array = array();
$fldLabel_array[$fieldlabel] = $typeofdata;
$fieldName_array[$fieldname] = $fldLabel_array;
}
$validationData = split_validationdataArray($fieldName_array);
setSqlCacheData($key, $validationData);
}
$log->debug("Exiting getQuickValidationData method ...");
return $validationData;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:32,代码来源:QuickEdit.php
示例6: getTabid
<?php
global $adb, $current_user;
if ($current_user->is_admin == "on") {
echo "Yes";
die;
}
$modname = $_REQUEST["modname"];
$tabid = getTabid($modname);
$key = "check_update_smownerid_" . $current_user->id . "_" . $tabid;
$readonly = getSqlCacheData($key);
if (!$readonly) {
$readonly = 0;
$query = "select fieldid from ec_field where tabid = {$tabid} and columnname = 'smownerid' ";
$result = $adb->query($query);
$numrows = $adb->num_rows($result);
if ($numrows && $numrows == 1) {
$fieldid = $adb->query_result($result, 0, "fieldid");
}
$profileId = getRoleRelatedProfileId($current_user->roleid);
if ($profileId > 0) {
$query = "select visible,readonly from ec_profile2field where profileid = {$profileId}\n\t\t\t\t\tand tabid = {$tabid} and fieldid = {$fieldid} ";
$result = $adb->query($query);
$numrows = $adb->num_rows($result);
if ($numrows && $numrows == 1) {
$readonly = $adb->query_result($result, 0, "readonly");
}
}
setSqlCacheData($key, $readonly);
}
if ($readonly == 0) {
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:CheckUpSmowner.php
示例7: insertIntoEntityTable
function insertIntoEntityTable($table_name, $module)
{
global $log;
global $current_user;
$log->debug("Entering into function insertIntoEntityTable()");
if (isset($this->column_fields['createdtime']) && $this->column_fields['createdtime'] != "") {
$createdtime = getDisplayDate_WithTime($this->column_fields['createdtime']);
} else {
$createdtime = date('YmdHis');
}
if (isset($this->column_fields['modifiedtime']) && $this->column_fields['modifiedtime'] != "") {
$modifiedtime = getDisplayDate_WithTime($this->column_fields['modifiedtime']);
} else {
$modifiedtime = date('YmdHis');
}
if (isset($this->column_fields['assigned_user_id']) && $this->column_fields['assigned_user_id'] != '') {
$ownerid = $this->column_fields['assigned_user_id'];
} else {
$ownerid = $current_user->id;
}
$this->column_fields['assigned_user_id'] = $ownerid;
$key = "import_columnnames_" . $module . "_" . $table_name;
$importColumns = getSqlCacheData($key);
if (!$importColumns) {
$importColumns = array();
$tabid = getTabid($module);
$sql = "select fieldname,columnname from ec_field where tabid=" . $tabid . " and tablename='" . $table_name . "' and displaytype in (1,3,4)";
$result = $this->db->query($sql);
$noofrows = $this->db->num_rows($result);
for ($i = 0; $i < $noofrows; $i++) {
$fieldname = $this->db->query_result($result, $i, "fieldname");
$columname = $this->db->query_result($result, $i, "columnname");
$importColumns[$fieldname] = $columname;
}
setSqlCacheData($key, $importColumns);
}
if ($this->mode == 'edit') {
$update = "";
$iCount = 0;
foreach ($importColumns as $fieldname => $columname) {
if (isset($this->column_fields[$fieldname])) {
$fldvalue = trim($this->column_fields[$fieldname]);
$fldvalue = stripslashes($fldvalue);
$fldvalue = $this->db->formatString($table_name, $columname, $fldvalue);
if ($fldvalue != "" && $fldvalue != "NULL" && $fldvalue != "''") {
if ($iCount == 0) {
$update = $columname . "=" . $fldvalue . "";
$iCount = 1;
} else {
$update .= ', ' . $columname . "=" . $fldvalue . "";
}
}
}
}
if (trim($update) != '') {
$sql1 = "update " . $table_name . " set modifiedby='" . $current_user->id . "',modifiedtime=" . $this->db->formatDate($date_var) . "," . $update . " where " . $this->tab_name_index[$table_name] . "=" . $this->id;
$this->db->query($sql1);
}
} else {
$column = $this->tab_name_index[$table_name];
$value = $this->id;
foreach ($importColumns as $fieldname => $columname) {
if (isset($this->column_fields[$fieldname])) {
$fldvalue = trim($this->column_fields[$fieldname]);
$fldvalue = stripslashes($fldvalue);
$fldvalue = $this->db->formatString($table_name, $columname, $fldvalue);
if ($fldvalue != "" && $fldvalue != "NULL" && $fldvalue != "''") {
$column .= ", " . $columname;
$value .= ", " . $fldvalue . "";
}
}
}
$sql1 = "insert into " . $table_name . " (" . $column . ",smcreatorid,smownerid,createdtime,modifiedtime) values(" . $value . ",'" . $current_user->id . "','" . $current_user->id . "'," . $this->db->formatDate($createdtime) . "," . $this->db->formatDate($modifiedtime) . ")";
$this->db->query($sql1);
}
$log->debug("Exiting function insertIntoEntityTable()");
}
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:77,代码来源:ImportSalesorder.php
示例8: getModTabName
/**
* 通过模块名取到当前模块的表名、编号名、id名
*/
function getModTabName($modname)
{
global $log;
$log->debug("Entering getModTabName({$modname}) method ...");
$key = "getModTabName_{$modname}";
$entityname = getSqlCacheData($key);
if (!$entityname) {
global $adb;
$entityname = array();
$query = "select tabid,tablename,fieldname,entityidfield \n\t\t\t\t\tfrom ec_entityname where modulename = '{$modname}' ";
$result = $adb->query($query);
$tabid = $adb->query_result($result, 0, "tabid");
$tablename = $adb->query_result($result, 0, "tablename");
$fieldname = $adb->query_result($result, 0, "fieldname");
$entityidfield = $adb->query_result($result, 0, "entityidfield");
$entityname['tabid'] = $tabid;
$entityname['tablename'] = $tablename;
$entityname['fieldname'] = $fieldname;
$entityname['entityidfield'] = $entityidfield;
setSqlCacheData($key, $entityname);
}
$log->debug("Exiting getModTabName method ...");
return $entityname;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:27,代码来源:CommonUtils.php
示例9: formatString
function formatString($tablename, $fldname, $str)
{
$this->println("ADODB formatString table=" . $tablename . " fldname=" . $fldname . " str=" . $str);
$this->checkConnection();
$key = "tablemetacolumns_" . $tablename;
$metaColumns = getSqlCacheData($key);
if (!$metaColumns) {
$metaColumns = array();
$adoflds = $this->database->MetaColumns($tablename);
if (is_array($adoflds)) {
foreach ($adoflds as $fld) {
$metaColumns[$fld->name] = $fld->type;
}
}
setSqlCacheData($key, $metaColumns);
}
if (is_array($metaColumns) && isset($metaColumns[$fldname])) {
$fldtype = strtoupper($metaColumns[$fldname]);
if (strcmp($fldtype, 'CHAR') == 0 || strcmp($fldtype, 'VARCHAR') == 0 || strcmp($fldtype, 'VARCHAR2') == 0 || strcmp($fldtype, 'LONGTEXT') == 0 || strcmp($fldtype, 'TEXT') == 0) {
//$this->println("ADODB return else normal");
if (empty($str) || $str == 'null' || $str == 'NULL') {
return $this->quote('');
} else {
return $this->database->Quote($str);
}
} else {
if (strcmp($fldtype, 'DATE') == 0 || strcmp($fldtype, 'TIMESTAMP') == 0 || strcmp($fldtype, 'DATETIME') == 0) {
return $this->formatDate($str);
} else {
if ((strcmp($fldtype, 'NUMERIC') == 0 || strcmp($fldtype, 'INT') == 0) && empty($str)) {
return '0';
} else {
//if(empty ($str)) return '';
//else return "'".$str."'";
return "'" . $str . "'";
}
}
}
} else {
return "'" . $str . "'";
}
$this->println("format String Illegal field name " . $fldname);
return $str;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:44,代码来源:PearDatabase.php
示例10: getRelatedLists
/** This function returns the related ec_tab details for a given entity or a module.
* Param $module - module name
* Param $focus - module object
* Return type is an array
*/
function getRelatedLists($module, $focus)
{
global $log;
//changed by dingjianting on 2007-11-05 for php5.2.x
$log->debug("Entering getRelatedLists() method ...");
$focus_list = array();
$relatedLists = array();
global $adb;
$key = "getRelatedLists_" . $module;
$result = getSqlCacheData($key);
if (!$result) {
$cur_tab_id = getTabid($module);
$sql1 = "select ec_relatedlists.*,ec_tab.name as related_tabname from ec_relatedlists left join ec_tab on ec_tab.tabid=ec_relatedlists.related_tabid where ec_relatedlists.tabid=" . $cur_tab_id . " and ec_relatedlists.presence=0 order by sequence";
$result = $adb->query($sql1);
setSqlCacheData($key, $result);
}
$num_row = $adb->num_rows($result);
for ($i = 0; $i < $num_row; $i++) {
$rel_tab_id = $adb->query_result($result, $i, "related_tabid");
$related_tabname = $adb->query_result($result, $i, "related_tabname");
$function_name = $adb->query_result($result, $i, "name");
$label = $adb->query_result($result, $i, "label");
if (method_exists($focus, $function_name)) {
if ($function_name != "get_generalmodules" && $function_name != "get_child_list" && $function_name != "get_parent_list") {
$focus_list[$label] = $focus->{$function_name}($focus->id);
} else {
$focus_list[$label] = $focus->{$function_name}($focus->id, $related_tabname);
}
}
}
/*
$approvehistory=getApproveHistory($focus->id);
if($approvehistory!==false){
$focus_list['审批历史']=$approvehistory;
}
*/
$log->debug("Exiting getRelatedLists method ...");
return $focus_list;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:44,代码来源:DetailViewUtils.php
示例11: getProductFieldLabelList
function getProductFieldLabelList($basemodule)
{
$fieldLabelList = array();
global $log;
//$fieldlist = array("productname","productcode","serialno","unit_price","catalogname");
$log->debug("Entering getProductFieldLabelList() method ...");
$key = "inventory_product_fieldlabellist_" . $basemodule;
$fieldLabelList = getSqlCacheData($key);
if (!$fieldLabelList) {
global $adb;
global $current_language;
$product_mod_strings = return_specified_module_language($current_language, "Products");
$fieldLabelList = array();
$sql = "select ec_productfieldlist.*,ec_field.fieldlabel from ec_productfieldlist inner join ec_field on ec_field.columnname=ec_productfieldlist.fieldname where ec_productfieldlist.module='" . $basemodule . "' and ec_field.tabid=14 order by ec_productfieldlist.id";
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
for ($i = 0; $i < $noofrows; $i++) {
$fieldarr = array();
//$fieldname = $adb->query_result($result,$i,"fieldname");
//if($fieldname == "catalogid") $fieldname = "catalogname";
//elseif($fieldname == "vendor_id") $fieldname = "vendorname";
$fieldlabel = $adb->query_result($result, $i, "fieldlabel");
if (isset($product_mod_strings[$fieldlabel])) {
$fieldlabel = $product_mod_strings[$fieldlabel];
}
$width = $adb->query_result($result, $i, "width");
$fieldarr["LABEL"] = $fieldlabel;
$fieldarr["LABEL_WIDTH"] = $width;
$fieldLabelList[] = $fieldarr;
unset($fieldarr);
}
setSqlCacheData($key, $fieldLabelList);
}
$log->debug("Exiting getProductFieldLabelList method ...");
return $fieldLabelList;
}
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:36,代码来源:CommonUtils.php
示例12: array
$tree = array();
$tree["treeid"] = $colvalue;
$tree["treename"] = $colvalue;
$tree["click"] = "search_field={$entityname['tablename']}.{$columnname}&\n\t\t\t\t\t\t\t\t\t\t\tsearch_text={$colvalue}&sortview={$sortview}";
$tree["treeparent"] = $fieldid;
$treeproj[] = $tree;
}
}
}
}
setSqlCacheData($key, $treeproj);
}
} else {
if ($sortview == 'view_area') {
$key = "view_area_{$modname}_" . $current_user->id;
$treeproj = getSqlCacheData($key);
if (!$treeproj) {
$query = "select actualfieldid,actualfieldname,parentfieldid,thelevel \n\t\t\t\t\tfrom ec_bill_country where actualfieldname not in ('нч') \n\t\t\t\tand actualfieldid not in (408,409,410) order by sortorderid ";
$result = $adb->getList($query);
$numrows = $adb->num_rows($result);
$treeproj = array();
if ($numrows && $numrows > 0) {
for ($i = 0; $i < $numrows; $i++) {
$actualfieldid = $adb->query_result($result, $i, "actualfieldid");
$actualfieldname = $adb->query_result($result, $i, "actualfieldname");
$parentfieldid = $adb->query_result($result, $i, "parentfieldid");
$thelevel = $adb->query_result($result, $i, "thelevel");
if ($actualfieldname == 'нч') {
continue;
}
if ($parentfieldid == '0') {
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:sortviewBindAjax.php
示例13: getPermittedModuleNames
/** Function to get the permitted module name Array with presence as 0
* @returns permitted module name Array :: Type Array
*
*/
function getPermittedModuleNames()
{
global $log;
$log->debug("Entering getPermittedModuleNames() method ...");
$permittedModules = array();
$key = "moduletabseqlist";
$tab_seq_array = getSqlCacheData($key);
if (!$tab_seq_array) {
global $adb;
$sql = "select * from ec_tab order by tabid";
$result = $adb->query($sql);
$num_rows = $adb->num_rows($result);
$tab_seq_array = array();
for ($i = 0; $i < $num_rows; $i++) {
$id = $adb->query_result($result, $i, 'tabid');
$presence = $adb->query_result($result, $i, 'presence');
$tab_seq_array[$id] = $presence;
}
setSqlCacheData($key, $tab_seq_array);
}
foreach ($tab_seq_array as $tabid => $seq_value) {
if ($seq_value == 0) {
$permittedModules[] = getTabModuleName($tabid);
}
}
$log->debug("Exiting getPermittedModuleNames method ...");
return $permittedModules;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:32,代码来源:UserInfoUtil.php
示例14: getActionname
/** Function to get a action for a given action id
* @param $action id -- action id :: Type integer
* @returns $actionname-- action name :: Type string
*/
function getActionname($actionid)
{
global $log;
$log->debug("Entering getActionname() method ...");
global $adb;
$curactionname = '';
$key = "actionnamelist";
$actionnamelist = getSqlCacheData($key);
if (!$actionnamelist) {
global $adb;
$sql = "select * from ec_actionmapping where securitycheck=0";
$result = $adb->query($sql);
$actionnamelist = array();
$noofrows = $adb->num_rows($result);
for ($i = 0; $i < $noofrows; $i++) {
$name = $adb->query_result($result, $i, "actionname");
$id = $adb->query_result($result, $i, "actionid");
$actionnamelist[$id] = $name;
}
setSqlCacheData($key, $actionnamelist);
}
if (isset($actionnamelist[$actionid])) {
$curactionname = $actionnamelist[$actionid];
}
$log->debug("Exiting getActionname method ...");
return $curactionname;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:utils.php
示例15: getMultiFieldEditViewValue
function getMultiFieldEditViewValue($multifieldid, $uitype, $col_fields)
{
global $adb;
if ($uitype == '1021') {
$level = 1;
} elseif ($uitype == '1022') {
$level = 2;
} elseif ($uitype == '1023') {
$level = 3;
}
$multifieldinfo = getMultiFieldInfo($multifieldid);
$totallevel = $multifieldinfo["totallevel"];
$tablename = $multifieldinfo["tablename"];
if ($level == 1) {
$pick_query = "select * from {$tablename} where thelevel=1 order by sortorderid";
$parentid = 0;
} elseif ($level == 2) {
$parentlabel = $multifieldinfo["fields"][0]["fieldname"];
$parentval = $col_fields[$parentlabel];
$parentid = getActualFieldID($level, $tablename, $parentval);
$pick_query = "select * from {$tablename} where thelevel=2 and parentfieldid={$parentid} order by sortorderid";
} elseif ($level == 3) {
$toplabel = $multifieldinfo["fields"][0]["fieldname"];
$topval = $col_fields[$toplabel];
$parentlabel = $multifieldinfo["fields"][1]["fieldname"];
$parentval = $col_fields[$parentlabel];
$parentid = getActualFieldID($level, $tablename, $parentval, $topval);
$pick_query = "select * from {$tablename} where thelevel=3 and parentfieldid={$parentid} order by sortorderid";
}
$key = "MultiFieldPickArray_" . $multifieldid . "_{$level}_{$parentid}";
$picklist_array = getSqlCacheData($key);
if (!$picklist_array) {
$pickListResult = $adb->getList($pick_query);
$picklist_array = array();
foreach ($pickListResult as $row) {
$picklist_array[] = array($row['actualfieldid'], $row['actualfieldname']);
}
setSqlCacheData($key, $picklist_array);
}
$options = array();
$found = false;
$thislabel = $multifieldinfo["fields"][$level - 1]["fieldname"];
$value = $col_fields[$thislabel];
foreach ($picklist_array as &$pickListValue) {
if ($value == $pickListValue[1]) {
$chk_val = "selected";
$found = true;
} else {
$chk_val = '';
}
$pickListValue[2] = $chk_val;
$options[] = $pickListValue;
}
// print_r($options);
return $options;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:56,代码来源:MultiFieldUtils.php
示例16: getNewCvColumnListSQL
function getNewCvColumnListSQL($cvid)
{
global $adb;
$key = "entityname_fieldlist";
$entitylist = getSqlCacheData($key);
if (!$entitylist) {
$entitylist = array();
$sql = "select * from ec_entityname";
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
if ($noofrows > 0) {
for ($i = 0; $i < $noofrows; $i++) {
$tablename = $adb->query_result($result, $i, "tablename");
$fieldname = $adb->query_result($result, $i, "fieldname");
$entityidfield = $adb->query_result($result, $i, "entityidfield");
$tabid = $adb->query_result($result, $i, "tabid");
$modulename = $adb->query_result($result, $i, "modulename");
$entitylist[$entityidfield] = array('tablename' => $tablename, 'fieldname' => $fieldname, 'tabid' => $tabid, 'modulename' => $modulename);
}
setSqlCacheData($key, $entitylist);
}
}
$columnslist = $this->getColumnsListByCvid($cvid);
if (isset($columnslist)) {
foreach ($columnslist as $columnname => $value) {
$tablefield = "";
if ($value != "") {
$list = explode(":", $value);
//Added For getting status for Activities -Jaguar
$sqllist_column = $list[0] . "." . $list[1];
if ($this->Fenzumodule == "Calendar") {
if ($list[1] == "status") {
$sqllist_column = "case when (ec_activity.status not like '') then ec_activity.status else ec_activity.eventstatus end as activitystatus";
}
}
//Added for for assigned to sorting
if ($list[1] == "smownerid") {
$sqllist_column = "ec_users.user_name as assigned_user_id";
$sqllist[] = $sqllist_column;
} else {
if (strlen($list[1]) > 3) {
//$sqllist[] = $sqllist_column;
$moduleid = $list[1];
$postfix = substr($moduleid, -3, 3);
if ($postfix == "_id") {
$moduleid = substr($moduleid, 0, strlen($moduleid) - 3);
$moduleid = $moduleid . "id";
if (isset($entitylist[$moduleid])) {
$tablename = $entitylist[$moduleid]["tablename"];
$fieldname = $entitylist[$moduleid]["fieldname"];
$sqllist_column = $tablename . "." . $fieldname;
}
}
}
$sqllist[] = $sqllist_column . " as " . $list[2];
}
//Ends
$tablefield[$list[0]] = $list[1];
$fieldlabel = trim(str_replace($this->escapemodule, " ", $list[3]));
$this->list_fields[$fieldlabel] = $tablefield;
$this->list_fields_name[$fieldlabel] = $list[2];
}
}
$returnsql = implode(",", $sqllist);
}
return $returnsql;
}
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:67,代码来源:Fenzu.php
示例17: getAdvSearchfields
function getAdvSearchfields($module, $column = '')
{
global $log;
$log->debug("Entering getAdvSearchfields(" . $module . ") method ...");
global $current_user;
//changed by dingjianting on 2007-10-3 for cache HeaderArray
$key = "OPTION_SET_" . $module . "_" . $column;
$OPTION_SET = getSqlCacheData($key);
if (!$OPTION_SET) {
global $adb;
global $mod_strings;
$tabid = getTabid($module);
//changed by dingjianting on 2007-9-5 for search function need not hidden fields
$sql = "select * from ec_field inner join ec_def_org_field on ec_def_org_field.fieldid=ec_field.fieldid";
$sql .= " where ec_def_org_field.visible=0 and ec_field.tabid=" . $tabid . " and";
$sql .= " ec_field.displaytype in (1,2)";
$sql .= " order by block,sequence";
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
$block = '';
for ($i = 0; $i < $noofrows; $i++) {
$fieldtablename = $adb->query_result($result, $i, "tablename");
$fieldcolname = $adb->query_result($result, $i, "columnname");
$block = $adb->query_result($result, $i, "block");
$fieldtype = $adb->query_result($result, $i, "typeofdata");
$fieldtype = explode("~", $fieldtype);
$fieldtypeofdata = $fieldtype[0];
$fieldlabel = $adb->query_result($result, $i, "fieldlabel");
if ($fieldlabel == "Related To") {
$fieldlabel = "Related to";
}
if ($fieldlabel == "Start Date & Time") {
$fieldlabel = "Start Date";
if ($module == 'Calendar' && $block == 19) {
$module_columnlist['ec_activity:time_start::Activities_Start Time:I'] = 'Start Time';
}
}
//changed by dingjianting on 2006-10-11 for advanced search
//$fieldlabel = str_replace(" ","_",$fieldlabel);
if (isset($mod_strings[$fieldlabel])) {
$fieldlabel = $mod_strings[$fieldlabel];
}
if ($fieldlabel != 'Related to') {
if ($column == $fieldtablename . "." . $fieldcolname) {
$OPTION_SET .= "<option value=\\'" . $fieldtablename . "." . $fieldcolname . "\\' selected>" . $fieldlabel . "</option>";
} elseif ($fieldlabel == "Product Code") {
$OPTION_SET .= "<option value=\\'" . $fieldtablename . "." . $fieldcolname . "\\'>" . $mod_strings[$fieldlabel] . "</option>";
} else {
$OPTION_SET .= "<option value=\\'" . $fieldtablename . "." . $fieldcolname . "\\'>" . $fieldlabel . "</option>";
}
}
}
setSqlCacheData($key, $OPTION_SET);
}
$log->debug("Exiting getAdvSearchfields method ...");
return $OPTION_SET;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:57,代码来源:SearchUtils.php
示例18: getSearchListViewEntries
|
请发表评论