本文整理汇总了PHP中CCompany类的典型用法代码示例。如果您正苦于以下问题:PHP CCompany类的具体用法?PHP CCompany怎么用?PHP CCompany使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCompany类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllowedCompanies
function getAllowedCompanies()
{
global $AppUI;
require_once $AppUI->getModuleClass('companies');
$company = new CCompany();
$allowedCompanies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
//$allowedCompanies = arrayMerge( array( '0'=>'' ), $allowedCompanies );
return $allowedCompanies;
}
示例2: _createCompanySelection
protected function _createCompanySelection($AppUI, $companyInput)
{
$company = new CCompany();
$companyMatches = $company->getCompanyList($AppUI, -1, $companyInput);
$company_id = count($companyMatches) == 1 ? $companyMatches[0]['company_id'] : $AppUI->user_company;
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => ''), $companies);
$output .= '<td>' . arraySelect($companies, 'company_id', ' onChange=this.form.new_company.value=\'\'', $company_id) . '<input type="text" name="new_company" value="' . ($company_id > 0 ? '' : $companyInput) . '" />';
if ($company_id == 0) {
$output .= '<br /><em>' . $AppUI->_('compinfo') . '</em>';
}
$output .= '</td></tr>';
return $output;
}
示例3: getContactUpdateNotify
public function getContactUpdateNotify(w2p_Core_CAppUI $AppUI = null, CContact $contact)
{
$this->_AppUI = !is_null($AppUI) ? $AppUI : $this->_AppUI;
$company = new CCompany();
$company->load($contact->contact_company);
$contact->company_name = $company->company_name;
$contact->user_display_name = $this->_AppUI->user_display_name;
$body = "Dear contact_title contact_display_name,";
$body .= "\n\nIt was very nice to visit you";
$body .= $contact->contact_company ? " and company_name." : ".";
$body .= " Thank you for all the time that you spent with me.";
$body .= "\n\nI have entered the data from your business card into my contact database so that we may keep in touch.";
$body .= " We have implemented a system which allows you to view the information that I've recorded and give you the opportunity to correct it or add information as you see fit. Please click on this link to view what I've recorded:";
$body .= "\n\n" . W2P_BASE_URL . "/updatecontact.php?updatekey=contact_updatekey";
$body .= "\n\nI assure you that the information will be held in strict confidence and will not be available to anyone other than me. I realize that you may not feel comfortable filling out the entire form so please supply only what you're comfortable with.";
$body .= "\n\nThank you. I look forward to seeing you again, soon.";
$body .= "\n\nBest Regards,\nuser_display_name";
return $this->templater->render($body, $contact);
}
示例4: w2PsetMicroTime
}
$AppUI->savePlace();
w2PsetMicroTime();
// retrieve any state parameters
if (isset($_REQUEST['company_id'])) {
$AppUI->setState('CalIdxCompany', intval(w2PgetParam($_REQUEST, 'company_id', 0)));
}
$company_id = $AppUI->getState('CalIdxCompany', 0);
// Using simplified set/get semantics. Doesn't need as much code in the module.
$event_filter = $AppUI->checkPrefState('CalIdxFilter', w2PgetParam($_REQUEST, 'event_filter', 'my'), 'EVENTFILTER', 'my');
// get the passed timestamp (today if none)
$ctoday = new w2p_Utilities_Date();
$today = $ctoday->format(FMT_TIMESTAMP_DATE);
$date = w2PgetParam($_GET, 'date', $today);
// get the list of visible companies
$company = new CCompany();
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
// setup the title block
$titleBlock = new CTitleBlock('Monthly Calendar', 'myevo-appointments.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=calendar&a=year_view&date=' . $date, 'year view');
$titleBlock->addCrumb('?m=calendar&date=' . $date, 'month view');
$titleBlock->addCrumb('?m=calendar&a=week_view&date=' . $date, 'week view');
$titleBlock->addCrumb('?m=calendar&a=day_view&date=' . $date, 'day view');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">', '</form>');
$titleBlock->addCell($AppUI->_('Event Filter') . ':');
$titleBlock->addCell(arraySelect($event_filter_list, 'event_filter', 'onChange="document.pickFilter.submit()" class="text"', $event_filter, true), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickFilter" accept-charset="utf-8">', '</form>');
$titleBlock->show();
?>
示例5: die
<?php
/* $Id: vw_contacts.php 1516 2010-12-05 07:18:58Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/companies/vw_contacts.php $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
##
## Companies: View User sub-table
##
global $AppUI, $company;
$contacts = CCompany::getContacts($AppUI, $company->company_id);
?>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"><?php
if (count($contacts) > 0) {
?>
<tr>
<th><?php
echo $AppUI->_('Name');
?>
</th>
<th><?php
echo $AppUI->_('Job Title');
?>
</th>
<th><?php
echo $AppUI->_('e-mail');
?>
</th>
<th><?php
echo $AppUI->_('Phone');
?>
示例6: die
/* COMPANIES $Id: vw_companies.php 4800 2007-03-06 00:34:46Z merlinyoda $ */
if (!defined('DP_BASE_DIR')) {
die('You should not access this file directly.');
}
global $search_string;
global $owner_filter_id;
global $currentTabId;
global $currentTabName;
global $tabbed;
global $type_filter;
global $orderby;
global $orderdir;
// load the company types
$types = dPgetSysVal('CompanyType');
// get any records denied from viewing
$obj = new CCompany();
$allowedCompanies = $obj->getAllowedRecords($AppUI->user_id, 'company_id, company_name');
$company_type_filter = $currentTabId;
//Not Defined
$companiesType = true;
if ($currentTabName == "All Companies") {
$companiesType = false;
}
if ($currentTabName == "Not Applicable") {
$company_type_filter = 0;
}
// retrieve list of records
$q = new DBQuery();
$q->addTable('companies', 'c');
$q->addQuery('c.company_id, c.company_name, c.company_type, c.company_description, count(distinct p.project_id) as countp, count(distinct p2.project_id) as inactive, con.contact_first_name, con.contact_last_name');
$q->addJoin('projects', 'p', 'c.company_id = p.project_company AND p.project_status <> 7');
示例7: CCompany
// This should now work on company ID, but we need to be able to handle both
$q->addTable('contacts', 'a');
$q->leftJoin('companies', 'b', 'company_id = contact_company');
$q->leftJoin('departments', 'c', 'dept_id = contact_department');
$q->addQuery('contact_id, contact_first_name, contact_last_name, contact_company, contact_department');
$q->addQuery('company_name');
$q->addQuery('dept_name');
if ($where) {
// Don't assume where is set. Change needed to fix Mantis Bug 0002056
$q->addWhere($where);
}
if ($where_dept) {
// Don't assume where is set. Change needed to fix Mantis Bug 0002056
$q->addWhere($where_dept);
}
$oCpy = new CCompany();
$aCpies = $oCpy->getAllowedRecords($AppUI->user_id, 'company_id, company_name', 'company_name');
$where = $oCpy->getAllowedSQL($AppUI->user_id, 'contact_company');
$q->addWhere($where);
$oDpt = new CDepartment();
$where = $oDpt->getAllowedSQL($AppUI->user_id, 'contact_department');
$q->addWhere($where);
$q->addWhere('(contact_owner = ' . (int) $AppUI->user_id . ' OR contact_private = 0)');
$q->addOrder('company_name, contact_company, dept_name, contact_department, contact_last_name');
// May need to review this.
$contacts = $q->loadHashList('contact_id');
?>
<form action="index.php?m=public&a=contact_selector&dialog=1&<?php
if (!is_null($call_back)) {
echo 'call_back=' . $call_back . '&';
示例8: die
if (!defined('DP_BASE_DIR')) {
die('You should not access this file directly.');
}
$project_id = intval(dPgetParam($_GET, "project_id", 0));
$company_id = intval(dPgetParam($_GET, "company_id", 0));
$company_internal_id = intval(dPgetParam($_GET, "company_internal_id", 0));
$contact_id = intval(dPgetParam($_GET, "contact_id", 0));
// check permissions for this record
$canEdit = getPermission($m, 'edit', $project_id);
$canAuthor = getPermission($m, 'add', $project_id);
if (!($canEdit && $project_id || $canAuthor && !$project_id)) {
$AppUI->redirect('m=public&a=access_denied');
}
// get a list of permitted companies
require_once $AppUI->getModuleClass('companies');
$row = new CCompany();
$companies = $row->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => ''), $companies);
// get internal companies
// 6 is standard value for internal companies
$companies_internal = $row->listCompaniesByType(array('6'));
$companies_internal = arrayMerge(array('0' => ''), $companies_internal);
// pull users
$q = new DBQuery();
$q->addTable('users', 'u');
$q->addTable('contacts', 'con');
$q->addQuery('user_id');
$q->addQuery('CONCAT_WS(", ",contact_last_name,contact_first_name)');
$q->addOrder('contact_last_name');
$q->addWhere('u.user_contact = con.contact_id');
$users = $q->loadHashList();
示例9: getDeniedRecords
/**
* Overload of the dpObject::getDeniedRecords
* to ensure that the projects owned by denied companies are denied.
*
* @author handco <handco@sourceforge.net>
* @see dpObject::getAllowedRecords
*/
function getDeniedRecords($uid)
{
$aBuf1 = parent::getDeniedRecords($uid);
$oCpy = new CCompany();
// Retrieve which projects are allowed due to the company rules
$aCpiesAllowed = $oCpy->getAllowedRecords($uid, 'company_id,company_name');
$q = new DBQuery();
$q->addTable('projects');
$q->addQuery('project_id');
if (count($aCpiesAllowed)) {
$q->addWhere('NOT (project_company IN (' . implode(',', array_keys($aCpiesAllowed)) . '))');
}
$sql = $q->prepare();
$q->clear();
$aBuf2 = db_loadColumn($sql);
return array_merge($aBuf1, $aBuf2);
}
示例10: array
//If a department is specified, we want to display projects from the department, and all departments under that, so we need to build that list of departments
$dept_ids = array();
$q->addTable('departments');
$q->addQuery('dept_id, dept_parent');
$q->addOrder('dept_parent,dept_name');
$rows = $q->loadList();
addDeptId($rows, $department);
$dept_ids[] = $department;
}
$q->clear();
// retrieve list of records
// modified for speed
// by Pablo Roca (pabloroca@mvps.org)
// 16 August 2003
// get the list of permitted companies
$obj = new CCompany();
$companies = $obj->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
if (count($companies) == 0) {
$companies = array(0);
}
$sql = "\nSELECT\n\tprojects.project_id, project_active, project_status,\n\tproject_color_identifier, project_name, project_description,\n\tproject_start_date, project_end_date, project_color_identifier,\n\tproject_company, company_name, project_status, project_priority, project_short_name,\n tasks_critical.critical_task, tasks_critical.project_actual_end_date,\n tasks_problems.task_log_problem,\n\ttasks_sum.total_tasks,\n\ttasks_summy.my_tasks,\n\ttasks_sum.project_percent_complete,\n\tuser_username\nFROM projects\nLEFT JOIN companies ON projects.project_company = company_id\nLEFT JOIN users ON projects.project_owner = users.user_id\nLEFT JOIN tasks_critical ON projects.project_id = tasks_critical.task_project\nLEFT JOIN tasks_problems ON projects.project_id = tasks_problems.task_project\nLEFT JOIN tasks_sum ON projects.project_id = tasks_sum.task_project\nLEFT JOIN tasks_summy ON projects.project_id = tasks_summy.task_project" . (isset($department) ? "\nLEFT JOIN project_departments ON project_departments.project_id = projects.project_id" : '') . "\nWHERE 1 = 1" . (count($deny) > 0 ? "\nAND projects.project_id NOT IN (" . implode(',', $deny) . ')' : '') . (!isset($department) && $company_id ? "\nAND projects.project_company = '{$company_id}'" : "\nAND projects.project_company IN (" . implode(',', array_keys($companies)) . ")") . (isset($department) ? "\nAND project_departments.department_id in ( " . implode(',', $dept_ids) . " )" : '') . ($alias_string != '' ? "\nAND projects.project_short_name LIKE '%" . $alias_string . "%'" : '') . "\n\nGROUP BY projects.project_id\nORDER BY {$orderby} {$orderdir}\t\n";
global $projects;
$q->addTable('projects');
$q->addQuery('projects.project_id, project_active, project_status, project_color_identifier, project_name, project_description,
project_start_date, project_end_date, project_color_identifier, project_company, company_name, project_status, project_short_name,
project_priority, tc.critical_task, tc.project_actual_end_date, tp.task_log_problem, ts.total_tasks, tsy.my_tasks,
ts.project_percent_complete, user_username');
$q->addJoin('companies', 'com', 'projects.project_company = company_id');
$q->addJoin('users', 'u', 'projects.project_owner = u.user_id');
$q->addJoin('tasks_critical', 'tc', 'projects.project_id = tc.task_project');
$q->addJoin('tasks_problems', 'tp', 'projects.project_id = tp.task_project');
示例11: die
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$tab = $AppUI->processIntState('CompanyIdxTab', $_GET, 'tab', 0);
if (isset($_GET['orderby'])) {
$orderdir = $AppUI->getState('CompIdxOrderDir') ? $AppUI->getState('CompIdxOrderDir') == 'asc' ? 'desc' : 'asc' : 'desc';
$AppUI->setState('CompIdxOrderBy', w2PgetParam($_GET, 'orderby', null));
$AppUI->setState('CompIdxOrderDir', $orderdir);
}
$orderby = $AppUI->getState('CompIdxOrderBy') ? $AppUI->getState('CompIdxOrderBy') : 'company_name';
$orderdir = $AppUI->getState('CompIdxOrderDir') ? $AppUI->getState('CompIdxOrderDir') : 'asc';
$owner_filter_id = $AppUI->processIntState('owner_filter_id', $_POST, 'owner_filter_id', 0);
$search_string = w2PgetParam($_POST, 'search_string', '');
$search_string = w2PformSafe($search_string, true);
$company = new CCompany();
$canCreate = $company->canCreate();
$perms =& $AppUI->acl();
$baseArray = array(0 => $AppUI->_('All', UI_OUTPUT_RAW));
$allowedArray = $perms->getPermittedUsers('companies');
$owner_list = is_array($allowedArray) ? $baseArray + $allowedArray : $baseArray;
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Companies', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
$titleBlock->addFilterCell('Owner', 'owner_filter_id', $owner_list, $owner_filter_id);
if ($canCreate) {
$titleBlock->addButton('new company', '?m=companies&a=addedit');
}
$titleBlock->show();
// load the company types
$companyTypes = w2PgetSysVal('CompanyType');
示例12: die
<?php
/* COMPANIES $Id: do_company_aed.php 5872 2009-04-25 00:09:56Z merlinyoda $ */
if (!defined('DP_BASE_DIR')) {
die('You should not access this file directly.');
}
$del = dPgetParam($_POST, 'del', 0);
$obj = new CCompany();
$msg = '';
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
require_once $AppUI->getSystemClass('CustomFields');
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Company');
if ($del) {
if (!$obj->canDelete($msg)) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
}
if ($msg = $obj->delete()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
} else {
$AppUI->setMsg('deleted', UI_MSG_ALERT, true);
$AppUI->redirect('m=companies');
}
} else {
if ($msg = $obj->store()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
示例13: w2PgetUsersHashList
function w2PgetUsersHashList($stub = null, $where = null, $orderby = 'contact_first_name, contact_last_name')
{
global $AppUI;
$q = new DBQuery();
$q->addTable('users');
$q->addQuery('DISTINCT(user_id), user_username, contact_last_name, contact_first_name,
contact_email, company_name, contact_company, dept_id, dept_name, CONCAT(contact_first_name,\' \',contact_last_name) contact_name, user_type');
$q->addJoin('contacts', 'con', 'contact_id = user_contact', 'inner');
if ($stub) {
$q->addWhere('(UPPER(user_username) LIKE \'' . $stub . '%\' or UPPER(contact_first_name) LIKE \'' . $stub . '%\' OR UPPER(contact_last_name) LIKE \'' . $stub . '%\')');
} elseif ($where) {
$where = $q->quote('%' . $where . '%');
$q->addWhere('(UPPER(user_username) LIKE ' . $where . ' OR UPPER(contact_first_name) LIKE ' . $where . ' OR UPPER(contact_last_name) LIKE ' . $where . ')');
}
$q->addGroup('user_id');
$q->addOrder($orderby);
// get CCompany() to filter by company
$obj = new CCompany();
$companies = $obj->getAllowedSQL($AppUI->user_id, 'company_id');
$q->addJoin('companies', 'com', 'company_id = contact_company');
if ($companies) {
$q->addWhere('(' . implode(' OR ', $companies) . ' OR contact_company=\'\' OR contact_company IS NULL OR contact_company = 0)');
}
$dpt = new CDepartment();
$depts = $dpt->getAllowedSQL($AppUI->user_id, 'dept_id');
$q->addJoin('departments', 'dep', 'dept_id = contact_department');
if ($depts) {
$q->addWhere('(' . implode(' OR ', $depts) . ' OR contact_department=0)');
}
return $q->loadHashList('user_id');
}
示例14: CTitleBlock
if (!$department && $dept_id > 0) {
$titleBlock = new CTitleBlock('Invalid Department ID', 'departments.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=companies', 'companies list');
if ($company_id) {
$titleBlock->addCrumb('?m=companies&a=view&company_id=' . $company_id, 'view this company');
}
$titleBlock->show();
} else {
$company_id = $dept_id ? $department->dept_company : $company_id;
if (!$dept_id && $department->company_name === null) {
$AppUI->setMsg('badCompany', UI_MSG_ERROR);
$AppUI->redirect();
}
// collect all the departments in the company
if ($company_id) {
$company = new CCompany();
$company->loadFull($AppUI, $company_id);
$companyName = $company->company_name;
$depts = $department->loadOtherDepts($AppUI, $company_id, 0);
$depts = arrayMerge(array('0' => '- ' . $AppUI->_('Select Department') . ' -'), $depts);
}
// setup the title block
$ttl = $dept_id > 0 ? 'Edit Department' : 'Add Department';
$titleBlock = new CTitleBlock($ttl, 'departments.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=departments', 'department list');
$titleBlock->addCrumb('?m=companies', 'companies list');
$titleBlock->addCrumb('?m=companies&a=view&company_id=' . $company_id, 'view this company');
$titleBlock->addCrumb('?m=departments&a=view&dept_id=' . $dept_id, 'view this department');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
示例15: die
/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$company_id = (int) w2PgetParam($_GET, 'company_id', 0);
// check permissions for this record
$perms =& $AppUI->acl();
$canRead = $perms->checkModuleItem($m, 'view', $company_id);
if (!$canRead) {
$AppUI->redirect('m=public&a=access_denied');
}
$canAdd = $perms->checkModuleItem($m, 'add');
$canEdit = $perms->checkModuleItem($m, 'edit', $company_id);
$canDelete = $perms->checkModuleItem($m, 'delete', $company_id);
$tab = $AppUI->processIntState('CompVwTab', $_GET, 'tab', 0);
$company = new CCompany();
$company->loadFull($AppUI, $company_id);
// check if this record has dependencies to prevent deletion
$msg = '';
$deletable = $company->canDelete($msg, $company_id);
// load the record data
if (!$company) {
$AppUI->setMsg('Company');
$AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
$AppUI->redirect();
} else {
$AppUI->savePlace();
}
// setup the title block
$titleBlock = new CTitleBlock('View Company', 'handshake.png', $m, "{$m}.{$a}");
$titleBlock->addCell();