diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
commit | 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 (patch) | |
tree | 4d541098d751d5a9acf8c12f6fb9f308ace066ac /js/callbacks/searchtask.php | |
download | flyspray-8df3db566a3a937b45ebf11adb90d265e6f5e2d4.tar.xz |
initial checking of customized version 1.0rc9
Diffstat (limited to 'js/callbacks/searchtask.php')
-rw-r--r-- | js/callbacks/searchtask.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/callbacks/searchtask.php b/js/callbacks/searchtask.php new file mode 100644 index 0000000..47b0241 --- /dev/null +++ b/js/callbacks/searchtask.php @@ -0,0 +1,43 @@ +<?php +define('IN_FS', true); +require_once('../../header.php'); + + +// Require inputs +if(!Post::has('detail') || !Post::has('summary') || !Post::has('project_id')) +{ + return; +} + + +// Load user profile +if (Cookie::has('flyspray_userid') && Cookie::has('flyspray_passhash')){ + $user = new User(Cookie::val('flyspray_userid')); + $user->check_account_ok(); +} else { + $user = new User(0, $proj); +} + +// Require right to open a task on current project +if(!$user->can_open_task($proj)){ + return; +} + + +// Prepare SQL params +$params = array( + 'project_id' => Post::num('project_id'), + 'summary' => "%" . trim(Post::val('summary')) . "%", + 'details' => "%" . trim(Post::val('detail')) . "%" +); + +$sql = $db->query('SELECT count(*) + FROM {tasks} t + WHERE t.project_id = ? + AND t.item_summary like ? + AND t.detailed_desc like ?', + $params); +$sametask = $db->fetchOne($sql); +echo $sametask; + +?> |