當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Customers::customerHasContacts方法代碼示例

本文整理匯總了PHP中Customers::customerHasContacts方法的典型用法代碼示例。如果您正苦於以下問題:PHP Customers::customerHasContacts方法的具體用法?PHP Customers::customerHasContacts怎麽用?PHP Customers::customerHasContacts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Customers的用法示例。


在下文中一共展示了Customers::customerHasContacts方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: customers_maintcontent_BeforeShow

function customers_maintcontent_BeforeShow(&$sender)
{
    $customers_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_maintcontent;
    //Compatibility
    //End customers_maintcontent_BeforeShow
    //Custom Code @227-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    $mr = CCGetFromGet("mr", "customers");
    switch ($tab) {
        default:
        case "details":
            $Tpl->setvar("tab1_active", "active");
            break;
        case "evaluation":
            $Tpl->setvar("tab3_active", "active");
            break;
        case "addcontact":
            $Tpl->setvar("tab2_active", "active");
            break;
    }
    if ($mr == "contacts") {
        $Tpl->setvar("mr_show", "hide");
        $Tpl->setvar("contact_show", "show");
    } else {
        $Tpl->setvar("mr_show", "show");
        $Tpl->setvar("contact_show", "hide");
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //On Edit mode, check if has contacts
    $customer_guid = trim(CCGetFromGet("guid", ""));
    if (strlen($customer_guid) > 0) {
        $customers = new Customers();
        $params = array();
        $params["customer_guid"] = $customer_guid;
        $hasContacts = $customers->customerHasContacts($params);
        if ($hasContacts["hasContacts"] == "1") {
            CCSetSession("contacterror", "hide");
        } else {
            CCSetSession("contacterror", "show");
        }
    }
    //Contact warning, shows when no contact has been added to the company
    $contacterror = CCGetSession("contacterror", "");
    $MainPage->Attributes->SetValue("showalert_contacterror", $contacterror);
    // -------------------------
    //End Custom Code
    //Close customers_maintcontent_BeforeShow @1-CA17A984
    return $customers_maintcontent_BeforeShow;
}
開發者ID:wangshipeng,項目名稱:license_manager,代碼行數:61,代碼來源:customers_maintcontent_events.php

示例2: licensing_customerscontent_BeforeShow

function licensing_customerscontent_BeforeShow(&$sender)
{
    $licensing_customerscontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $licensing_customerscontent;
    //Compatibility
    //End licensing_customerscontent_BeforeShow
    //Custom Code @152-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    switch ($tab) {
        default:
        case "details":
            $Tpl->setvar("tab1_active", "active");
            break;
        case "licensing":
            $Tpl->setvar("tab2_active", "active");
            break;
        case "licenselist":
            $Tpl->setvar("tab3_active", "active");
            break;
        case "licensearchive":
            $Tpl->setvar("tab4_active", "active");
            break;
        case "competitor_renewals":
            $Tpl->setvar("tab5_active", "active");
            break;
        case "product_displacement":
            $Tpl->setvar("tab6_active", "active");
            break;
    }
    //Setting the active tab for licensing when the cssForm is present and has licensing as the form submitted
    $cssForm = trim(CCGetFromGet("ccsForm", ""));
    if ($cssForm == "licensing") {
        //Whichever tab set will be reset to avoid more than 1 tab active
        $Tpl->setvar("tab1_active", "");
        $Tpl->setvar("tab2_active", "active");
        $Tpl->setvar("tab3_active", "");
        $Tpl->setvar("tab4_active", "");
        $Tpl->setvar("tab5_active", "");
        $Tpl->setvar("tab6_active", "");
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //Setting up alerts to let user know the customer has not contacts yet
    $customers = new Customers();
    $customer_guid = CCGetFromGet("guid", "");
    $params = array();
    $params["customer_guid"] = $customer_guid;
    $hasContacts = $customers->customerHasContacts($params);
    if ($hasContacts["hasContacts"] == "1") {
        $MainPage->Attributes->SetValue("showalert_contacterror", "hide");
    } else {
        $MainPage->Attributes->SetValue("showalert_contacterror", "show");
    }
    //Setting up alerts to let user know the license may need support
    $license_guid = trim(CCGetFromGet("license_guid", ""));
    if (strlen($license_guid) > 0) {
        $products = new Alm\Products();
        $params = array();
        $params["license_guid"] = $license_guid;
        $hasSupport = $products->licenseHasSupport($params);
        if ($hasSupport["hasSupport"] == "1") {
            $MainPage->Attributes->SetValue("showalert_addsupport", "hide");
        } else {
            $MainPage->Attributes->SetValue("showalert_addsupport", "show");
        }
    } else {
        $MainPage->Attributes->SetValue("showalert_addsupport", "hide");
    }
    //Check if session variable showalert_addsupport has a show value
    $showalert_addsupport = CCGetSession("showalert_addsupport", "");
    if ($showalert_addsupport == "show") {
        CCSetSession("showalert_addsupport", "hide");
        $MainPage->Attributes->SetValue("showalert_addsupport", $showalert);
    }
    //Procesing file uploading
    $hidlicense_guid = trim(CCGetFromPost("hidlicense_guid", ""));
    if (!empty($_FILES) && strlen($hidlicense_guid) > 0) {
        $params = array();
        $params["license_guid"] = $hidlicense_guid;
        $products = new \Alm\Products();
        $products->uploadLicenseFile($_FILES, $params);
        //Finishing script execution for file uploads because its asyncronous
        exit;
    }
    $license_guid = trim(CCGetFromGet("license_guid", ""));
    $licensefile_guid = trim(CCGetFromGet("licensefile_guid", ""));
    $o = trim(CCGetFromGet("o", ""));
    //Delete licensing operation
    if (strlen($licensefile_guid) > 0 && $o == "dellicense") {
        $params = array();
//.........這裏部分代碼省略.........
開發者ID:wangshipeng,項目名稱:license_manager,代碼行數:101,代碼來源:licensing_customerscontent_events.php

示例3: customers_viewcontent_BeforeShow

function customers_viewcontent_BeforeShow(&$sender)
{
    $customers_viewcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_viewcontent;
    //Compatibility
    //End customers_viewcontent_BeforeShow
    //Custom Code @159-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    switch ($tab) {
        default:
        case "details":
            $Tpl->setvar("tab1_active", "active");
            break;
        case "evaluation":
            $Tpl->setvar("tab2_active", "active");
            break;
        case "addcontact":
            $Tpl->setvar("tab3_active", "active");
            break;
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //Setting up alerts to let user know the customer has not contacts yet
    $customers = new Customers();
    $customer_guid = CCGetFromGet("guid", "");
    $params = array();
    $params["customer_guid"] = $customer_guid;
    $hasContacts = $customers->customerHasContacts($params);
    if ($hasContacts["hasContacts"] == "1") {
        $MainPage->Attributes->SetValue("showalert_contacterror", "hide");
    } else {
        $MainPage->Attributes->SetValue("showalert_contacterror", "show");
    }
    // -------------------------
    //End Custom Code
    //Close customers_viewcontent_BeforeShow @1-6903B239
    return $customers_viewcontent_BeforeShow;
}
開發者ID:wangshipeng,項目名稱:license_manager,代碼行數:48,代碼來源:customers_viewcontent_events.php


注:本文中的Customers::customerHasContacts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。