Example #1
0
                case NOTIFICATION_TYPE_NORMAL:
                default:
                    if (!\Components\Entity\EmailNotificationType::isPersistable(\Components\Entity\EmailNotification::TO_AUTHOR_ON_REMIND_NORMAL)) {
                        $GUI->ERR("Напоминание отключено!");
                        page_ReloadSec();
                        return;
                    }
                    $failed_emails = Author::saveMessageAndEnqueueEmail($order_id, array($order_info['author_id']), 'u' . $_SESSION['user']['data']['id'], 'Напоминание по заказу №' . $order_id . ' ' . $order_info['subject'], 'Уважаемый автор, напоминаем Вам о том, что данный заказ должен быть прислан Вами на почту или прикреплен на сайте в личном кабинете сегодня. Сообщите о состоянии заказа.
С уважением, ' . sotr_getFullName($_SESSION['user']['data']['id']), \Components\Entity\EmailNotification::TO_AUTHOR_ON_REMIND_NORMAL);
                    break;
                case NOTIFICATION_TYPE_URGENT:
                    if (!\Components\Entity\EmailNotificationType::isPersistable(\Components\Entity\EmailNotification::TO_AUTHOR_ON_REMIND_URGENT)) {
                        $GUI->ERR("Напоминание отключено!");
                        page_ReloadSec();
                        return;
                    }
                    $failed_emails = Author::saveMessageAndEnqueueEmail($order_id, array($order_info['author_id']), 'u' . $_SESSION['user']['data']['id'], 'СРОЧНО ответьте по заказу №' . $order_id . ' ' . $order_info['subject'], 'Срочно ответьте о состоянии данного заказа, по которому дата сдачи Вами сорвана. Предупреждаем что срыв срока заказа позволит нам не выплатить Вам гонорар и/или наложить штраф. Мы всегда выполняем свои обязательства по оплате перед Вами и ждем с Вашей стороны того же, а именно соблюдение сроков и требований. Спасибо за понимание. С уважением, ' . sotr_getFullName($_SESSION['user']['data']['id']), \Components\Entity\EmailNotification::TO_AUTHOR_ON_REMIND_URGENT);
                    break;
            }
            if (!empty($failed_emails)) {
                $GUI->ERR("Не удалось отправить заказ на " . $failed_emails[0]['email']);
                page_ReloadSec();
            }
            AuthorNotification::create(array('author_id' => $order_info['author_id'], 'order_id' => $order_id, 'date' => date('Y-m-d H:i:s'), 'type' => $type));
            $GUI->OK("Напоминание отправлено");
            page_ReloadSec();
            break;
    }
} else {
    require_once 'listing/list.php';
}
Example #2
0
function tp_author_notification($value, $row, $table, &$info)
{
    global $GUI;
    try {
        $author = Employee::find($row['author_id']);
        $icon = '<div>';
        $icon .= $GUI->getIcon("?section=ord&subsection=2&order=" . $row['id'] . "&p=7&t=1", "msg", "Отправить напоминание");
        $icon .= '<span style="color:blue; position: relative; top: -2px;left:5px;">' . count(AuthorNotification::findBy(array('author_id' => $author['id'], 'order_id' => $row['id'], 'type' => 1))) . '</span>';
        $icon .= '</div>';
        $icon .= '<div>';
        $icon .= $GUI->getIcon("?section=ord&subsection=2&order=" . $row['id'] . "&p=7&t=2", "msg_red", "Отправить гневное напоминание");
        $icon .= '<span style="color:red; position: relative; top: -2px;left:5px;">' . count(AuthorNotification::findBy(array('author_id' => $author['id'], 'order_id' => $row['id'], 'type' => 2))) . '</span>';
        $icon .= '</div>';
    } catch (Exception $e) {
        $icon = '<div style="height: 20px;"></div>';
    }
    $offers_qt = '';
    if (!empty($row['manager_id']) && !empty($row['status_id'])) {
        $offers_qt = count(AuthorOffer::findBy(array('order_id' => $row['id'])));
    }
    return $icon . '<span style="color:red; position: relative; top: -26px;left:50px;">' . $offers_qt . '</span>';
}