当前位置: 首页>>代码示例>>PHP>>正文


PHP getFullNameFromQResult函数代码示例

本文整理汇总了PHP中getFullNameFromQResult函数的典型用法代码示例。如果您正苦于以下问题:PHP getFullNameFromQResult函数的具体用法?PHP getFullNameFromQResult怎么用?PHP getFullNameFromQResult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getFullNameFromQResult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cp_getUsers

function cp_getUsers()
{
    global $adb;
    $res = $adb->query("SELECT id,user_name,last_name,first_name from vtiger_users WHERE status='Active'");
    $norows = $adb->num_rows($res);
    $users = array();
    for ($i = 0; $i < $norows; $i++) {
        $users[$i]['id'] = $adb->query_result($res, $i, 'id');
        $users[$i]['name'] = getFullNameFromQResult($res, $i, 'Users');
    }
    return $users;
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:12,代码来源:PortalUtils.php

示例2: getOtherUserName

/**
 * To get userid and username of all vtiger_users except the current user
 * @param $id -- The user id :: Type integer
 * @returns $user_details -- Array in the following format:
 * $user_details=Array($userid1=>$username, $userid2=>$username,............,$useridn=>$username);
 */
function getOtherUserName($id)
{
    global $adb;
    $user_details = array();
    $query = "select * from vtiger_users where deleted=0 and status='Active' and id!=?";
    $result = $adb->pquery($query, array($id));
    $num_rows = $adb->num_rows($result);
    for ($i = 0; $i < $num_rows; $i++) {
        $userid = $adb->query_result($result, $i, 'id');
        $username = getFullNameFromQResult($result, $i, 'Users');
        $user_details[$userid] = $username;
    }
    return $user_details;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:20,代码来源:CalendarCommon.php

示例3: getAllUserName

/** Function to get userid and username of all vtiger_users
 * @returns $userArray -- User Array in the following format:
 * $userArray=Array($userid1=>$username, $userid2=>$username,............,$useridn=>$username);
 */
function getAllUserName()
{
    $log = vglobal('log');
    $log->debug("Entering getAllUserName() method ...");
    $adb = PearDatabase::getInstance();
    $query = "select * from vtiger_users where deleted=0";
    $result = $adb->pquery($query, array());
    $num_rows = $adb->num_rows($result);
    $user_details = array();
    for ($i = 0; $i < $num_rows; $i++) {
        $userid = $adb->query_result($result, $i, 'id');
        $username = getFullNameFromQResult($result, $i, 'Users');
        $user_details[$userid] = $username;
    }
    $log->debug("Exiting getAllUserName method ...");
    return $user_details;
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:21,代码来源:UserInfoUtil.php

示例4: getRelatedTo

function getRelatedTo($module, $list_result, $rset)
{
    global $adb, $log, $app_strings;
    $tabname = getParentTab();
    if ($module == "Documents") {
        $notesid = $adb->query_result($list_result, $rset, "notesid");
        $action = "DetailView";
        $evt_query = "SELECT vtiger_senotesrel.crmid, vtiger_crmentity.setype\n\t\t\t\t\tFROM vtiger_senotesrel\n\t\t\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\t\tON  vtiger_senotesrel.crmid = vtiger_crmentity.crmid\n\t\t\t\tWHERE vtiger_senotesrel.notesid = ?";
        $params = array($notesid);
    } else {
        if ($module == "Products") {
            $productid = $adb->query_result($list_result, $rset, "productid");
            $action = "DetailView";
            $evt_query = "SELECT vtiger_seproductsrel.crmid, vtiger_crmentity.setype\n\t\t\t\t\tFROM vtiger_seproductsrel\n\t\t\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\t\tON vtiger_seproductsrel.crmid = vtiger_crmentity.crmid\n\t\t\t\t\tWHERE vtiger_seproductsrel.productid =?";
            $params = array($productid);
        } else {
            $activity_id = $adb->query_result($list_result, $rset, "activityid");
            $action = "DetailView";
            $evt_query = "SELECT vtiger_seactivityrel.crmid, vtiger_crmentity.setype\n\t\t\tFROM vtiger_seactivityrel\n\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\tON  vtiger_seactivityrel.crmid = vtiger_crmentity.crmid\n\t\t\tWHERE vtiger_seactivityrel.activityid=?";
            $params = array($activity_id);
            if ($module == 'HelpDesk') {
                $activity_id = $adb->query_result($list_result, $rset, "parent_id");
                if ($activity_id != '') {
                    $evt_query = "SELECT crmid, setype FROM vtiger_crmentity WHERE crmid=?";
                    $params = array($activity_id);
                }
            }
        }
    }
    //added by raju to change the related to in emails inot multiple if email is for more than one contact
    $evt_result = $adb->pquery($evt_query, $params);
    $numrows = $adb->num_rows($evt_result);
    $parent_module = $adb->query_result($evt_result, 0, 'setype');
    $parent_id = $adb->query_result($evt_result, 0, 'crmid');
    if ($numrows > 1) {
        $parent_module = 'Multiple';
        $parent_name = $app_strings['LBL_MULTIPLE'];
    }
    //Raju -- Ends
    if ($module == 'HelpDesk' && ($parent_module == 'Accounts' || $parent_module == 'Contacts')) {
        global $theme;
        $module_icon = '<img src="themes/images/' . $parent_module . '.gif" alt="' . $app_strings[$parent_module] . '" title="' . $app_strings[$parent_module] . '" border=0 align=center> ';
    }
    $action = "DetailView";
    if ($parent_module == 'Accounts') {
        $parent_query = "SELECT accountname FROM vtiger_account WHERE accountid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = textlength_check($adb->query_result($parent_result, 0, "accountname"));
    }
    if ($parent_module == 'Leads') {
        $parent_query = "SELECT firstname,lastname FROM vtiger_leaddetails WHERE leadid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = getFullNameFromQResult($parent_result, 0, "Leads");
    }
    if ($parent_module == 'Potentials') {
        $parent_query = "SELECT potentialname FROM vtiger_potential WHERE potentialid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = textlength_check($adb->query_result($parent_result, 0, "potentialname"));
    }
    if ($parent_module == 'Products') {
        $parent_query = "SELECT productname FROM vtiger_products WHERE productid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "productname");
    }
    if ($parent_module == 'Quotes') {
        $parent_query = "SELECT subject FROM vtiger_quotes WHERE quoteid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'PurchaseOrder') {
        $parent_query = "SELECT subject FROM vtiger_purchaseorder WHERE purchaseorderid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'Invoice') {
        $parent_query = "SELECT subject FROM vtiger_invoice WHERE invoiceid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'SalesOrder') {
        $parent_query = "SELECT subject FROM vtiger_salesorder WHERE salesorderid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'Contacts' && ($module == 'Emails' || $module == 'HelpDesk')) {
        $parent_query = "SELECT firstname,lastname FROM vtiger_contactdetails WHERE contactid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = getFullNameFromQResult($parent_result, 0, "Contacts");
    }
    if ($parent_module == 'Vendors' && $module == 'Emails') {
        $parent_query = "SELECT vendorname FROM vtiger_vendor WHERE vendorid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "vendorname");
    }
    if ($parent_module == 'HelpDesk') {
        $parent_query = "SELECT title FROM vtiger_troubletickets WHERE ticketid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "title");
        //if(strlen($parent_name) > 25)
        //{
//.........这里部分代码省略.........
开发者ID:latechdirect,项目名称:vtiger,代码行数:101,代码来源:ListViewUtils.php

示例5: array_merge

 $rows = $adb->num_rows($res);
 if ($rows > 0) {
     $recurringObject = RecurringType::fromDBRequest($adb->query_result_rowdata($res, 0));
     $recurringInfoDisplayData = $recurringObject->getDisplayRecurringInfo();
     $data = array_merge($data, $recurringInfoDisplayData);
 } else {
     $data['recurringcheck'] = getTranslatedString('LBL_NO', $currentModule);
     $data['repeat_str'] = '';
 }
 $sql = 'select vtiger_users.*,vtiger_invitees.* from vtiger_invitees left join vtiger_users on vtiger_invitees.inviteeid=vtiger_users.id where activityid=?';
 $result = $adb->pquery($sql, array($focus->id));
 $num_rows = $adb->num_rows($result);
 $invited_users = array();
 for ($i = 0; $i < $num_rows; $i++) {
     $userid = $adb->query_result($result, $i, 'inviteeid');
     $username = getFullNameFromQResult($result, $i, 'Users');
     $invited_users[$userid] = $username;
 }
 $smarty->assign("INVITEDUSERS", $invited_users);
 $related_array = getRelatedListsInformation("Calendar", $focus);
 $fieldsname = $related_array['Contacts']['header'];
 $contact_info = $related_array['Contacts']['entries'];
 $entityIds = array_keys($contact_info);
 $displayValueArray = getEntityName('Contacts', $entityIds);
 $entityname = array();
 if (!empty($displayValueArray)) {
     foreach ($displayValueArray as $key => $field_value) {
         $entityname[$key] = '<a href="index.php?module=Contacts&action=DetailView&record=' . $key . '">' . $field_value . '</a>';
     }
 }
 $smarty->assign("CONTACTS", $entityname);
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:EventDetailView.php

示例6: getSearchingListViewEntries


//.........这里部分代码省略.........
                            if ($adb->num_rows($cal_res) >= 0) {
                                $activitytype = $adb->query_result($cal_res, 0, "activitytype");
                            }
                        }
                        if (($module == 'Calendar' || $module == 'Emails' || $module == 'HelpDesk' || $module == 'Invoice' || $module == 'Leads' || $module == 'Contacts') && ($fieldname == 'parent_id' || $name == 'Contact Name' || $name == 'Close' || $fieldname == 'firstname')) {
                            if ($module == 'Calendar') {
                                if ($fieldname == 'status') {
                                    if ($activitytype == 'Task') {
                                        $fieldname = 'taskstatus';
                                    } else {
                                        $fieldname = 'eventstatus';
                                    }
                                }
                                if ($activitytype == 'Task') {
                                    if (getFieldVisibilityPermission('Calendar', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                } else {
                                    if (getFieldVisibilityPermission('Events', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                }
                            }
                            if ($module != 'Calendar' || $module == 'Calendar' && $has_permission == 'yes') {
                                if ($fieldname == 'parent_id') {
                                    $value = getRelatedTo($module, $list_result, $i - 1);
                                }
                                if ($name == 'Contact Name') {
                                    $contact_id = $adb->query_result($list_result, $i - 1, "contactid");
                                    $contact_name = getFullNameFromQResult($list_result, $i - 1, "Contacts");
                                    $value = "";
                                    //Added to get the contactname for activities custom view - t=2190
                                    if ($contact_id != '' && !empty($contact_name)) {
                                        $contact_name = getContactName($contact_id);
                                    }
                                    if ($contact_name != "" && $contact_id != 'NULL') {
                                        $value = $contact_name;
                                    }
                                }
                                if ($fieldname == "firstname") {
                                    $first_name = textlength_check($adb->query_result($list_result, $i - 1, "firstname"));
                                    $value = $first_name;
                                }
                                if ($name == 'Close') {
                                    $status = $adb->query_result($list_result, $i - 1, "status");
                                    $activityid = $adb->query_result($list_result, $i - 1, "activityid");
                                    if (empty($activityid)) {
                                        $activityid = $adb->query_result($list_result, $i - 1, "tmp_activity_id");
                                    }
                                    $activitytype = $adb->query_result($list_result, $i - 1, "activitytype");
                                    // TODO - Picking activitytype when it is not present in the Custom View.
                                    // Going forward, this column should be added to the select list if not already present as a performance improvement.
                                    if (empty($activitytype)) {
                                        $activitytypeRes = $adb->pquery('SELECT activitytype FROM vtiger_activity WHERE activityid=?', array($activityid));
                                        if ($adb->num_rows($activitytypeRes) > 0) {
                                            $activitytype = $adb->query_result($activitytypeRes, 0, 'activitytype');
                                        }
                                    }
                                    if ($activitytype != 'Task' && $activitytype != 'Emails') {
                                        $eventstatus = $adb->query_result($list_result, $i - 1, "eventstatus");
                                        if (isset($eventstatus)) {
                                            $status = $eventstatus;
开发者ID:kikojover,项目名称:corebos,代码行数:67,代码来源:CustomerPortalWS.php

示例7: setMailerProperties

/**	Function to set all the Mailer properties
  *	$mail		-- reference of the mail object
  *	$subject	-- subject of the email you want to send
  *	$contents	-- body of the email you want to send
  *	$from_email	-- from email id which will be displayed in the mail
  *	$from_name	-- from name which will be displayed in the mail
  *	$to_email	-- to email address  -- This can be an email in a single string, a comma separated
  *			   list of emails or an array of email addresses
  *	$attachment	-- whether we want to attach the currently selected file or all files.
  				[values = current,all] - optional
  *	$emailid	-- id of the email object which will be used to get the vtiger_attachments - optional
  */
function setMailerProperties($mail, $subject, $contents, $from_email, $from_name, $to_email, $attachment = '', $emailid = '', $module = '', $logo = '')
{
    global $adb;
    $adb->println("Inside the function setMailerProperties");
    if ($module == "Support" || $logo == 1) {
        $mail->AddEmbeddedImage('themes/images/logo_mail.jpg', 'logo', 'logo.jpg', "base64", "image/jpg");
    }
    $mail->Subject = $subject;
    $mail->Body = $contents;
    //$mail->Body = html_entity_decode(nl2br($contents));	//if we get html tags in mail then we will use this line
    $mail->AltBody = strip_tags(preg_replace(array("/<p>/i", "/<br>/i", "/<br \\/>/i"), array("\n", "\n", "\n"), $contents));
    $mail->IsSMTP();
    //set mailer to use SMTP
    //$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
    setMailServerProperties($mail);
    //Handle the from name and email for HelpDesk
    $mail->From = $from_email;
    $rs = $adb->pquery("select first_name,last_name from vtiger_users where user_name=?", array($from_name));
    $num_rows = $adb->num_rows($rs);
    if ($num_rows > 0) {
        $from_name = getFullNameFromQResult($rs, 0, 'Users');
    }
    $mail->FromName = decode_html($from_name);
    $mail->Sender = getReturnPath($mail->Host, $from_email);
    if ($to_email != '') {
        if (is_array($to_email)) {
            for ($j = 0, $num = count($to_email); $j < $num; $j++) {
                $mail->addAddress($to_email[$j]);
            }
        } else {
            $_tmp = explode(",", $to_email);
            for ($j = 0, $num = count($_tmp); $j < $num; $j++) {
                $mail->addAddress($_tmp[$j]);
            }
        }
    }
    //commented so that it does not add from_email in reply to
    //$mail->AddReplyTo($from_email);
    $mail->WordWrap = 50;
    //If we want to add the currently selected file only then we will use the following function
    if ($attachment == 'current' && $emailid != '') {
        if (isset($_REQUEST['filename_hidden'])) {
            $file_name = $_REQUEST['filename_hidden'];
        } else {
            $file_name = $_FILES['filename']['name'];
        }
        addAttachment($mail, $file_name, $emailid);
    }
    //This will add all the files which are related to this record or email
    if ($attachment == 'all' && $emailid != '') {
        addAllAttachments($mail, $emailid);
    }
    //If we send attachments from Reports
    if ($attachment == 'attReports') {
        if (isset($_REQUEST['filename_hidden_pdf'])) {
            $file_name = $_REQUEST['filename_hidden_pdf'];
            addAttachment($mail, $file_name, $emailid);
        }
        if (isset($_REQUEST['filename_hidden_xls'])) {
            $file_name = $_REQUEST['filename_hidden_xls'];
            addAttachment($mail, $file_name, $emailid);
        }
    }
    $mail->IsHTML(true);
    // set email format to HTML
    $mail->AllowEmpty = true;
    //allow sent empty body.
    return;
}
开发者ID:kduqi,项目名称:corebos,代码行数:81,代码来源:mail.php

示例8: setMailerProperties

/**	Function to set all the Mailer properties
  *	$mail 		-- reference of the mail object
  *	$subject	-- subject of the email you want to send
  *	$contents	-- body of the email you want to send
  *	$from_email	-- from email id which will be displayed in the mail
  *	$from_name	-- from name which will be displayed in the mail
  *	$to_email 	-- to email address  -- This can be an email in a single string, a comma separated
  *			   list of emails or an array of email addresses
  *	$attachment	-- whether we want to attach the currently selected file or all vtiger_files.
  				[values = current,all] - optional
  *	$emailid	-- id of the email object which will be used to get the vtiger_attachments - optional
  */
function setMailerProperties($mail, $subject, $contents, $from_email, $from_name, $to_email, $attachment = '', $emailid = '', $module = '', $logo = '')
{
    $adb = PearDatabase::getInstance();
    $adb->println("Inside the function setMailerProperties");
    $CompanyDetails = getCompanyDetails();
    $logourl = 'storage/Logo/' . $CompanyDetails['logoname'];
    if ($logo == 1) {
        $image = getimagesize($logourl);
        $mail->AddEmbeddedImage($logourl, 'logo', $CompanyDetails['logoname'], "base64", $image['mime']);
    }
    $mail->Subject = $subject;
    //Added back as we have changed php mailer library, older library was using html_entity_decode before sending mail
    $mail->Body = decode_html($contents);
    //$mail->Body = html_entity_decode(nl2br($contents));	//if we get html tags in mail then we will use this line
    $mail->AltBody = strip_tags(preg_replace(array("/<p>/i", "/<br>/i", "/<br \\/>/i"), array("\n", "\n", "\n"), $contents));
    $mail->IsSMTP();
    //set mailer to use SMTP
    //$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
    setMailServerProperties($mail);
    //Handle the from name and email for HelpDesk
    $mail->From = $from_email;
    $userFullName = trim(VTCacheUtils::getUserFullName($from_name));
    if (empty($userFullName)) {
        $rs = $adb->pquery("select first_name,last_name from vtiger_users where user_name=?", array($from_name));
        $num_rows = $adb->num_rows($rs);
        if ($num_rows > 0) {
            $fullName = getFullNameFromQResult($rs, 0, 'Users');
            VTCacheUtils::setUserFullName($from_name, $fullName);
        }
    } else {
        $from_name = $userFullName;
    }
    $mail->FromName = decode_html($from_name);
    if ($to_email != '') {
        if (is_array($to_email)) {
            for ($j = 0, $num = count($to_email); $j < $num; $j++) {
                $mail->addAddress($to_email[$j]);
            }
        } else {
            $_tmp = explode(",", $to_email);
            for ($j = 0, $num = count($_tmp); $j < $num; $j++) {
                $mail->addAddress($_tmp[$j]);
            }
        }
    }
    //commented so that it does not add from_email in reply to
    //$mail->AddReplyTo($from_email);
    $mail->WordWrap = 50;
    //If we want to add the currently selected file only then we will use the following function
    if ($attachment == 'current' && $emailid != '') {
        if (isset($_REQUEST['filename_hidden'])) {
            $file_name = $_REQUEST['filename_hidden'];
        } else {
            $file_name = $_FILES['filename']['name'];
        }
        addAttachment($mail, $file_name, $emailid);
    }
    //This will add all the vtiger_files which are related to this record or email
    if ($attachment == 'all' && $emailid != '') {
        addAllAttachments($mail, $emailid);
    }
    $mail->IsHTML(true);
    // set email format to HTML
    return;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:77,代码来源:mail.php

示例9: getListViewEntries2


//.........这里部分代码省略.........
                            if ($adb->num_rows($cal_res) >= 0) {
                                $activitytype = $adb->query_result($cal_res, 0, "activitytype");
                            }
                        }
                        if (($module == 'Calendar' || $module == 'Emails' || $module == 'HelpDesk' || $module == 'Invoice' || $module == 'Leads' || $module == 'Contacts') && ($fieldname == 'parent_id' || $name == 'Contact Name' || $name == 'Close' || $fieldname == 'firstname')) {
                            if ($module == 'Calendar') {
                                if ($fieldname == 'status') {
                                    if ($activitytype == 'Task') {
                                        $fieldname = 'taskstatus';
                                    } else {
                                        $fieldname = 'eventstatus';
                                    }
                                }
                                if ($activitytype == 'Task') {
                                    if (getFieldVisibilityPermission('Calendar', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                } else {
                                    if (getFieldVisibilityPermission('Events', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                }
                            }
                            if ($module != 'Calendar' || $module == 'Calendar' && $has_permission == 'yes') {
                                if ($fieldname == 'parent_id') {
                                    $value = getRelatedTo($module, $list_result, $i - 1);
                                }
                                if ($name == 'Contact Name') {
                                    $contact_id = $adb->query_result($list_result, $i - 1, "contactid");
                                    $contact_name = getFullNameFromQResult($list_result, $i - 1, "Contacts");
                                    $value = "";
                                    //Added to get the contactname for activities custom view - t=2190
                                    if ($contact_id != '' && !empty($contact_name)) {
                                        $contact_name = getContactName($contact_id);
                                    }
                                    if ($contact_name != "" && $contact_id != 'NULL') {
                                        // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
                                        $value = "<a href='index.php?module=Contacts&action=DetailView&parenttab=" . $tabname . "&record=" . $contact_id . "' style='" . $P_FONT_COLOR . "'>" . $contact_name . "</a>";
                                        // Armando Lüscher 05.07.2005 -> §priority -> Desc: inserted style="$P_FONT_COLOR"
                                    }
                                }
                                if ($fieldname == "firstname") {
                                    $first_name = textlength_check($adb->query_result($list_result, $i - 1, "firstname"));
                                    $value = '<a href="index.php?action=DetailView&module=' . $module . '&parenttab=' . $tabname . '&record=' . $entity_id . '">' . $first_name . '</a>';
                                }
                                if ($name == 'Close') {
                                    $status = $adb->query_result($list_result, $i - 1, "status");
                                    $activityid = $adb->query_result($list_result, $i - 1, "activityid");
                                    if (empty($activityid)) {
                                        $activityid = $adb->query_result($list_result, $i - 1, "tmp_activity_id");
                                    }
                                    $activitytype = $adb->query_result($list_result, $i - 1, "activitytype");
                                    // TODO - Picking activitytype when it is not present in the Custom View.
                                    // Going forward, this column should be added to the select list if not already present as a performance improvement.
                                    if (empty($activitytype)) {
                                        $activitytypeRes = $adb->pquery('SELECT activitytype FROM vtiger_activity WHERE activityid=?', array($activityid));
                                        if ($adb->num_rows($activitytypeRes) > 0) {
                                            $activitytype = $adb->query_result($activitytypeRes, 0, 'activitytype');
                                        }
                                    }
                                    if ($activitytype != 'Task' && $activitytype != 'Emails') {
                                        $eventstatus = $adb->query_result($list_result, $i - 1, "eventstatus");
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:67,代码来源:ListViewUtils2.php

示例10: getITSUserFullName

function getITSUserFullName($id)
{
    global $adb;
    $u_query = "select * from vtiger_users where id=?";
    $u_result = $adb->pquery($u_query, array($id));
    return trim(getFullNameFromQResult($u_result, 0, 'Users'));
}
开发者ID:kduqi,项目名称:corebos,代码行数:7,代码来源:event_settings.php

示例11: getOutputHtml


//.........这里部分代码省略.........
                        $querystr = 'select columnname from vtiger_field where fieldid=? and vtiger_field.presence in (0,2)';
                        $result = $adb->pquery($querystr, array($realid[$j]));
                        $temp = $adb->query_result($result, 0, 'columnname');
                        $temp1 = br2nl($myfocus->column_fields[$temp]);
                        //Modified to display the entities in red which don't have email id
                        if (!empty($temp_parent_name) && strlen($temp_parent_name) > 150) {
                            $parent_name .= '<br>';
                            $temp_parent_name = '';
                        }
                        if ($temp1 != '') {
                            $parent_name .= $fullname . '&lt;' . $temp1 . '&gt;; ';
                            $temp_parent_name .= $fullname . '&lt;' . $temp1 . '&gt;; ';
                        } else {
                            $parent_name .= "<b style='color:red'>" . $fullname . '&lt;' . $temp1 . '&gt;; ' . "</b>";
                            $temp_parent_name .= "<b style='color:red'>" . $fullname . '&lt;' . $temp1 . '&gt;; ' . "</b>";
                        }
                    }
                }
            } else {
                if ($_REQUEST['record'] != '' && $_REQUEST['record'] != NULL) {
                    $parent_name = '';
                    $parent_id = '';
                    $myemailid = $_REQUEST['record'];
                    $mysql = "select crmid from vtiger_seactivityrel where activityid=?";
                    $myresult = $adb->pquery($mysql, array($myemailid));
                    $mycount = $adb->num_rows($myresult);
                    if ($mycount > 0) {
                        for ($i = 0; $i < $mycount; $i++) {
                            $mycrmid = $adb->query_result($myresult, $i, 'crmid');
                            $parent_module = getSalesEntityType($mycrmid);
                            if ($parent_module == "Leads") {
                                $sql = "select firstname,lastname,email from vtiger_leaddetails where leadid=?";
                                $result = $adb->pquery($sql, array($mycrmid));
                                $full_name = getFullNameFromQResult($result, 0, "Leads");
                                $myemail = $adb->query_result($result, 0, "email");
                                $parent_id .= $mycrmid . '@0|';
                                //make it such that the email adress sent is remebered and only that one is retrived
                                $parent_name .= $full_name . '<' . $myemail . '>; ';
                                $lead_selected = 'selected';
                            } elseif ($parent_module == "Contacts") {
                                $sql = "select * from vtiger_contactdetails where contactid=?";
                                $result = $adb->pquery($sql, array($mycrmid));
                                $full_name = getFullNameFromQResult($result, 0, "Contacts");
                                $myemail = $adb->query_result($result, 0, "email");
                                $parent_id .= $mycrmid . '@0|';
                                //make it such that the email adress sent is remebered and only that one is retrived
                                $parent_name .= $full_name . '<' . $myemail . '>; ';
                                $contact_selected = 'selected';
                            } elseif ($parent_module == "Accounts") {
                                $sql = "select * from vtiger_account where accountid=?";
                                $result = $adb->pquery($sql, array($mycrmid));
                                $account_name = $adb->query_result($result, 0, "accountname");
                                $myemail = $adb->query_result($result, 0, "email1");
                                $parent_id .= $mycrmid . '@0|';
                                //make it such that the email adress sent is remebered and only that one is retrived
                                $parent_name .= $account_name . '<' . $myemail . '>; ';
                                $account_selected = 'selected';
                            } elseif ($parent_module == "Users") {
                                $sql = "select user_name,email1 from vtiger_users where id=?";
                                $result = $adb->pquery($sql, array($mycrmid));
                                $account_name = $adb->query_result($result, 0, "user_name");
                                $myemail = $adb->query_result($result, 0, "email1");
                                $parent_id .= $mycrmid . '@0|';
                                //make it such that the email adress sent is remebered and only that one is retrived
                                $parent_name .= $account_name . '<' . $myemail . '>; ';
                                $user_selected = 'selected';
开发者ID:kduqi,项目名称:corebos,代码行数:67,代码来源:EditViewUtils.php

示例12: ExecuteQuery

// Read-Only configuration for fields at Profile level
ExecuteQuery("UPDATE vtiger_def_org_field SET readonly=0");
ExecuteQuery("UPDATE vtiger_profile2field SET readonly=0");
// Modify selected column to enable support for setting default values for fields
ExecuteQuery("ALTER TABLE vtiger_field CHANGE COLUMN selected defaultvalue TEXT default ''");
ExecuteQuery("UPDATE vtiger_field SET defaultvalue='' WHERE defaultvalue='0'");
// Scheduled Reports (Email)
ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_scheduled_reports(reportid INT, recipients TEXT, schedule TEXT,\n\t\t\t\t\t\t\t\t\tformat VARCHAR(10), next_trigger_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(reportid))\n\t\t\t\tENGINE=InnoDB DEFAULT CHARSET=utf8;");
// Change Display of User Name from user_name to lastname firstname.
$usersQuery = "SELECT * FROM vtiger_users";
$usersResult = $adb->query($usersQuery);
$usersCount = $adb->num_rows($usersResult);
for ($i = 0; $i < $usersCount; ++$i) {
    $userId = $adb->query_result($usersResult, $i, 'id');
    $userName = $adb->query_result($usersResult, $i, 'user_name');
    $fullName = getFullNameFromQResult($usersResult, $i, 'Users');
    ExecutePQuery("UPDATE vtiger_cvadvfilter SET value=? WHERE columnname LIKE '%:assigned_user_id:%' AND value=?", array($fullName, $userName));
    ExecutePQuery("UPDATE vtiger_cvadvfilter SET value=? WHERE columnname LIKE '%:assigned_user_id1:%' AND value=?", array($fullName, $userName));
    ExecutePQuery("UPDATE vtiger_relcriteria SET value=? WHERE columnname LIKE 'vtiger_users%:user_name%' AND value=?", array($fullName, $userName));
    ExecutePQuery("UPDATE vtiger_cvadvfilter SET comparator='c'\n\t\t\t\t\t\tWHERE (columnname LIKE '%:assigned_user_id%:' OR columnname LIKE '%:assigned_user_id1%:' OR columnname LIKE '%:modifiedby%:')\n\t\t\t\t\t\t\t\tAND (comparator='s' OR comparator='ew')", array());
}
// Rename Yahoo Id field to Secondary Email field
function vt530_renameField($fieldInfo)
{
    global $adb;
    $moduleName = $fieldInfo['moduleName'];
    $tableName = $fieldInfo['tableName'];
    $fieldName = $fieldInfo['fieldName'];
    $fieldLabel = $fieldInfo['fieldLabel'];
    $fieldColumnName = $fieldInfo['columnName'];
    $newFieldName = $fieldInfo['newFieldName'];
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:521_to_530rc.php

示例13: getAllUserName

/** Function to get userid and username of all vtiger_users
 * @returns $userArray -- User Array in the following format:
 * $userArray=Array($userid1=>$username, $userid2=>$username,............,$useridn=>$username);
 */
function getAllUserName()
{
    global $log, $adb;
    $log->debug('Entering getAllUserName() method ...');
    $query = 'select * from vtiger_users where deleted=0';
    $result = $adb->pquery($query, array());
    $num_rows = $adb->num_rows($result);
    $user_details = array();
    for ($i = 0; $i < $num_rows; $i++) {
        $userid = $adb->query_result($result, $i, 'id');
        $username = getFullNameFromQResult($result, $i, 'Users');
        $user_details[$userid] = $username;
    }
    $log->debug('Exiting getAllUserName method ...');
    return $user_details;
}
开发者ID:kduqi,项目名称:corebos,代码行数:20,代码来源:UserInfoUtil.php

示例14: array

global $adb;
$sql = "select groupid,groupname from vtiger_groups";
$result = $adb->pquery($sql, array());
$num_groups = $adb->num_rows($result);
$sql1 = "select * from vtiger_users where deleted=0";
$result1 = $adb->pquery($sql1, array());
$num_users = $adb->num_rows($result1);
$output .= '<input name="assigntype" checked value="U" onclick="toggleAssignType(this.value)" type="radio">&nbsp;User';
if ($num_groups > 1) {
    $output .= '<input name="assigntype"  value="T" onclick="toggleAssignType(this.value)" type="radio">&nbsp;Group';
}
$output .= '<span id="assign_user" style="display: block;">';
$output .= '<select class="small" name="transfer_user_id">';
for ($i = 0; $i < $num_users; $i++) {
    $user_id = $adb->query_result($result1, $i, "id");
    $output .= '<option value="' . $user_id . '">' . getFullNameFromQResult($result1, $i, 'Users') . '</option>';
}
$output .= '</select></span>';
if ($num_groups > 1) {
    $output .= '<span id="assign_team" style="display: none;">';
    $output .= '<select class="select" name="transfer_group_id">';
    $temprow = $adb->fetch_array($result);
    do {
        $group_name = htmlentities($temprow["groupname"], ENT_QUOTES, $default_charset);
        $group_id = $temprow["groupid"];
        if ($delete_group_id != $group_id) {
            if (strlen($group_name) > 20) {
                $group_name = substr($group_name, 0, 20) . "...";
            }
            $output .= '<option value="' . $group_id . '">' . $group_name . '</option>';
        }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:GroupDeleteStep1.php

示例15: setMailerProperties

/**	Function to set all the Mailer properties
  *	$mail 		-- reference of the mail object
  *	$subject	-- subject of the email you want to send
  *	$contents	-- body of the email you want to send
  *	$from_email	-- from email id which will be displayed in the mail
  *	$from_name	-- from name which will be displayed in the mail
  *	$to_email 	-- to email address  -- This can be an email in a single string, a comma separated
  *			   list of emails or an array of email addresses
  *	$attachment	-- whether we want to attach the currently selected file or all vtiger_files.
  				[values = current,all] - optional
  *	$emailid	-- id of the email object which will be used to get the vtiger_attachments - optional
  */
function setMailerProperties($mail, $subject, $contents, $from_email, $from_name, $to_email, $attachment = '', $emailid = '', $module = '', $logo = '')
{
    global $adb;
    $adb->println("Inside the function setMailerProperties");
    if ($module == "Support" || $logo == 1) {
        $mail->AddEmbeddedImage('layouts/vlayout/skins/images/logo_mail.jpg', 'logo', 'logo.jpg', "base64", "image/jpg");
    }
    // SalesPlatform.ru begin
    $mail->Timeout = 20;
    // SalesPlatform.ru end
    $mail->Subject = $subject;
    //Added back as we have changed php mailer library, older library was using html_entity_decode before sending mail
    $mail->Body = decode_html($contents);
    //$mail->Body = html_entity_decode(nl2br($contents));	//if we get html tags in mail then we will use this line
    $mail->AltBody = strip_tags(preg_replace(array("/<p>/i", "/<br>/i", "/<br \\/>/i"), array("\n", "\n", "\n"), $contents));
    // SalesPlatform.ru begin
    $query = "select * from vtiger_systems where server_type=?";
    $params = array('email');
    $result = $adb->pquery($query, $params);
    if (isset($_REQUEST['use_sendmail'])) {
        $use_sendmail = $_REQUEST['use_sendmail'];
        if ($use_sendmail == 'on') {
            $use_sendmail = 'true';
        }
    } else {
        if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'Settings' && !isset($_REQUEST['use_sendmail'])) {
            //added to avoid issue while editing the values in the outgoing mail server.
            $use_sendmail = 'false';
        } else {
            $use_sendmail = $adb->query_result($result, 0, 'use_sendmail');
        }
    }
    if ($use_sendmail == "true" || $use_sendmail == "on") {
        $mail->IsSendmail();
    } else {
        $mail->IsSMTP();
    }
    //	$mail->IsSMTP();		//set mailer to use SMTP
    // SalesPlatform.ru end
    //$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
    setMailServerProperties($mail);
    // SalesPlatform.ru begin
    $idn = new idna_convert();
    // SalesPlatform.ru end
    //Handle the from name and email for HelpDesk
    // SalesPlatform.ru begin
    $mail->From = $idn->encode($from_email);
    $from_name_db = $adb->query_result($result, 0, 'from_name');
    if (isset($from_name_db) && $from_name_db != '') {
        //setting from _email to the defined email address in the outgoing server configuration
        $from_name = $from_name_db;
    } else {
        $rs = $adb->pquery("select first_name,last_name from vtiger_users where user_name=?", array($from_name));
        $num_rows = $adb->num_rows($rs);
        if ($num_rows > 0) {
            $from_name = getFullNameFromQResult($rs, 0, 'Users');
        }
    }
    // SalesPlatform.ru end
    $mail->From = $from_email;
    $userFullName = trim(VTCacheUtils::getUserFullName($from_name));
    if (empty($userFullName)) {
        $rs = $adb->pquery("select first_name,last_name from vtiger_users where user_name=?", array($from_name));
        $num_rows = $adb->num_rows($rs);
        if ($num_rows > 0) {
            $fullName = getFullNameFromQResult($rs, 0, 'Users');
            VTCacheUtils::setUserFullName($from_name, $fullName);
        }
    } else {
        $from_name = $userFullName;
    }
    $mail->FromName = decode_html($from_name);
    if ($to_email != '') {
        if (is_array($to_email)) {
            for ($j = 0, $num = count($to_email); $j < $num; $j++) {
                // SalesPlatform.ru begin
                $mail->addAddress($idn->encode($to_email[$j]));
                //				$mail->addAddress($to_email[$j]);
                // SalesPlatform.ru end
            }
        } else {
            $_tmp = explode(",", $to_email);
            for ($j = 0, $num = count($_tmp); $j < $num; $j++) {
                // SalesPlatform.ru begin
                $mail->addAddress($idn->encode($_tmp[$j]));
                //				$mail->addAddress($_tmp[$j]);
                // SalesPlatform.ru end
            }
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:mail.php


注:本文中的getFullNameFromQResult函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。