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


PHP Util::getTemplate方法代码示例

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


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

示例1: add

 public function add($pendingClientData)
 {
     try {
         $conn = UbirimiContainer::get()['db.connection'];
         $data = json_decode($pendingClientData['data'], true);
         $clientId = UbirimiContainer::get()['repository']->get(UbirimiClient::class)->create(null, $data['companyDomain'], $data['baseURL'], $data['adminEmail'], null, null, null, UbirimiClient::INSTANCE_TYPE_ON_DEMAND, Util::getServerCurrentDateTime());
         // create the user
         $userId = UbirimiContainer::get()['repository']->get(UbirimiUser::class)->createAdministratorUser($data['adminFirstName'], $data['adminLastName'], $data['adminUsername'], $data['adminPass'], $data['adminEmail'], $clientId, 20, 1, 1, Util::getServerCurrentDateTime());
         $columns = 'code#summary#priority#status#created#type#updated#reporter#assignee';
         UbirimiContainer::get()['repository']->get(UbirimiUser::class)->updateDisplayColumns($userId, $columns);
         UbirimiContainer::get()['repository']->get(UbirimiClient::class)->install($clientId);
         UbirimiContainer::get()['repository']->get(EmailQueue::class)->add($clientId, 'accounts@ubirimi.com', $data['adminEmail'], null, 'Your account details - Ubirimi.com', Util::getTemplate('_newAccount.php', array('username' => $data['adminUsername'], 'companyDomain' => $data['companyDomain'], 'emailAddress' => $data['adminEmail'])), Util::getServerCurrentDateTime());
         $conn->commit();
     } catch (\Exception $e) {
         $conn->rollback();
         throw new \Exception(sprintf('Could not install client [%s]. Error [%s]', $data['companyName'], $e->getMessage()));
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:18,代码来源:ClientService.php

示例2: shareEvent

 public function shareEvent($clientId, $event, $userThatShares, $userToSendEmailAddress, $noteContent)
 {
     if (Email::$smtpSettings) {
         $subject = Email::$smtpSettings['email_prefix'] . ' ' . $userThatShares['first_name'] . ' ' . $userThatShares['last_name'] . ' shared event ' . $event['name'] . ' with you';
         $date = Util::getServerCurrentDateTime();
         UbirimiContainer::get()['repository']->get(EmailQueue::class)->add($clientId, Email::$smtpSettings['from_address'], $userToSendEmailAddress, null, $subject, Util::getTemplate('_eventShare.php', array('event' => $event, 'userThatShares' => $userThatShares, 'noteContent' => $noteContent, 'clientDomain' => Util::getSubdomain())), $date);
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:8,代码来源:Email.php

示例3: explode

    $data = explode('=', $searchParameter);
    $searchParameters[$data[0]] = $data[1];
}
$user = UbirimiContainer::get()['repository']->get(UbirimiUser::class)->getById($filter['user_id']);
$smtpSettings = UbirimiContainer::get()['repository']->get(SMTPServer::class)->getByClientId($user['client_id']);
if (!$smtpSettings) {
    die('No SMPT server defined');
}
$clientSettings = UbirimiContainer::get()['repository']->get(UbirimiClient::class)->getSettings($user['client_id']);
$client = UbirimiContainer::get()['repository']->get(UbirimiClient::class)->getById($user['client_id']);
$subject = $smtpSettings['email_prefix'] . " Filter - " . $filter['name'];
$usersToNotify = array();
if ($filterSubscription['user_id']) {
    $user = UbirimiContainer::get()['repository']->get(UbirimiUser::class)->getById($filterSubscription['user_id']);
    $usersToNotify[] = $user;
} else {
    if ($filterSubscription['group_id']) {
        $users = UbirimiContainer::get()['repository']->get(UbirimiGroup::class)->getDataByGroupId($filterSubscription['group_id']);
        while ($users && ($user = $users->fetch_array(MYSQLI_ASSOC))) {
            $usersToNotify[] = $user;
        }
    }
}
foreach ($usersToNotify as $user) {
    $issues = UbirimiContainer::get()['repository']->get(Issue::class)->getByParameters($searchParameters, $filterSubscription['user_id'], null, $filterSubscription['user_id']);
    $columns = explode('#', $user['issues_display_columns']);
    UbirimiContainer::get()['repository']->get(EmailQueue::class)->add($user['client_id'], $smtpSettings['from_address'], $user['email'], null, $subject, Util::getTemplate('_filterSubscription.php', array('issues' => $issues, 'searchParameters' => $searchParameters, 'clientSettings' => $clientSettings, 'columns' => $columns, 'userId' => $user['id'], 'clientId' => $user['client_id'], 'cliMode' => true, 'client_domain' => $client['company_domain'])), Util::getServerCurrentDateTime());
}
if (null !== $fp) {
    fclose($fp);
}
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:run_filter_subscription.php

示例4: exit

    if (!flock($fp, LOCK_EX | LOCK_NB)) {
        echo "Unable to obtain lock for process_event_reminders task.\n";
        exit(-1);
    }
}
require_once __DIR__ . '/../web/bootstrap_cli.php';
$reminders = UbirimiContainer::get()['repository']->get(EventReminder::class)->getRemindersToBeFired();
while ($reminders && ($reminder = $reminders->fetch_array(MYSQLI_ASSOC))) {
    $currentDate = Util::getServerCurrentDateTime();
    $smtpSettings = UbirimiContainer::get()['repository']->get(SMTPServer::class)->getByClientId($reminder['client_id']);
    if ($smtpSettings) {
        $reminderPeriod = $reminder['cal_event_reminder_period_id'];
        $reminderValue = $reminder['value'];
        $eventStartDate = $reminder['date_from'];
        $emailSubject = 'Reminder: ' . $reminder['name'] . ' @ ' . date('j M Y', strtotime($eventStartDate)) . ' (' . $reminder['calendar_name'] . ')';
        $emailBody = Util::getTemplate('_eventReminder.php', array('event_name' => $reminder['name'], 'when' => $eventStartDate, 'calendar_name' => $reminder['calendar_name']));
        $dateTemporary = date_create(date('Y-m-d H:i:s', time()));
        switch ($reminderPeriod) {
            case ReminderPeriod::PERIOD_MINUTE:
                date_add($dateTemporary, date_interval_create_from_date_string($reminderValue . ' minutes'));
                $eventStartDateReminder = date_format($dateTemporary, 'Y-m-d H:i:s');
                break;
            case ReminderPeriod::PERIOD_HOUR:
                date_add($dateTemporary, date_interval_create_from_date_string($reminderValue . ' hours'));
                $eventStartDateReminder = date_format($dateTemporary, 'Y-m-d H:i:s');
                break;
            case ReminderPeriod::PERIOD_DAY:
                date_add($dateTemporary, date_interval_create_from_date_string($reminderValue . ' days'));
                $eventStartDateReminder = date_format($dateTemporary, 'Y-m-d H:i:s');
                break;
            case ReminderPeriod::PERIOD_WEEK:
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:process_event_reminders.php


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