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


PHP client::messageSend方法代码示例

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


在下文中一共展示了client::messageSend方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 public function add()
 {
     $form = array('building_id' => '', 'name' => '', 'index' => '', 'img_uri' => '', 'active' => '');
     $errors = $form;
     if ($_POST) {
         $post = new Validation($_POST);
         $post->pre_filter('trim', true);
         $post->add_rules('buildings_id', 'required', 'digit');
         $post->add_rules('name', 'required');
         $post->add_rules('index', 'required');
         $post->add_rules('img_uri', 'required');
         $post->add_rules('active', 'required');
         if ($post->validate()) {
             // check for invilid
             $form = arr::overwrite($form, $post->as_array());
             $people = new Person_Model();
             $result = $people->save($this->input->get('person'), $person_id);
         } else {
             $form = arr::overwrite($form, $post->as_array());
             client::validation_results(arr::overwrite($errors, $post->errors('hiring_employee_form_validations')));
             client::messageSend("There were errors in some fields", E_USER_WARNING);
         }
     }
     $building = new Building_Model();
     $buildings_list = $building->select_list();
     $this->template->title = 'Seating::Spaces::Add';
     $this->template->content = new View('pages/spaces_add');
     $this->template->content->form = $form;
     $this->template->content->buildings_list = $buildings_list;
 }
开发者ID:samkeen,项目名称:Confab-Server,代码行数:30,代码来源:spaces.php

示例2: action_delete

 public function action_delete($delete_id)
 {
     if (!$delete_id) {
         client::messageSend("Invalid Request", E_USER_WARNING);
         $this->request->redirect('markers');
     }
     $marker = ORM::factory('marker')->find($delete_id);
     if ($marker->id) {
         $marker->delete($delete_id);
         client::messageSend('The Marker "' . HTML::chars($marker->email) . '" was removed', E_USER_NOTICE);
     } else {
         client::messageSend("Marker not found", E_USER_WARNING);
     }
     $this->request->redirect('admin/markers');
 }
开发者ID:samkeen,项目名称:spot,代码行数:15,代码来源:markers.php

示例3: action_delete

 public function action_delete($delete_id)
 {
     if (!$delete_id) {
         client::messageSend("Invalid Request", E_USER_WARNING);
         $this->request->redirect('sites');
     }
     $site = ORM::factory('site')->find($delete_id);
     if ($site->id) {
         $site->delete($delete_id);
         client::messageSend('The Site "' . HTML::chars($site->name) . '" was removed', E_USER_NOTICE);
     } else {
         client::messageSend("Site not found", E_USER_WARNING);
     }
     $this->request->redirect('admin/sites');
 }
开发者ID:samkeen,项目名称:spot,代码行数:15,代码来源:sites.php

示例4: action_delete

 public function action_delete($delete_id)
 {
     if (!$delete_id) {
         client::messageSend("Invalid Request", E_USER_WARNING);
         $this->request->redirect('buildings');
     }
     $building = ORM::factory('building')->find($delete_id);
     if ($building->id) {
         $building->delete($delete_id);
         client::messageSend('The Building "' . HTML::chars($building->name) . '" was removed', E_USER_NOTICE);
     } else {
         client::messageSend("Building not found", E_USER_WARNING);
     }
     $this->request->redirect('admin/buildings');
 }
开发者ID:samkeen,项目名称:spot,代码行数:15,代码来源:buildings.php

示例5: logout

 /**
  * note: Route set to /logout
  */
 public function logout()
 {
     $this->bugzilla->logout();
     client::messageSend("You have logged out", E_USER_NOTICE);
     url::redirect('login');
 }
开发者ID:samkeen,项目名称:workermgmt-k,代码行数:9,代码来源:authenticate.php

示例6: notify_buddy

 /**
  * Sends the email to notify the current emp that they are a buddy to this new
  * employee.
  * 
  * @param array $form_input
  * @param Hiring_Model $hiring
  */
 private function notify_buddy($form_input, Hiring_Model $hiring)
 {
     $template = kohana::config('workermgmt.buddy_email_template');
     $email_info['from_address'] = kohana::config('workermgmt.buddy_email_from_address');
     // make sure label is at least an empty string
     $email_info['from_label'] = kohana::config('workermgmt.buddy_email_from_label') ? kohana::config('workermgmt.buddy_email_from_label') : '';
     $email_info['subject'] = kohana::config('workermgmt.buddy_email_subject');
     $email_info['buddy_name'] = isset($form_input['buddy_name']) ? ucwords($form_input['buddy_name']) : null;
     $email_info['buddy_email'] = isset($form_input['buddy']) ? $form_input['buddy'] : null;
     $email_info['newhire_name'] = isset($form_input['fullname']) ? ucwords($form_input['fullname']) : null;
     $email_info['newhire_email'] = isset($form_input['email_address']) ? $form_input['email_address'] : null;
     $email_info['hiring_manager_name'] = isset($form_input['manager_name']) ? $form_input['manager_name'] : null;
     $email_info['hiring_manager_email'] = isset($form_input['manager']) ? $form_input['manager'] : null;
     if (!in_array(null, $email_info, true)) {
         if ($hiring->notify_buddy($template, $email_info)) {
             client::messageSend("The Buddy Notification Email was sent to {$email_info['buddy_email']}", E_USER_NOTICE);
         } else {
             client::messageSend("The Buddy Notification Email was not sent due to and error", E_USER_ERROR);
         }
     } else {
         client::messageSend("The Buddy Notification Email was not sent due to and error", E_USER_ERROR);
         kohana::log('error', "Requiered fields missing for \$email_info\n" . print_r($email_info, true));
     }
 }
开发者ID:samkeen,项目名称:workermgmt-k,代码行数:31,代码来源:hiring.php

示例7: newhire_filing


//.........这里部分代码省略.........
 {
     $result = array('error_code' => null, 'error_message' => null, 'bug_id' => null, 'success_message' => null);
     $filing_response = array();
     switch ($request_type) {
         case self::BUG_EMAIL_SETUP:
             $new_hiring_info['product'] = "mozilla.org";
             $new_hiring_info['component'] = "Server Operations: Account Requests";
             $new_hiring_info['summary'] = "LDAP/Zimbra Account Request - {$input['fullname']} <{$input['username']}@mozilla.com> (" . $input['start_date'] . ")";
             $new_hiring_info['description'] = "Name: {$input['fullname']}\n" . "Username: {$input['username']}\n" . "Type: " . $input['hire_type'] . "\n" . "Manager: {$input['manager_name']}\n" . "Start date: " . $input['start_date'] . "\n";
             if ($input['hire_type'] == 'Intern') {
                 $new_hiring_info['description'] .= "End of Internship: {$input['end_date']}\n";
             }
             $location = $input['location'] == "other" ? $input['location_other'] : $input['location'];
             $new_hiring_info['description'] .= "\nLocation: {$location}";
             if (!empty($input['mail_alias'])) {
                 $new_hiring_info['description'] .= "\nAlias: {$input['mail_alias']}";
             }
             if (!empty($input['mail_lists'])) {
                 $new_hiring_info['description'] .= "\nMailing lists: {$input['mail_lists']}";
             }
             if (!empty($input['other_comments'])) {
                 $new_hiring_info['description'] .= "\nOther comments: {$input['other_comments']}";
             }
             $new_hiring_info['ccs'][] = $input['bz_manager'];
             $new_hiring_info['groups'] = array(self::CODE_EMPLOYEE_HIRING_GROUP);
             $filing_response = $this->file_bug($new_hiring_info);
             break;
         case self::BUG_HARDWARE_REQUEST:
             $new_hiring_info['product'] = "mozilla.org";
             $new_hiring_info['component'] = "Server Operations: Desktop Issues";
             $new_hiring_info['summary'] = "Hardware Request - {$input['fullname']} ({$input['start_date']})";
             $new_hiring_info['description'] = "Name: {$input['fullname']}\n" . "Username: {$input['username']}\n" . "Type: {$input['hire_type']}\n" . "Manager: {$input['manager_name']}\n" . "Start date: {$input['start_date']}\n";
             if ($input['hire_type'] == 'Intern') {
                 $new_hiring_info['description'] .= "End of Internship: {$input['end_date']}\n";
             }
             $location = $input['location'] == "other" ? $input['location_other'] : $input['location'];
             $new_hiring_info['description'] .= "\nLocation: {$location}\n" . "Machine: " . $input['machine_type'] . "\n";
             if (!empty($input['machine_special_requests'])) {
                 $new_hiring_info['description'] .= "\nSpecial Requests: {$input['machine_special_requests']}";
             }
             $new_hiring_info['ccs'][] = $input['bz_manager'];
             $new_hiring_info['groups'] = array(self::CODE_EMPLOYEE_HIRING_GROUP);
             $filing_response = $this->file_bug($new_hiring_info);
             break;
         case self::BUG_NEWHIRE_SETUP:
             $new_hiring_info['product'] = "Mozilla Corporation";
             $new_hiring_info['component'] = "Facilities Management";
             $new_hiring_info['summary'] = "New Hire Notification - {$input['fullname']} ({$input['start_date']})";
             $new_hiring_info['description'] = "Name: {$input['fullname']}\n" . "E-mail: {$input['username']}@mozilla.com\n" . "Type: {$input['hire_type']}\n" . "Manager: {$input['manager_name']} ({$input['manager']})\n" . "Buddy: {$input['buddy_name']} ({$input['buddy']})\n" . "Start date: {$input['start_date']}\n";
             if ($input['hire_type'] == 'Intern') {
                 $new_hiring_info['description'] .= "End of Internship: {$input['end_date']}\n";
             }
             $location = $input['location'] == "other" ? $input['location_other'] : $input['location'];
             $new_hiring_info['description'] .= "\nLocation: {$location}\n";
             $new_hiring_info['ccs'][] = "accounting@mozilla.com";
             $new_hiring_info['ccs'][] = $input['bz_manager'];
             $new_hiring_info['groups'] = array(self::CODE_EMPLOYEE_HIRING_GROUP);
             $filing_response = $this->file_bug($new_hiring_info);
             break;
         case self::BUG_HR_CONTRACTOR:
             $new_hiring_info['product'] = "Mozilla Corporation";
             $new_hiring_info['component'] = "Consulting";
             $summary_2nd_half = $input['org_name'] !== null ? $input['org_name'] : $input['fullname'];
             $new_hiring_info['summary'] = "Contractor Request - {$summary_2nd_half} ({$input['start_date']})";
             $org_string = $input['org_name'] !== null ? "Organization Name: {$input['org_name']}\n" : "";
             $new_hiring_info['description'] = $org_string;
             $contact_string = !empty($input['org_name']) ? "Contact: {$input['fullname']}\n" : "Name: {$input['fullname']}\n";
             $new_hiring_info['description'] .= $contact_string . "Address: " . $input['address'] . "\n" . "Phone: " . $input['phone_number'] . "\n" . "E-mail: " . $input['email_address'] . "\n" . "Start of contract: " . $input['start_date'] . "\n" . "End of contract: " . $input['end_date'] . "\n" . "Rate of pay: " . $input['pay_rate'] . "\n" . "Total payment limitation: " . $input['payment_limit'] . "\n" . "Manager: {$input['manager_name']}\n";
             $location = $input['location'] == "other" ? $input['location_other'] : $input['location'];
             $new_hiring_info['description'] .= "\nLocation: {$location}\n" . "Type: " . $input['contract_type'] . "\n" . "Category: " . $input['contractor_category'] . "\n\n" . "Statement of work:\n" . $input['statement_of_work'] . "\n";
             $new_hiring_info['ccs'][] = "accounting@mozilla.com";
             $new_hiring_info['ccs'][] = $input['bz_manager'];
             $new_hiring_info['groups'] = array(self::CODE_CONTRACTOR_HIRING_GROUP);
             $filing_response = $this->file_bug($new_hiring_info);
             break;
         default:
             Kohana::log('error', "Urecognized Filing reqest type [{$request_type}]", E_USER_ERROR);
             break;
     }
     kohana::log('debug', "\$filing_response:" . print_r($filing_response, 1));
     $error_code = isset($filing_response['faultCode']) ? $filing_response['faultCode'] : null;
     $error_message = isset($filing_response['faultString']) ? $filing_response['faultString'] : null;
     if ($error_message) {
         $result['error_code'] = $error_code;
         $result['error_message'] = $error_message;
     }
     /**
      * if we get error code CODE_LOGIN_REQUIRED (login required), no need to try the
      * rest of these, just redrect to login.php
      */
     if ($result['error_code'] && $result['error_code'] == self::CODE_LOGIN_REQUIRED) {
         client::messageSend($result['error_message'], E_USER_ERROR);
         url::redirect('login');
     }
     if (isset($filing_response['id'])) {
         $result['bug_id'] = isset($filing_response['id']) ? $filing_response['id'] : null;
         $result['success_message'] = sprintf($this->bug_filing_types[$request_type]['success_message'], $this->config['bugzilla_url'], $result['bug_id'], $result['bug_id']);
     }
     return $result;
 }
开发者ID:samkeen,项目名称:workermgmt-k,代码行数:101,代码来源:Bugzilla.php


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