- Mon Nov 23, 2020 7:15 am
#828679
At first, sorry for my english I created a plugin that displays the required information for a logged in user and by dbclick summary dynaform. But I would like to add case notes in that row like in advanced search. Is it possible? How can I do that?
Code: Select all
var storeUser = new Ext.data.Store({
proxy:new Ext.data.HttpProxy({
url: "ajax/owncases",
method: "POST"
}),
reader:new Ext.data.JsonReader({
root: "resultRoot",
totalProperty: "resultTotal",
fields: [{name: "APP_UID"},
{name: "REPLACER"},
{name: "TEST1"},
{name: "APP_TAS_TITLE"},
{name: "TEST2"},
{name: "APP_PRO_TITLE"},
{name: "APP_INIT_DATE"}
]
}),
Code: Select all
owncases.php
var cmodel = new Ext.grid.ColumnModel({
defaults: {
width:50,
sortable:true
},
columns:[//{header: "Numer systemowy", APP_UID: "APP_UID", dataIndex: "APP_UID", width: 40, align: "left" /*hidden: true*/},
{header: "TEST1", dataIndex: "TEST1",width: 12, align: "center"},
{header: "TEST2", dataIndex: "TEST2",width: 12, align: "center"},
{header: "Aktualny stan zgłoszenia", dataIndex: "APP_TAS_TITLE", width: 30, align: "center"},
{header: "Sprawą aktualnie zajmuje się", dataIndex: "OSOBA", width: 15, align: "center"},
{header: "Rodzaj zgłoszenia", dataIndex: "APP_PRO_TITLE", width: 20, align: "center"},
{header: "Data stworzenia zgłoszenia", dataIndex: "APP_INIT_DATE", width: 11, align: "center"},
]
});
Code: Select all
<?php
$con = \Propel::getConnection('workflow');
$con->begin();
global $RBAC;
$userlogged = $_SESSION['USER_LOGGED'];
$sql = "SELECT A.APP_UID, A.APP_TAS_TITLE, B.TEST1, B.TEST2, A.APP_NUMBER, C.APP_INIT_DATE, CONCAT(U.USR_FIRSTNAME, ' ', U.USR_LASTNAME) AS OSOBA, A.APP_PRO_TITLE
from application C, app_cache_view A, alt_case_info B, users U
where A.APP_UID = B.APP_UID AND C.APP_UID = B.APP_UID AND C.APP_UID = A.APP_UID AND C.APP_CUR_USER = U.USR_UID
AND A.DEL_LAST_INDEX = 1 and C.APP_STATUS = 'TO_DO' AND C.APP_INIT_USER = '".$userlogged."' ";
$app_num = (int) $_POST['app_num'];
if (!empty($app_num)) {
$sql .= " AND A.APP_NUMBER = ".$app_num;
}
$app_car = (string) $_POST['app_car'];
if (!empty($app_car)) {
$sql .= " AND B.TEST2 LIKE '%".$app_car."%'";
}
$start_date = (date) $_POST['start_date'];
if (!empty($start_date)) {
$sql .= " AND B.APP_INIT_DATE > ".$start_date;
}
$end_date = (date) $_POST['end_date'];
if (!empty($end_date)) {
$sql .= " AND B.APP_INIT_DATE < ".$end_date;
}
$rs = $con->executeQuery($sql);
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$cases = array();
$i=1;
while ($rs->next()) {
$row = $rs->getRow();
$cases[] = array(
"ID" => $i,
"APP_UID" => $row['APP_UID'],
"APP_TAS_TITLE" => $row['APP_TAS_TITLE'],
"TEST1" => $row['TEST1'],
"TEST2" => $row['TEST2'],
"APP_NUMBER" => $row['APP_NUMBER'],
"OSOBA" => $row['OSOBA'],
"APP_PRO_TITLE" => $row['APP_PRO_TITLE'],
"APP_INIT_DATE" => $row['APP_INIT_DATE']
);
$i++;
}
$con->commit();
echo G::json_encode(array(
"success" => true,
"resultTotal" => $i,
"resultRoot" => $cases
));
?>
Attachments
1.PNG (31.87 KiB) Viewed 7748 times