本文整理汇总了PHP中CProject::getContacts方法的典型用法代码示例。如果您正苦于以下问题:PHP CProject::getContacts方法的具体用法?PHP CProject::getContacts怎么用?PHP CProject::getContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CProject
的用法示例。
在下文中一共展示了CProject::getContacts方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notifyContacts
public function notifyContacts($isNotNew)
{
global $AppUI, $w2Pconfig, $locale_char_set;
$subject = intval($isNotNew) ? "Project Updated: {$this->project_name} " : "Project Submitted: {$this->project_name} ";
$users = CProject::getContacts($AppUI, $this->project_id);
if (count($users)) {
if (intval($isNotNew)) {
$body = $AppUI->_('Project') . ": {$this->project_name} Has Been Updated Via Project Manager. You can view the Project by clicking: ";
} else {
$body = $AppUI->_('Project') . ": {$this->project_name} Has Been Submitted Via Project Manager. You can view the Project by clicking: ";
}
$body .= "\n" . $AppUI->_('URL') . ': ' . w2PgetConfig('base_url') . '/index.php?m=projects&a=view&project_id=' . $this->project_id;
$body .= "\n\n(You are receiving this message because you are a contact or assignee for this Project)";
$body .= "\n\n" . $AppUI->_('Description') . ':' . "\n{$this->project_description}";
if (intval($isNotNew)) {
$body .= "\n\n" . $AppUI->_('Updater') . ': ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name;
} else {
$body .= "\n\n" . $AppUI->_('Creator') . ': ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name;
}
if ($this->_message == 'deleted') {
$body .= "\n\nProject " . $this->project_name . ' was ' . $this->_message . ' by ' . $AppUI->user_first_name . ' ' . $AppUI->user_last_name;
}
foreach ($users as $row) {
$mail = new w2p_Utilities_Mail();
$mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : '');
$mail->Subject($subject, $locale_char_set);
if ($mail->ValidEmail($row['contact_email'])) {
$mail->To($row['contact_email'], true);
$mail->Send();
}
}
}
return '';
}
示例2: w2p_Utilities_Date
$start_date = new w2p_Utilities_Date($project->project_start_date);
$end_date = intval($project->project_end_date) ? new w2p_Utilities_Date($project->project_end_date) : null;
$actual_end_date = intval($criticalTasks[0]['task_end_date']) ? new w2p_Utilities_Date($criticalTasks[0]['task_end_date']) : null;
$style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
// setup the title block
$ttl = $project_id > 0 ? 'Edit Project' : 'New Project';
$titleBlock = new CTitleBlock($ttl, 'applet3-48.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=projects', 'projects list');
if ($project_id != 0) {
$titleBlock->addCrumb('?m=projects&a=view&project_id=' . $project_id, 'view this project');
}
$titleBlock->show();
// Get contacts list
$selected_contacts = array();
if ($project_id) {
$myContacts = CProject::getContacts($AppUI, $project_id);
$selected_contacts = array_keys($myContacts);
}
if ($project_id == 0 && $contact_id > 0) {
$selected_contacts[] = '' . $contact_id;
}
// Get the users notification options
$tl = $AppUI->getPref('TASKLOGEMAIL');
$ta = $tl & 1;
$tt = $tl & 2;
$tp = $tl & 4;
?>
<script language="javascript" type="text/javascript">
function setColor(color) {
var f = document.editFrm;
示例3:
}
echo '</div>';
}
?>
</td>
</tr>
<?php
}
$contacts = $obj->getContacts($AppUI, $task_id);
if (count($contacts)) {
echo '<tr><td><strong>' . $AppUI->_('Task Contacts') . '</strong></td></tr>';
echo '<tr><td colspan="3" class="hilite">';
echo w2p_Output_HTMLHelper::renderContactList($AppUI, $contacts);
echo '</td></tr>';
}
$contacts = CProject::getContacts($AppUI, $obj->task_project);
if (count($contacts)) {
echo '<tr><td><strong>' . $AppUI->_('Project Contacts') . '</strong></td></tr>';
echo '<tr><td colspan="3" class="hilite">';
echo w2p_Output_HTMLHelper::renderContactList($AppUI, $contacts);
echo '</td></tr>';
}
?>
<tr>
<td colspan="3">
<?php
$custom_fields = new w2p_Core_CustomFields($m, $a, $obj->task_id, 'view');
$custom_fields->printHTML();
?>
</td>
</tr>
示例4: notifyContacts
public function notifyContacts($isNotNew)
{
$subject = intval($isNotNew) ? "Project Updated: {$this->project_name} " : "Project Submitted: {$this->project_name} ";
$users = CProject::getContacts($this->_AppUI, $this->project_id);
if (count($users)) {
$emailManager = new w2p_Output_EmailManager($this->_AppUI);
$body = $emailManager->getProjectNotify($this, $isNotNew);
foreach ($users as $row) {
$mail = new w2p_Utilities_Mail();
$mail->To($row['contact_email'], true);
$mail->Subject($subject);
$mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : '');
$mail->Send();
}
}
return '';
}
示例5: foreach
<tr>
<td><strong><?php
echo $AppUI->_('Departments');
?>
</strong></td>
</tr>
<tr>
<td colspan='3' class="hilite">
<?php
foreach ($depts as $dept_id => $dept_info) {
echo '<div>' . $dept_info['dept_name'];
if ($dept_info['dept_phone'] != '') {
echo '( ' . $dept_info['dept_phone'] . ' )';
}
echo '</div>';
}
?>
</td>
</tr>
<?php
}
$contacts = CProject::getContacts($AppUI, $obj->project_id);
if (count($contacts)) {
echo '<tr><td><strong>' . $AppUI->_('Project Contacts') . '</strong></td></tr>';
echo '<tr><td colspan="3" class="hilite">';
echo w2p_Output_HTMLHelper::renderContactList($AppUI, $contacts);
echo '</td></tr>';
}
?>
</table>
</td>
示例6: executePost
/**
* Post Request Handler
*
* This method is called when a request is a POST
*
* @return array
*/
public function executePost()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
$username = $this->getParam('username');
$password = $this->getParam('password');
$project_id = $this->getParam('project_id', self::TYPE_INT);
// Attempt to login as user, a little bit of a hack as we currently
// require the $_POST['login'] var to be set as well as a global AppUI
$AppUI = new CAppUI();
$GLOBALS['AppUI'] = $AppUI;
$_POST['login'] = 'login';
if (!$AppUI->login($username, $password)) {
throw new Frapi_Error('INVALID_LOGIN');
}
$post_data = array('dosql' => 'do_project_aed', 'project_id' => $project_id, 'project_creator' => $this->getParam('project_creator'), 'project_contacts' => $this->getParam('project_contacts'), 'project_name' => $this->getParam('project_name'), 'project_parent' => $this->getParam('project_parent'), 'project_owner' => $this->getParam('project_owner'), 'project_company' => $this->getParam('project_company'), 'project_location' => $this->getParam('project_location'), 'project_start_date' => $this->getParam('project_start_date'), 'project_end_date' => $this->getParam('project_end_date'), 'project_target_budget' => $this->getParam('project_target_budget'), 'project_actual_budget' => $this->getParam('project_actual_budget'), 'project_url' => $this->getParam('project_url'), 'project_demo_url' => $this->getParam('project_demo_url'), 'project_priority' => $this->getParam('project_priority'), 'project_short_name' => $this->getParam('project_short_name'), 'project_color_identifier' => $this->getParam('project_color_identifier'), 'project_type' => $this->getParam('project_type'), 'project_status' => $this->getParam('project_status'), 'project_description' => $this->getParam('project_description'), 'project_departments' => $this->getParam('project_departments', self::TYPE_ARRAY), 'project_contacts' => implode(',', $this->getParam('project_contacts', self::TYPE_ARRAY)), 'project_active' => $this->getParam('project_active'));
$project = new CProject();
$project->bind($post_data);
$error_array = $project->store($AppUI);
// Return all the validation messages
if ($error_array !== true) {
$error_message = '';
if (is_array($error_array)) {
foreach ($error_array as $error) {
$error_message .= $error . '. ';
}
throw new Frapi_Error('SAVE_ERROR', $error_message);
} else {
throw new Frapi_Error('SAVE_ERROR');
}
}
$project = (array) $project;
$project_contacts = CProject::getContacts($AppUI, $project_id);
$project['project_contacts'] = array();
foreach ($project_contacts as $key => $value) {
$project['project_contacts'][] = $value['contact_id'];
}
// Remove the data that is not for display
unset($project['_tbl_prefix'], $project['_tbl'], $project['_tbl_key'], $project['_error'], $project['_query'], $project['_tbl_module']);
$this->data['project'] = $project;
$this->data['success'] = true;
$this->setTemplateFileName('Project');
return $this->toArray();
}
示例7: testGetContacts
/**
* Tests finding contacts of project that does have contact
*/
public function testGetContacts()
{
global $AppUI;
$contacts = CProject::getContacts($AppUI, 1);
$this->assertEquals(1, count($contacts));
$this->assertEquals(1, $contacts[1]['contact_id']);
$this->assertEquals('Admin', $contacts[1]['contact_first_name']);
$this->assertEquals('Person', $contacts[1]['contact_last_name']);
$this->assertEquals('', $contacts[1]['contact_order_by']);
$this->assertEquals('', $contacts[1]['dept_name']);
$this->assertEquals(1, $contacts[1][0]);
$this->assertEquals('Admin', $contacts[1][1]);
$this->assertEquals('Person', $contacts[1][2]);
$this->assertEquals('', $contacts[1][3]);
$this->assertEquals('', $contacts[1][4]);
}
示例8: testGetContacts
/**
* Tests finding contacts of project that does have contact
*/
public function testGetContacts()
{
global $AppUI;
$contacts = CProject::getContacts($AppUI, 1);
$this->assertEquals(1, count($contacts));
$this->assertEquals(1, $contacts[1]['contact_id']);
$this->assertEquals('Admin', $contacts[1]['contact_first_name']);
$this->assertEquals('Person', $contacts[1]['contact_last_name']);
$this->assertEquals('contact1@example.org', $contacts[1]['contact_email']);
$this->assertEquals('1.999.999.9999', $contacts[1]['contact_phone']);
$this->assertEquals('', $contacts[1]['dept_name']);
$this->assertEquals(1, $contacts[1][0]);
$this->assertEquals('Admin', $contacts[1][1]);
$this->assertEquals('Person', $contacts[1][2]);
$this->assertEquals('contact1@example.org', $contacts[1][3]);
$this->assertEquals('1.999.999.9999', $contacts[1][4]);
$this->assertEquals('', $contacts[1][5]);
}