• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CCompany类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了CCompany类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:srinivasulurao,项目名称:jonel,代码行数:9,代码来源:helpdesk.functions.php


示例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;
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:14,代码来源:importers.class.php


示例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);
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:19,代码来源:EmailManager.class.php


示例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();
?>
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:30,代码来源:index.php


示例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');
    ?>
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:vw_contacts.php


示例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');
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:vw_companies.php


示例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 . '&';
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:contact_selector.php


示例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();
开发者ID:kilivan,项目名称:dotproject,代码行数:31,代码来源:addedit.php


示例9: getDeniedRecords

 /**
  *	Overload of the dpObject::getDeniedRecords
  *	to ensure that the projects owned by denied companies are denied.
  *
  *	@author	handco <[email protected]>
  *	@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);
 }
开发者ID:srinivasulurao,项目名称:jonel,代码行数:24,代码来源:projects.class.php


示例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 ([email protected])
// 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');
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:index_2.php


示例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');
开发者ID:illuminate3,项目名称:web2project,代码行数:30,代码来源:index.php


示例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);
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:do_company_aed.php


示例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');
}
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:main_functions.php


示例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">
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:addedit.php


示例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();
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:view.php


示例16: die

<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
##
##	Companies: View Projects sub-table
##
global $AppUI, $company_id, $pstatus, $w2Pconfig;
$sort = w2PgetParam($_GET, 'sort', 'project_name');
if ($sort == 'project_priority') {
    $sort .= ' DESC';
}
$df = $AppUI->getPref('SHDATEFORMAT');
$projects = CCompany::getProjects($AppUI, $company_id, 1, $sort);
?>
<table cellpadding="2" cellspacing="1" border="0" width="100%" class="tbl"><?php 
if (count($projects) > 0) {
    ?>
	<tr>
		<th><a href="index.php?m=companies&a=view&company_id=<?php 
    echo $company_id;
    ?>
&sort=project_priority"><?php 
    echo $AppUI->_('P');
    ?>
</a></th>
		<th><a href="index.php?m=companies&a=view&company_id=<?php 
    echo $company_id;
    ?>
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:vw_active.php


示例17: getPermission

$canAccess_folders = getPermission('file_folders', 'access');
$canRead_folders = getPermission('file_folders', 'view');
$canEdit_folders = getPermission('file_folders', 'edit');
$canAuthor_folders = getPermission('file_folders', 'add');
$canDelete_folders = getPermission('file_folders', 'delete');
// load the following classes to retrieved denied records
include_once $AppUI->getModuleClass('projects');
include_once $AppUI->getModuleClass('tasks');
if (!isset($project_id)) {
    $project_id = dPgetParam($_REQUEST, 'project_id', 0);
}
if (!$project_id) {
    $showProject = true;
}
global $allowedCompanies, $allowedProjects, $allowedTasks, $allowedFolders;
$company = new CCompany();
$allowedCompanies = $company->getAllowedSQL($AppUI->user_id, 'co.company_id');
$project = new CProject();
$allowedProjects = $project->getAllowedSQL($AppUI->user_id, 'f.file_project');
$task = new CTask();
$allowedTasks = $task->getAllowedSQL($AppUI->user_id, 'f.file_task');
$cfObj = new CFileFolder();
$allowedFolderIDs = $cfObj->getAllowedSQL($AppUI->user_id, 'ff.file_folder_id');
$allowedFolders = $cfObj->getAllowedSQL($AppUI->user_id, 'f.file_folder');
// $parent_id is the parent of the children we want to see
// $level is increased when we go deeper into the tree, used to display a nice indented tree
function displayFolders($folder_id = 0, $level = 0)
{
    global $AppUI, $m, $a, $tab;
    global $current_uri;
    global $canAccess_folders, $canRead_folders, $canEdit_folders;
开发者ID:slawekmikula,项目名称:dotproject,代码行数:31,代码来源:folders_table.php


示例18: foreach

</th>
<th><?php 
echo $AppUI->_('Status');
?>
</th>
</tr>
<?php 
//while ($line = mysql_fetch_array($res, MYSQL_ASSOC)) {
$s = '';
foreach ($st_projects_arr as $project) {
    $line = $project[0];
    $level = $project[1];
    if ($line['project_id']) {
        $s_project = new CProject();
        $s_project->load($line['project_id']);
        $s_company = new CCompany();
        $s_company->load($s_project->project_company);
        $start_date = intval($s_project->project_start_date) ? new CDate($s_project->project_start_date) : null;
        $end_date = intval($s_project->project_end_date) ? new CDate($s_project->project_end_date) : null;
        $actual_end_date = intval($s_project->project_actual_end_date) ? new CDate($s_project->project_actual_end_date) : null;
        $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
        $x++;
        $row_class = $x % 2 ? 'style="background:#fff;"' : 'style="background:#f0f0f0;"';
        $row_classr = $x % 2 ? 'style="background:#fff;text-align:right;"' : 'style="background:#f0f0f0;text-align:right;"';
        $s .= '<tr><td ' . $row_class . ' align="center"><a href="./index.php?m=projects&a=addedit&project_id=' . $line['project_id'] . '"><img src="' . w2PfindImage('icons/' . ($project_id == $line['project_id'] ? 'pin' : 'pencil') . '.gif') . '" border=0 /></b></a></td>';
        $s .= '<td ' . $row_classr . ' nowrap="nowrap">' . $line['project_id'] . '</td>';
        if ($level) {
            $sd = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level - 1) . w2PshowImage('corner-dots.gif', 16, 12) . '&nbsp;' . '<a href="./index.php?m=projects&a=view&project_id=' . $line['project_id'] . '">' . $line['project_name'] . '</a>';
        } else {
            $sd = '<a href="./index.php?m=projects&a=view&project_id=' . $line['project_id'] . '">' . $line['project_name'] . '</a>';
        }
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:vw_sub_projects.php


示例19: getDeniedRecords

 /**
  *	Overload of the w2PObject::getDeniedRecords
  *	to ensure that the projects owned by denied companies are denied.
  *
  *	@author	handco <[email protected]>
  *	@see	w2PObject::getAllowedRecords
  */
 public 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');
     //Department permissions
     $oDpt = new CDepartment();
     $aDptsAllowed = $oDpt->getAllowedRecords($uid, 'dept_id,dept_name');
     $q = $this->_query;
     $q->addTable('projects');
     $q->addQuery('projects.project_id');
     $q->addJoin('project_departments', 'pd', 'pd.project_id = projects.project_id');
     if (count($aCpiesAllowed)) {
         if (array_search('0', $aCpiesAllowed) === false) {
             //If 0 (All Items of a module) are not permited then just add the allowed items only
             $q->addWhere('NOT (project_company IN (' . implode(',', array_keys($aCpiesAllowed)) . '))');
         } else {
             //If 0 (All Items of a module) are permited then don't add a where clause so the user is permitted to see all
         }
     } else {
         //if the user is not allowed any company then lets shut him off
         $q->addWhere('0=1');
     }
     if (count($aDptsAllowed)) {
         if (array_search('0', $aDptsAllowed) === false) {
             //If 0 (All Items of a module) are not permited then just add the allowed items only
             $q->addWhere('NOT (department_id IN (' . implode(',', array_keys($aDptsAllowed)) . '))');
         } else {
             //If 0 (All Items of a module) are permited then don't add a where clause so the user is permitted to see all
             $q->addWhere('NOT (department_id IS NULL)');
         }
     } else {
         //If 0 (All Items of a module) are permited then don't add a where clause so the user is permitted to see all
         $q->addWhere('NOT (department_id IS NULL)');
     }
     $aBuf2 = $q->loadColumn();
     $q->clear();
     return array_merge($aBuf1, $aBuf2);
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:47,代码来源:projects.class.php


示例20: getStructuredProjects

function getStructuredProjects($original_project_id = 0, $project_status = -1, $active_only = false)
{
    global $AppUI, $st_projects_arr;
    $st_projects = array(0 => '');
    $q = new w2p_Database_Query();
    $q->addTable('projects');
    $q->addJoin('companies', '', 'projects.project_company = company_id', 'inner');
    $q->addQuery('DISTINCT(projects.project_id), project_name, project_parent');
    if ($original_project_id) {
        $q->addWhere('project_original_parent = ' . (int) $original_project_id);
    }
    if ($project_status >= 0) {
        $q->addWhere('project_status = ' . (int) $project_status);
    }
    if ($active_only) {
        $q->addWhere('project_active = 1');
    }
    $q->addOrder('project_start_date, project_end_date');
    $obj = new CCompany();
    $obj->setAllowedSQL($AppUI->user_id, $q);
    $dpt = new CDepartment();
    $dpt->setAllowedSQL($AppUI->user_id, $q);
    $q->leftJoin('project_departments', 'pd', 'pd.project_id = projects.project_id');
    $q->leftJoin('departments', 'd', 'd.dept_id = pd.department_id');
    $st_projects = $q->loadList();
    $tnums = count($st_projects);
    for ($i = 0; $i < $tnums; $i++) {
        $st_project = $st_projects[$i];
        if ($st_project['project_parent'] == $st_project['project_id']) {
            show_st_project($st_project);
            find_proj_child($st_projects, $st_project['project_id']);
        }
    }
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:34,代码来源:cleanup_functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CComponent类代码示例发布时间:2022-05-23
下一篇:
PHP CComboItem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap