当前位置: 首页>>代码示例>>PHP>>正文


PHP CProject::getContacts方法代码示例

本文整理汇总了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 '';
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:34,代码来源:projects.class.php

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

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

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

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

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

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

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


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