当前位置: 首页>>代码示例>>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;未经允许,请勿转载。