Пример #1
0
     $r = $tbl->NewColumn();
     $r->Caption = "Комментарий автора";
     $r->Key = "comment";
     $r = $tbl->NewColumn();
     $r->Caption = "Отправить сообщение";
     $r->Process = "send_message_to_author";
     $r = $tbl->NewColumn();
     $r->Caption = "Назначить/снять";
     $r->Process = "generate_assign_button";
     $tbl->FilterMYSQL("order_id = " . $order_id);
 } elseif ($_SESSION["user"]["data"]["group_id"] == 6) {
     if ($order_status == "ASSIGNED") {
         $GUI->ERR("Этот заказ уже назначен");
         page_reloadSec();
     }
     if ($offer_info = AuthorOffer::findOneBy(array('order_id' => $order_id, 'author_id' => $_SESSION['user']['data']['id']))) {
         $frm = $GUI->Form("Редактировать предложение к заказу №" . $order_id, 400, 270);
         $frm->OnExecute = "edit_offer";
     } else {
         $offer_info = array('price' => '', 'comment' => '');
         $frm = $GUI->Form("Новое предложение к заказу №" . $order_id, 400, 270);
         $frm->OnExecute = "add_offer";
     }
     $ypos = 10;
     $h = $frm->Hidden($order_id);
     $h->linkName = "order_id";
     $h = $frm->Hidden($_SESSION["user"]["data"]["id"]);
     $h->linkName = "author_id";
     $frm->Label("Цена:", 10, $ypos);
     if ($order_info['cost_auth'] != 0) {
         $frm->Label($order_info['cost_auth'] . " " . $ofc_currency, 60, $ypos);
Пример #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>';
}