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


PHP CCompany::getDepartments方法代碼示例

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


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

示例1: testGetDepartments

 /**
  * Tests loading list of Departments for this company.
  */
 public function testGetDepartments()
 {
     global $AppUI;
     $departments = CCompany::getDepartments($AppUI, 1);
     $this->assertEquals(1, count($departments));
     $this->assertEquals(1, $departments[0]['dept_id']);
     $this->assertEquals(0, $departments[0]['dept_parent']);
     $this->assertEquals(1, $departments[0]['dept_company']);
     $this->assertEquals('Department 1', $departments[0]['dept_name']);
     $this->assertEquals('', $departments[0]['dept_phone']);
     $this->assertEquals('', $departments[0]['dept_fax']);
     $this->assertEquals('', $departments[0]['dept_address1']);
     $this->assertEquals('', $departments[0]['dept_address2']);
     $this->assertEquals('', $departments[0]['dept_city']);
     $this->assertEquals('', $departments[0]['dept_state']);
     $this->assertEquals('', $departments[0]['dept_zip']);
     $this->assertEquals('', $departments[0]['dept_url']);
     $this->assertEquals('', $departments[0]['dept_desc']);
     $this->assertEquals(0, $departments[0]['dept_owner']);
     $this->assertEquals('', $departments[0]['dept_country']);
     $this->assertEquals('', $departments[0]['dept_email']);
     $this->assertEquals(0, $departments[0]['dept_type']);
     $this->assertEquals(0, $departments[0]['dept_users']);
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:27,代碼來源:companies.test.php

示例2: die

<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
##
##	Companies: View Departments sub-table
##
global $AppUI, $company_id, $canEdit;
$depts = CCompany::getDepartments($AppUI, $company_id);
// function renamed to avoid naming clash
function showchilddept_comp(&$a, $level = 0)
{
    global $AppUI;
    $s = '
	<td>
		<a href="./index.php?m=departments&amp;a=addedit&amp;dept_id=' . $a["dept_id"] . '" title="' . $AppUI->_('edit') . '">
			' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . '
	</td>
	<td>';
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0" alt="">';
        } else {
            $s .= '<img src="' . w2PfindImage('shim.gif') . '" width="16" height="12" border="0" alt="">';
        }
    }
    $s .= '<a href="./index.php?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>';
    $s .= '</td>';
    $s .= '<td align="center">' . ($a['dept_users'] ? $a['dept_users'] : '') . '</td>';
開發者ID:eureka2,項目名稱:web2project,代碼行數:31,代碼來源:vw_depts.php


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