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


PHP Environment::getBaseURL方法代码示例

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


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

示例1: smarty_function_EmbeddedDocumentAttachmentList

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_function_EmbeddedDocumentAttachmentList($params, &$smarty)
{
    $object_type_id = $params['object_type_id'];
    $object_id = $params['object_id'];
    $height = $params['height'];
    if (empty($height)) {
        $height = 75;
    }
    $url = URLBuilder::getURL(array('object_type_id' => $object_type_id, 'object_id' => $object_id), Environment::getBaseURL() . '/document/EmbeddedDocumentAttachmentList.php');
    $retval = '<iframe style="width:100%; height:' . $height . 'px; border: 5px" id="DocumentAttachmentFactory" name="DocumentAttachmentFactory" src="' . $url . '"></iframe>';
    return $retval;
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:17,代码来源:function.embeddeddocumentattachmentlist.php

示例2: smarty_function_EmbeddedMessageList

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_function_EmbeddedMessageList($params, &$smarty)
{
    $object_type_id = $params['object_type_id'];
    $object_id = $params['object_id'];
    $height = $params['height'];
    if (empty($height)) {
        $height = 250;
    }
    //urlbuilder script="../message/EmbeddedMessageList.php" values="object_type_id=10,object_id=$default_schedule_control_id" merge="FALSE"}
    $url = URLBuilder::getURL(array('object_type_id' => $object_type_id, 'object_id' => $object_id), Environment::getBaseURL() . '/message/EmbeddedMessageList.php');
    //$retval = '<iframe style="width:100%; height:'.$height.'px; border: 0px" id="MessageFactory" name="MessageFactory" src="'.$url.'#form_start"></iframe>';
    $retval = '<iframe style="width:100%; height:' . $height . 'px; border: 5px" id="MessageFactory" name="MessageFactory" src="' . $url . '"></iframe>';
    return $retval;
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:19,代码来源:function.embeddedmessagelist.php

示例3: smarty_function_LayerMessageList

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_function_LayerMessageList($params, &$smarty)
{
    $object_type_id = $params['object_type_id'];
    $object_id = $params['object_id'];
    $height = $params['height'];
    if ($object_type_id == '') {
        return FALSE;
    }
    if ($object_id == '') {
        return FALSE;
    }
    if (empty($height)) {
        $height = 335;
    }
    $url = URLBuilder::getURL(array('template' => 1, 'object_type_id' => $object_type_id, 'object_id' => $object_id), Environment::getBaseURL() . '/message/EmbeddedMessageList.php');
    $retval = '
<div id="MessageFactoryLayer" style="background:#000000;visibility:hidden; position: absolute; left: 5000px; top: 130px; width: 90%; height:' . $height . 'px">
<div id="rowContent">
  <div id="titleTab"><div class="textTitle"><span class="textTitleSub">Messages</span></div></div>
</div>
<div id="rowContentInner">
	<div id="contentBoxTwoEdit">
			<table class="tblList">
				<tr>
					<td>
    ';
    $retval .= '<iframe style="width:100%; height:' . $height . 'px; border: 5px" id="LayerMessageFactoryFrame" name="LayerMessageFactoryFrame" src="' . $url . '"></iframe>';
    $retval .= '
					</td>
				</tr>
			</table>
	</div>
</div>
</div>
';
    return $retval;
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:42,代码来源:function.layermessagelist.php

示例4: getBaseURL

 function getBaseURL()
 {
     return Environment::getBaseURL();
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:APIEnvironment.class.php

示例5: unset

     if (isset($pref_data['enable_email_notification_message'])) {
         $upf->setEnableEmailNotificationMessage(TRUE);
     } else {
         $upf->setEnableEmailNotificationMessage(FALSE);
     }
     if (isset($pref_data['enable_email_notification_home'])) {
         $upf->setEnableEmailNotificationHome(TRUE);
     } else {
         $upf->setEnableEmailNotificationHome(FALSE);
     }
     if ($upf->isValid()) {
         $upf->Save(FALSE);
         if ($current_user->getId() == $upf->getUser()) {
             TTi18n::setLocaleCookie($pref_data['language'] . '_' . $current_user->getCountry());
         }
         Redirect::Page(URLBuilder::getURL(array('user_id' => $pref_data['user_id'], 'data_saved' => 1), Environment::getBaseURL() . '/users/EditUserPreference.php'));
         unset($upf);
         break;
     }
 default:
     if (!isset($user_id) or isset($user_id) and $user_id == '') {
         $user_id = $current_user->getId();
     }
     $ulf->getByIdAndCompanyId($user_id, $current_company->getId());
     if ($ulf->getRecordCount() > 0) {
         $user_obj = $ulf->getCurrent();
     }
     if (!isset($action)) {
         BreadCrumb::setCrumb($title);
         $uplf = TTnew('UserPreferenceListFactory');
         $uplf->getByUserIDAndCompanyID($user_id, $current_company->getId());
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:EditUserPreference.php

示例6: elseif

     } elseif ($bank_data['company_id'] != '' and $bank_data['user_id'] == '' and $permission->Check('company', 'edit_own_bank')) {
         Debug::Text('Specified Company', __FILE__, __LINE__, __METHOD__, 10);
         //Company bank.
         $baf->setCompany($bank_data['company_id']);
         $redirect_arr = array('company_id' => $company_id, 'data_saved' => TRUE);
     } else {
         $permission->Redirect(FALSE);
     }
     if (isset($bank_data['institution'])) {
         $baf->setInstitution($bank_data['institution']);
     }
     $baf->setTransit($bank_data['transit']);
     $baf->setAccount($bank_data['account']);
     if ($baf->isValid()) {
         $baf->Save();
         Redirect::Page(URLBuilder::getURL($redirect_arr, Environment::getBaseURL() . '/bank_account/EditBankAccount.php'));
         break;
     } else {
         Debug::Text('Invalid bank data...', __FILE__, __LINE__, __METHOD__, 10);
     }
 default:
     $balf = TTnew('BankAccountListFactory');
     $ulf = TTnew('UserListFactory');
     $country = NULL;
     if (($user_id == '' or $user_id == $current_user->getId()) and $company_id == '' and $permission->Check('user', 'edit_own_bank')) {
         //Current user
         $balf->getUserAccountByCompanyIdAndUserId($current_company->getId(), $current_user->getId());
         $user_id = $current_user->getId();
         $user_obj = $ulf->getByIdAndCompanyId($user_id, $current_company->getId())->getCurrent();
         $country = $user_obj->getCountry();
     } elseif ($user_id != '' and $permission->Check('user', 'edit_bank')) {
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:EditBankAccount.php

示例7: getScheduleIcalendarURL

 function getScheduleIcalendarURL($user_name = NULL, $type_id = NULL)
 {
     if ($user_name == '') {
         $user_name = $this->getUserObject()->getUserName();
     }
     if ($type_id == '') {
         $type_id = $this->getScheduleIcalendarType();
     }
     $retval = Environment::getBaseURL() . 'ical/ical.php';
     if ($type_id == 2) {
         $retval .= '?u=' . $user_name . '&k=' . $this->getScheduleIcalendarKey();
     }
     return $retval;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:14,代码来源:UserPreferenceFactory.class.php

示例8: scheduleFooter

 function scheduleFooter()
 {
     global $config_vars;
     $margins = $this->pdf->getMargins();
     //Don't scale footer text lines as they aren't that important anyways.
     $this->pdf->SetFont($this->config['other']['default_font'], '', 8);
     //Save x,y and restore after footer is set.
     $x = $this->pdf->getX();
     $y = $this->pdf->getY();
     //Jump to end of page.
     if ($this->pdf->getPageHeight() - $margins['bottom'] - $margins['top'] - 15 > $y) {
         $this->pdf->setY($this->pdf->getPageHeight() - $margins['bottom'] - $margins['top'] - 15);
     }
     $company_obj = $this->getUserObject()->getCompanyObject();
     if (is_object($company_obj) and $company_obj->getProductEdition() > 10) {
         if ($config_vars['other']['force_ssl'] == 1) {
             $protocol = 'https';
         } else {
             $protocol = 'http';
         }
         $url = $protocol . '://' . Misc::getHostName() . Environment::getBaseURL() . 'ical/ical.php';
         $this->pdf->Cell($this->pdf->getPageWidth() - $margins['right'] - $margins['left'], 5, TTi18n::getText('Synchronize this schedule to your desktop/mobile phone calendar application') . ': ' . $url, 1, 0, 'C', 0, NULL, 1);
         $this->pdf->Ln();
     }
     $this->pdf->SetFont($this->config['other']['default_font'], '', 8);
     $this->pdf->Cell($this->pdf->getPageWidth() - $margins['right'], 5, TTi18n::getText('Page') . ' ' . $this->pdf->PageNo() . ' of ' . $this->pdf->getAliasNbPages(), 0, 0, 'C', 0);
     $this->pdf->Ln();
     $this->pdf->SetFont($this->config['other']['default_font'], '', 6);
     $this->pdf->Cell($this->pdf->getPageWidth() - $margins['right'], 5, TTi18n::gettext('Report Generated By') . ' ' . APPLICATION_NAME . ' v' . APPLICATION_VERSION . ' @ ' . TTDate::getDate('DATE+TIME', $this->start_time), 0, 0, 'C', 0);
     $this->pdf->setX($x);
     $this->pdf->setY($y);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:33,代码来源:ScheduleSummaryReport.class.php

示例9: sendCompanyVersionData

 function sendCompanyVersionData($company_id)
 {
     Debug::Text('Sending Company Version Data...', __FILE__, __LINE__, __METHOD__, 10);
     $cf = TTnew('CompanyFactory');
     $tt_version_data['registration_key'] = $this->getLocalRegistrationKey();
     $tt_version_data['company_id'] = $company_id;
     $sslf = TTnew('SystemSettingListFactory');
     $sslf->getByName('system_version');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['system_version'] = $sslf->getCurrent()->getValue();
     }
     $sslf->getByName('tax_engine_version');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['tax_engine_version'] = $sslf->getCurrent()->getValue();
     }
     $sslf->getByName('tax_data_version');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['tax_data_version'] = $sslf->getCurrent()->getValue();
     }
     $sslf->getByName('schema_version_group_A');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['schema_version']['A'] = $sslf->getCurrent()->getValue();
     }
     $sslf->getByName('schema_version_group_B');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['schema_version']['B'] = $sslf->getCurrent()->getValue();
     }
     $sslf->getByName('schema_version_group_T');
     if ($sslf->getRecordCount() == 1) {
         $tt_version_data['schema_version']['T'] = $sslf->getCurrent()->getValue();
     }
     if (isset($_SERVER['SERVER_SOFTWARE'])) {
         $server_software = $_SERVER['SERVER_SOFTWARE'];
     } else {
         $server_software = 'N/A';
     }
     if (isset($_SERVER['SERVER_NAME'])) {
         $server_name = $_SERVER['SERVER_NAME'];
     } else {
         $server_name = 'N/A';
     }
     $db_server_info = $cf->db->ServerInfo();
     $sys_version_data = array('php_version' => phpversion(), 'zend_version' => zend_version(), 'web_server' => $server_software, 'database_type' => $cf->db->databaseType, 'database_version' => $db_server_info['version'], 'database_description' => $db_server_info['description'], 'server_name' => $server_name, 'base_url' => Environment::getBaseURL(), 'php_os' => PHP_OS, 'system_information' => php_uname());
     $version_data = array_merge($tt_version_data, $sys_version_data);
     if (isset($version_data) and is_array($version_data)) {
         Debug::Text('Sent Company Version Data!', __FILE__, __LINE__, __METHOD__, 10);
         $retval = $this->getSoapObject()->saveCompanyVersionData($version_data);
         if ($retval == FALSE) {
             Debug::Text('Server failed saving data!', __FILE__, __LINE__, __METHOD__, 10);
         }
         //$this->printSoapDebug();
         return $retval;
     }
     Debug::Text('NOT Sending Company Version Data!', __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:56,代码来源:TimeTrexSoapClient.class.php

示例10: destroyCookie

 function destroyCookie()
 {
     setcookie('StationID', NULL, time() + 9999999, Environment::getBaseURL());
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:StationFactory.class.php

示例11: sendPasswordResetEmail

    function sendPasswordResetEmail()
    {
        global $config_vars;
        if ($this->getHomeEmail() != FALSE or $this->getWorkEmail() != FALSE) {
            if ($this->getWorkEmail() != FALSE) {
                $primary_email = $this->getWorkEmail();
                if ($this->getHomeEmail() != FALSE) {
                    $secondary_email = $this->getHomeEmail();
                } else {
                    $secondary_email = NULL;
                }
            } else {
                $primary_email = $this->getHomeEmail();
                $secondary_email = NULL;
            }
            $this->setPasswordResetKey(md5(uniqid()));
            $this->setPasswordResetDate(time());
            $this->Save(FALSE);
            if ($config_vars['other']['force_ssl'] == 1) {
                $protocol = 'https';
            } else {
                $protocol = 'http';
            }
            $subject = 'Password Reset requested at ' . TTDate::getDate('DATE+TIME', time()) . ' from ' . $_SERVER['REMOTE_ADDR'];
            $body = '
			<html><body>
			If you did not request your password to be reset, you may ignore this email.
			<br>
			<br>
			If you did request the password for ' . $this->getUserName() . ' to be reset,
			please click <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getBaseURL() . 'ForgotPassword.php?action:password_reset=null&key=' . $this->getPasswordResetKey() . '">here</a>
			</body></html>
			';
            //Debug::Text('Emailing Report to: '. $this->getUserName() .' Email: '. $primary_email , __FILE__, __LINE__, __METHOD__,10);
            //Debug::Arr($body, 'Email Report', __FILE__, __LINE__, __METHOD__,10);
            //echo "<pre>$body</pre><br>\n";
            //$retval = -->liam<--($primary_email, $subject, $body, "MIME-Version: 1.0\nContent-type: text/html; charset=iso-8859-1\nFrom: \"TimeTrex - Password Reset\"<DoNotReply@".Misc::getHostName().">\nCc: ". $secondary_email ."\n");
            //Debug::Text('Mail() result: '. (int)$retval, __FILE__, __LINE__, __METHOD__,10);
            TTLog::addEntry($this->getId(), 500, TTi18n::getText('Employee Password Reset By') . ': ' . $_SERVER['REMOTE_ADDR'] . ' ' . TTi18n::getText('Key') . ': ' . $this->getPasswordResetKey(), NULL, $this->getTable());
            $headers = array('From' => '"TimeTrex - Password Reset"<DoNotReply@' . Misc::getHostName(FALSE) . ">", 'Subject' => $subject, 'Cc' => $secondary_email, 'MIME-Version' => '1.0', 'Content-type' => 'text/html; charset=iso-8859-1');
            $mail = new TTMail();
            $mail->setTo($primary_email);
            $mail->setHeaders($headers);
            $mail->setBody($body);
            $retval = $mail->Send();
            return $retval;
        }
        return FALSE;
    }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:49,代码来源:UserFactory.class.php

示例12: emailMessage

 function emailMessage()
 {
     Debug::Text('emailMessage: ', __FILE__, __LINE__, __METHOD__, 10);
     $email_to_arr = $this->getEmailMessageAddresses();
     if ($email_to_arr == FALSE) {
         return FALSE;
     }
     $from = $reply_to = 'DoNotReply@' . Misc::getHostName(FALSE);
     global $current_user, $config_vars;
     if (is_object($current_user) and $current_user->getWorkEmail() != '') {
         $reply_to = $current_user->getWorkEmail();
     }
     Debug::Text('From: ' . $from . ' Reply-To: ' . $reply_to, __FILE__, __LINE__, __METHOD__, 10);
     $to = array_shift($email_to_arr);
     Debug::Text('To: ' . $to, __FILE__, __LINE__, __METHOD__, 10);
     if (is_array($email_to_arr) and count($email_to_arr) > 0) {
         $bcc = implode(',', $email_to_arr);
     } else {
         $bcc = NULL;
     }
     $email_subject = TTi18n::gettext('New message waiting in') . ' ' . APPLICATION_NAME;
     $email_body = TTi18n::gettext('*DO NOT REPLY TO THIS EMAIL - PLEASE USE THE LINK BELOW INSTEAD*') . "\n\n";
     $email_body .= TTi18n::gettext('You have a new message waiting for you in') . ' ' . APPLICATION_NAME . "\n";
     if ($this->getSubject() != '') {
         $email_body .= TTi18n::gettext('Subject:') . ' ' . $this->getSubject() . "\n";
     }
     $protocol = 'http';
     if (isset($config_vars['other']['force_ssl']) and $config_vars['other']['force_ssl'] == 1) {
         $protocol .= 's';
     }
     $email_body .= TTi18n::gettext('Link:') . ' <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getBaseURL() . '">' . APPLICATION_NAME . ' ' . TTi18n::getText('Login') . '</a>';
     //Define subject/body variables here.
     $search_arr = array('#employee_first_name#', '#employee_last_name#');
     $replace_arr = array(NULL, NULL);
     $subject = str_replace($search_arr, $replace_arr, $email_subject);
     Debug::Text('Subject: ' . $subject, __FILE__, __LINE__, __METHOD__, 10);
     $headers = array('From' => $from, 'Subject' => $subject, 'Bcc' => $bcc, 'Reply-To' => $reply_to, 'Return-Path' => $reply_to, 'Errors-To' => $reply_to);
     Debug::Arr($headers, 'Headers: ', __FILE__, __LINE__, __METHOD__, 10);
     $body = '<pre>' . str_replace($search_arr, $replace_arr, $email_body) . '</pre>';
     Debug::Text('Body: ' . $body, __FILE__, __LINE__, __METHOD__, 10);
     $mail = new TTMail();
     $mail->setTo($to);
     $mail->setHeaders($headers);
     @$mail->getMIMEObject()->setHTMLBody($body);
     $mail->setBody($mail->getMIMEObject()->get());
     $retval = $mail->Send();
     if ($retval == TRUE) {
         TTLog::addEntry($this->getId(), 500, TTi18n::getText('Email Message to') . ': ' . $to . ' Bcc: ' . $headers['Bcc'], NULL, $this->getTable());
         return TRUE;
     }
     return TRUE;
     //Always return true
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:53,代码来源:MessageFactory.class.php

示例13: getLink


//.........这里部分代码省略.........
             break;
         case 'pay_period_schedule':
             $link = 'payperiod/EditPayPeriodSchedule.php?id=' . $this->getObject();
             break;
         case 'pay_period_time_sheet_verify':
             break;
         case 'pay_stub':
             break;
         case 'pay_stub_amendment':
             $link = 'pay_stub_amendment/EditPayStubAmendment.php?id=' . $this->getObject();
             break;
         case 'pay_stub_entry_account':
             $link = 'pay_stub/EditPayStubEntryAccount.php?id=' . $this->getObject();
             break;
         case 'pay_stub_entry_account_link':
             break;
         case 'recurring_holiday':
             $link = 'policy/EditRecurringHoliday.php?id=' . $this->getObject();
             break;
         case 'recurring_ps_amendment':
             $link = 'pay_stub_amendment/EditRecurringPayStubAmendment.php?id=' . $this->getObject();
             break;
         case 'recurring_schedule_control':
             $link = 'schedule/EditRecurringSchedule.php?id=' . $this->getObject();
             break;
         case 'recurring_schedule_template_control':
             $link = 'schedule/EditRecurringScheduleTemplate.php?id=' . $this->getObject();
             break;
         case 'user_date_total':
             break;
         case 'user_default':
             $link = 'users/EditUserDefault.php?id=' . $this->getObject();
             break;
         case 'user_generic_data':
             break;
         case 'user_preference':
             $link = 'users/EditUserPreference.php?user_id=' . $this->getObject();
             break;
         case 'users':
             $link = 'users/EditUser.php?id=' . $this->getObject();
             break;
         case 'company_deduction':
             $link = 'company/EditCompanyDeduction.php?id=' . $this->getObject();
             break;
         case 'user_deduction':
             $link = 'users/EditUserDeduction.php?id=' . $this->getObject();
             break;
         case 'user_title':
             $link = 'users/EditUserTitle.php?id=' . $this->getObject();
             break;
         case 'user_wage':
             $link = 'users/EditUserWage.php?id=' . $this->getObject();
             break;
         case 'job':
             $link = 'job/EditJob.php?id=' . $this->getObject();
             break;
         case 'job_item':
             $link = 'job_item/EditJobItem.php?id=' . $this->getObject();
             break;
         case 'job_item_amendment':
             $link = 'job_item/EditJobItemAmendment.php?id=' . $this->getObject();
             break;
         case 'document':
             $link = 'document/EditDocument.php?document_id=' . $this->getObject();
             break;
         case 'document_revision':
             break;
         case 'client':
             $link = 'client/EditClient.php?client_id=' . $this->getObject();
             break;
         case 'client_contact':
             $link = 'client/EditClientContact.php?id=' . $this->getObject();
             break;
         case 'client_payment':
             $link = 'client/EditClientPayment.php?id=' . $this->getObject();
             break;
         case 'invoice':
             $link = 'invoice/EditInvoice.php?id=' . $this->getObject();
             break;
         case 'invoice_config':
             $link = 'invoice/EditInvoiceConfig.php';
             break;
         case 'invoice_transaction':
             $link = 'invoice/EditTransaction.php?id=' . $this->getObject();
             break;
         case 'product':
             $link = 'product/EditProduct.php?id=' . $this->getObject();
             break;
         case 'tax_area_policy':
             $link = 'invoice_policy/EditTaxAreaPolicy.php?id=' . $this->getObject();
             break;
         case 'tax_policy':
             $link = 'invoice_policy/EditTaxPolicy.php?id=' . $this->getObject();
             break;
     }
     if ($link !== FALSE) {
         $link = Environment::getBaseURL() . $link;
     }
     return $link;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:LogFactory.class.php

示例14: elseif

                 $psenaf->setId($value_arr['id']);
             }
             $psenaf->setCompany($current_company->getId());
             $psenaf->setPayStubEntryNameId($pay_stub_entry_name_id);
             $psenaf->setDebitAccount($value_arr['debit_account']);
             $psenaf->setCreditAccount($value_arr['credit_account']);
             if ($psenaf->isValid()) {
                 $psenaf->Save();
             }
         } elseif (isset($value_arr['id']) and $value_arr['id'] != '' and $value_arr['debit_account'] == '' and $value_arr['credit_account'] == '') {
             Debug::Text('Delete: ', __FILE__, __LINE__, __METHOD__, 10);
         }
     }
     //$psenaf->FailTransaction();
     $psenaf->CommitTransaction();
     Redirect::Page(URLBuilder::getURL(NULL, Environment::getBaseURL() . '/pay_stub/EditPayStubEntryNameAccount.php'));
     break;
 default:
     if (!isset($action)) {
         BreadCrumb::setCrumb($title);
         $psenalf = new PayStubEntryNameAccountListFactory();
         $psenalf->getByCompanyId($current_company->getId());
         foreach ($psenalf as $name_account_obj) {
             //Debug::Arr($department,'Department', __FILE__, __LINE__, __METHOD__,10);
             $name_account_data[$name_account_obj->getPayStubEntryNameId()] = array('id' => $name_account_obj->getId(), 'pay_stub_entry_name_id' => $name_account_obj->getPayStubEntryNameId(), 'debit_account' => $name_account_obj->getDebitAccount(), 'credit_account' => $name_account_obj->getCreditAccount(), 'created_date' => $name_account_obj->getCreatedDate(), 'created_by' => $name_account_obj->getCreatedBy(), 'updated_date' => $name_account_obj->getUpdatedDate(), 'updated_by' => $name_account_obj->getUpdatedBy(), 'deleted_date' => $name_account_obj->getDeletedDate(), 'deleted_by' => $name_account_obj->getDeletedBy());
         }
         //Get all accounts
         $psenlf = new PayStubEntryNameListFactory();
         $psenlf->getAll();
         $type_options = $psenlf->getOptions('type');
         $i = 0;
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:EditPayStubEntryNameAccount.php

示例15: sendPasswordResetEmail

 function sendPasswordResetEmail()
 {
     global $config_vars;
     if ($this->getHomeEmail() != FALSE or $this->getWorkEmail() != FALSE) {
         if ($this->getWorkEmail() != FALSE) {
             $primary_email = $this->getWorkEmail();
             if ($this->getHomeEmail() != FALSE) {
                 $secondary_email = $this->getHomeEmail();
             } else {
                 $secondary_email = NULL;
             }
         } else {
             $primary_email = $this->getHomeEmail();
             $secondary_email = NULL;
         }
         $this->setPasswordResetKey(md5(uniqid()));
         $this->setPasswordResetDate(time());
         $this->Save(FALSE);
         if ($config_vars['other']['force_ssl'] == 1) {
             $protocol = 'https';
         } else {
             $protocol = 'http';
         }
         $subject = APPLICATION_NAME . ' ' . TTi18n::gettext('password reset requested at ') . TTDate::getDate('DATE+TIME', time()) . ' ' . TTi18n::gettext('from') . ' ' . $_SERVER['REMOTE_ADDR'];
         $body = '<html><body>';
         $body .= TTi18n::gettext('A password reset has been requested for') . ' "' . $this->getUserName() . '", ';
         $body .= ' <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getBaseURL() . 'ForgotPassword.php?action:password_reset=1&key=' . $this->getPasswordResetKey() . '">' . TTi18n::gettext('please click here to reset your password now') . '</a>.';
         $body .= '<br><br>';
         $body .= TTi18n::gettext('If you did not request your password to be reset, you may ignore this email.');
         $body .= '<br><br>';
         $body .= '--<br>';
         $body .= APPLICATION_NAME;
         $body .= '</body></html>';
         TTLog::addEntry($this->getId(), 500, TTi18n::getText('Employee Password Reset By') . ': ' . $_SERVER['REMOTE_ADDR'] . ' ' . TTi18n::getText('Key') . ': ' . $this->getPasswordResetKey(), NULL, $this->getTable());
         $headers = array('From' => '"' . APPLICATION_NAME . ' - ' . TTi18n::gettext('Password Reset') . '"<DoNotReply@' . Misc::getHostName(FALSE) . '>', 'Subject' => $subject, 'Cc' => $secondary_email);
         $mail = new TTMail();
         $mail->setTo($primary_email);
         $mail->setHeaders($headers);
         @$mail->getMIMEObject()->setHTMLBody($body);
         $mail->setBody($mail->getMIMEObject()->get($mail->default_mime_config));
         $retval = $mail->Send();
         return $retval;
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:45,代码来源:UserFactory.class.php


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