9 namespace Fossology\Lib\Dao;
23 require_once(dirname(dirname(__FILE__)) .
"/common-dir.php");
29 const REUSE_ENHANCED = 2;
31 const REUSE_CONF = 16;
32 const REUSE_COPYRIGHT = 128;
33 const UNIFIED_REPORT_HEADINGS = array(
34 "assessment" => array(
"Assessment Summary" =>
true),
35 "compliancetasks" => array(
"Required license compliance tasks" =>
true),
36 "acknowledgements" => array(
"Acknowledgements" =>
true),
37 "exportrestrictions" => array(
"Export Restrictions" =>
true),
38 "intellectualProperty" => array(
"Patent Relevant Statements" =>
true),
39 "notes" => array(
"Notes" =>
true),
40 "scanresults" => array(
"Results of License Scan" =>
true),
41 "mainlicenses" => array(
"Main Licenses" =>
true),
42 "redlicense" => array(
"Other OSS Licenses (red) - Do not Use Licenses" =>
true),
43 "yellowlicense" => array(
"Other OSS Licenses (yellow) - additional obligations to common rules (e.g. copyleft)" =>
true),
44 "whitelicense" => array(
"Other OSS Licenses (white) - only common rules" =>
true),
45 "overviewwithwithoutobligations" => array(
"Overview of All Licenses with or without Obligations" =>
true),
46 "copyrights" => array(
"Copyrights" =>
true),
47 "copyrightsuf" => array(
"Copyrights (User Findings)" =>
true),
48 "bulkfindings" => array(
"Bulk Findings" =>
true),
49 "licensenf" => array(
"Non-Functional Licenses" =>
true),
50 "irrelevantfiles" => array(
"Irrelevant Files" =>
true),
51 "dnufiles" => array(
"Do not use Files" =>
true),
52 "changelog" => array(
"Clearing Protocol Change Log" =>
true)
54 const CLIXML_REPORT_HEADINGS = array(
55 "mainlicensesclixml" => array(
"Main Licenses" =>
true),
56 "licensepath" => array(
"License File Path" =>
true),
57 "licensehash" => array(
"License File Hash" =>
true),
58 "copyrightsclixml" => array(
"Copyrights" =>
true),
59 "copyrightpath" => array(
"Copyright File Path" =>
true),
60 "copyrighthash" => array(
"Copyright File Hash" =>
true),
61 "exportrestrictionsclixml" => array(
"Export Restrictions(ECC)" =>
true),
62 "eccpath" => array(
"ECC File Path" =>
true),
63 "ecchash" => array(
"ECC File Hash" =>
true),
64 "intellectualPropertyclixml" => array(
"Identified Patent Relevant Analysis(IPRA)" =>
true),
65 "iprapath" => array(
"IPRA File Path" =>
true),
66 "iprahash" => array(
"IPRA File Hash" =>
true),
67 "allobligations" => array(
"All Obligations" =>
true),
68 "acknowledgementsclixml" => array(
"Acknowledgements" =>
true),
69 "irrelevantfilesclixml" => array(
"Irrelevant Files" =>
true),
70 "dnufilesclixml" => array(
"Do not use Files" =>
true),
71 "notesclixml" => array(
"Additional Notes" =>
true)
78 private $permissionDao;
83 $this->logger = $logger;
84 $this->permissionDao = $uploadPermissionDao;
93 public function getUploadEntry($uploadTreeId, $uploadTreeTableName =
"uploadtree")
95 $stmt = __METHOD__ .
".$uploadTreeTableName";
96 $uploadEntry = $this->
dbManager->getSingleRow(
"SELECT * FROM $uploadTreeTableName WHERE uploadtree_pk = $1",
97 array($uploadTreeId), $stmt);
99 $uploadEntry[
'tablename'] = $uploadTreeTableName;
113 $stmt = __METHOD__ .
".$uploadTreeTableName";
114 $uploadEntry = $this->
dbManager->getSingleRow(
"SELECT uploadtree_pk " .
115 "FROM $uploadTreeTableName " .
116 "WHERE upload_fk = $1 AND pfile_fk = $2",
117 array($uploadFk, $pfileFk), $stmt);
118 return intval($uploadEntry[
'uploadtree_pk']);
128 $row = $this->
dbManager->getSingleRow(
"SELECT * FROM upload WHERE upload_pk = $1",
129 array($uploadId), $stmt);
134 public function getActiveUploadsArray()
137 $queryResult = $this->
dbManager->getRows(
"SELECT * FROM upload where pfile_fk IS NOT NULL",
141 foreach ($queryResult as $row) {
155 $uploadEntryData = $this->
getUploadEntry($itemId, $uploadTreeTableName);
178 if ($uploadTreeTableName ===
null) {
182 $stmt = __METHOD__ .
".$uploadTreeTableName";
183 $parameters = array();
184 $uploadCondition = $this->handleUploadIdForTable($uploadTreeTableName, $uploadId, $parameters);
186 $uploadEntryData = $this->
dbManager->getSingleRow(
"SELECT * FROM $uploadTreeTableName
192 return $uploadEntryData ? $this->
createItemTreeBounds($uploadEntryData, $uploadTreeTableName) :
false;
203 $stmt = __METHOD__ .
".$uploadTreeTableName";
204 $parameters = array($itemTreeBounds->
getLeft(), $itemTreeBounds->
getRight());
205 $uploadCondition = $this->handleUploadIdForTable($uploadTreeTableName, $itemTreeBounds->
getUploadId(), $parameters);
207 $row = $this->
dbManager->getSingleRow(
"SELECT count(*) as count FROM $uploadTreeTableName
208 WHERE lft BETWEEN $1 AND $2
210 AND ((ufile_mode & (3<<28))=0)
213 return intval($row[
"count"]);
216 private function handleUploadIdForTable($uploadTreeTableName, $uploadId, &$parameters)
218 if ($uploadTreeTableName ===
"uploadtree" || $uploadTreeTableName ===
"uploadtree_a") {
219 $parameters[] = $uploadId;
220 return " AND upload_fk = $" . count($parameters) .
" ";
229 public function getStatusTypeMap()
233 $uploadStatus = $container->get(
'upload_status.types');
234 return $uploadStatus->getMap();
246 if ($this->isAccessible($uploadId, $groupId)) {
247 $row = $this->
dbManager->getSingleRow(
"SELECT status_fk " .
248 "FROM upload_clearing WHERE upload_fk=$1 AND group_fk=$2;",
249 array($uploadId, $groupId));
250 if (
false === $row) {
253 return $row[
'status_fk'];
255 throw new \Exception(
"permission denied");
269 if ($this->isAccessible($uploadId, $groupId)) {
270 $row = $this->
dbManager->getSingleRow(
"SELECT assignee FROM upload_clearing WHERE upload_fk=$1 AND group_fk=$2;",
271 array($uploadId, $groupId));
272 if (
false === $row) {
275 return $row[
'assignee'];
277 throw new \Exception(
"permission denied");
290 $sql =
"SELECT event_ts FROM upload_events WHERE upload_fk = $1 " .
292 $row = $this->
dbManager->getSingleRow($sql, [$uploadId], __METHOD__);
293 if (empty($row) || empty($row[
"event_ts"])) {
296 return $row[
"event_ts"];
307 $sql =
"SELECT event_ts FROM upload_events WHERE upload_fk = $1 " .
309 $row = $this->
dbManager->getSingleRow($sql, [$uploadId], __METHOD__);
310 if (empty($row) || empty($row[
"event_ts"])) {
313 return $row[
"event_ts"];
328 if ($assignDate !=
null && $closingDate !=
null) {
330 $closingDate =
new DateTime($closingDate);
331 $assignDate =
new DateTime($assignDate);
332 if ($assignDate < $closingDate) {
334 $durationSort = $closingDate->getTimestamp() - $assignDate->getTimestamp();
339 return array($duration, $durationSort);
351 if (!empty($uploadId)) {
352 $statementName = __METHOD__;
354 "SELECT uploadtree_tablename FROM upload WHERE upload_pk=$1",
358 if (!empty($row[
'uploadtree_tablename'])) {
359 return $row[
'uploadtree_tablename'];
388 const NOT_FOUND =
null;
401 $originItem = $this->
getUploadEntry($itemId, $uploadTreeTableName);
402 $originLft = $originItem[
'lft'];
404 $options[UploadTreeProxy::OPT_ITEM_FILTER] =
" AND ut.ufile_mode & (3<<28) = 0";
405 $uploadTreeViewName =
'items2care';
407 if ($direction == self::DIR_FWD) {
408 $uploadTreeViewName .=
'fwd';
409 $options[UploadTreeProxy::OPT_ITEM_FILTER] .=
" AND lft>$1";
412 $uploadTreeViewName .=
'bwd';
413 $options[UploadTreeProxy::OPT_ITEM_FILTER] .=
" AND lft<$1";
417 $uploadTreeView =
new UploadTreeProxy($uploadId, $options, $uploadTreeTableName, $uploadTreeViewName);
418 $statementName = __METHOD__ .
".$uploadTreeViewName.";
419 $query = $uploadTreeView->getDbViewQuery().
" ORDER BY lft $order";
421 $newItemRow = $this->
dbManager->getSingleRow(
"$query LIMIT 1", array($originLft), $statementName);
423 return $this->
createItem($newItemRow, $uploadTreeTableName);
425 return self::NOT_FOUND;
437 $statementname = __METHOD__ . $uploadTreeTableName;
439 $parent = $this->
dbManager->getSingleRow(
440 "SELECT uploadtree_pk
441 FROM $uploadTreeTableName
442 WHERE upload_fk=$1 AND parent IS NULL", array($uploadId), $statementname);
443 if (
false === $parent) {
444 throw new \Exception(
"Missing upload tree parent for upload");
446 return $parent[
'uploadtree_pk'];
449 public function getLeftAndRight($uploadtreeID, $uploadTreeTableName =
"uploadtree")
451 $statementName = __METHOD__ . $uploadTreeTableName;
452 $leftRight = $this->
dbManager->getSingleRow(
453 "SELECT lft,rgt FROM $uploadTreeTableName WHERE uploadtree_pk = $1",
454 array($uploadtreeID), $statementName
457 return array($leftRight[
'lft'], $leftRight[
'rgt']);
467 $sql =
"SELECT count(*) FROM " . $uploadTreeView->
getDbViewName() .
" WHERE lft BETWEEN $1 AND $2";
468 $result = $this->
dbManager->getSingleRow($sql
469 , array($itemTreeBounds->
getLeft(), $itemTreeBounds->
getRight()), __METHOD__ . $uploadTreeView->
asCTE());
470 return $result[
'count'];
479 public function getContainedItems(
ItemTreeBounds $itemTreeBounds, $addCondition =
"", $addParameters = array())
483 $statementName = __METHOD__ .
".$uploadTreeTableName";
485 $view =
new UploadTreeViewProxy($itemTreeBounds, array(UploadTreeViewProxy::CONDITION_PLAIN_FILES));
487 $this->
dbManager->prepare($statementName,
488 $view->asCTE() .
" SELECT * FROM " . $view->getDbViewName() .
" ut ".
489 ($addCondition ?
" WHERE " . $addCondition :
''));
490 $res = $this->
dbManager->execute($statementName, $addParameters);
493 while ($row = $this->
dbManager->fetchArray($res)) {
494 $items[] = $this->
createItem($row, $uploadTreeTableName);
507 public function addReusedUpload($uploadId, $reusedUploadId, $groupId, $reusedGroupId, $reuseMode=0)
509 $this->
dbManager->insertTableRow(
'upload_reuse',
510 array(
'upload_fk'=>$uploadId,
'group_fk'=> $groupId,
'reused_upload_fk'=>$reusedUploadId,
'reused_group_fk'=>$reusedGroupId,
'reuse_mode'=>$reuseMode));
521 $statementName = __METHOD__;
523 $this->
dbManager->prepare($statementName,
524 "SELECT reused_upload_fk, reused_group_fk, reuse_mode FROM upload_reuse WHERE upload_fk = $1 AND group_fk=$2 ORDER BY date_added DESC");
525 $res = $this->
dbManager->execute($statementName, array($uploadId, $groupId));
526 $reusedPairs = $this->
dbManager->fetchAll($res);
536 protected function createItem($uploadEntry, $uploadTreeTableName)
539 intval($uploadEntry[
'uploadtree_pk']),
540 $uploadTreeTableName,
541 intval($uploadEntry[
'upload_fk']),
542 intval($uploadEntry[
'lft']), intval($uploadEntry[
'rgt']));
544 $parent = $uploadEntry[
'parent'];
546 $itemTreeBounds, $parent !==
null ? intval($parent) :
null, intval($uploadEntry[
'pfile_fk']), intval($uploadEntry[
'ufile_mode']), $uploadEntry[
'ufile_name']
558 if ($uploadEntryData ===
false) {
559 throw new Exception(
"did not find uploadTreeId in $uploadTreeTableName");
561 return new ItemTreeBounds(intval($uploadEntryData[
'uploadtree_pk']), $uploadTreeTableName, intval($uploadEntryData[
'upload_fk']), intval($uploadEntryData[
'lft']), intval($uploadEntryData[
'rgt']));
572 $sql =
"SELECT count(*) FROM ".$itemTreeBounds->getUploadTreeTableName().
" ut "
573 .
"WHERE ut.upload_fk=$1";
576 $stmt = __METHOD__.
'.parent';
577 $params[] = $itemTreeBounds->
getItemId();
578 $sql .=
" AND ut.ufile_mode & (1<<28) = 0 AND ut.realparent = $2";
580 $params[] = $itemTreeBounds->
getLeft();
581 $params[] = $itemTreeBounds->
getRight();
582 $sql .=
" AND ut.ufile_mode & (3<<28) = 0 AND (ut.lft BETWEEN $2 AND $3)";
585 $descendants = $this->
dbManager->getSingleRow($sql,$params);
586 return $descendants[
'count'];
590 public function isAccessible($uploadId, $groupId)
592 return $this->permissionDao->isAccessible($uploadId, $groupId);
595 public function isEditable($uploadId, $groupId)
597 return $this->permissionDao->isEditable($uploadId, $groupId);
600 public function makeAccessibleToGroup($uploadId, $groupId, $perm=
null)
602 $this->permissionDao->makeAccessibleToGroup($uploadId, $groupId, $perm);
605 public function makeAccessibleToAllGroupsOf($uploadId, $userId, $perm=
null)
607 $this->permissionDao->makeAccessibleToAllGroupsOf($uploadId, $userId, $perm);
616 $pfile = $this->
dbManager->getSingleRow(
'SELECT pfile.* FROM upload, pfile WHERE upload_pk=$1 AND pfile_fk=pfile_pk',
617 array($uploadId), __METHOD__);
618 return array(
'sha1'=>$pfile[
'pfile_sha1'],
'md5'=>$pfile[
'pfile_md5'],
'sha256'=>$pfile[
'pfile_sha256']);
629 $sqlChildrenOf =
"SELECT COUNT(*) FROM $uploadtreeTablename s
630 WHERE ufile_mode&(1<<28)=0 and s.upload_fk=$2 AND s.realparent=";
631 $sql=
"WITH RECURSIVE item_path (item_id,num_children,depth,ufile_mode,ufile_name) AS (
632 SELECT uploadtree_pk item_id, ($sqlChildrenOf $1) num_children, 0 depth, ufile_mode, ufile_name
633 FROM $uploadtreeTablename WHERE upload_fk=$2 AND uploadtree_pk=$1
635 SELECT uploadtree_pk item_id, ($sqlChildrenOf ut.uploadtree_pk) num_children,
636 item_path.depth+1 depth, ut.ufile_mode, item_path.ufile_name||'/'||ut.ufile_name ufile_name
637 FROM $uploadtreeTablename ut INNER JOIN item_path ON item_id=ut.realparent
638 WHERE upload_fk=$2 AND ut.ufile_mode&(1<<28)=0 AND num_children<2
640 SELECT * FROM item_path WHERE num_children!=1 OR ufile_mode&(1<<29)=0 ORDER BY depth DESC LIMIT 1";
641 return $this->
dbManager->getSingleRow($sql,array($itemId, $uploadId),__METHOD__.$uploadtreeTablename);
652 $itemRow = $this->
getFatItemArray($itemId,$uploadId,$uploadtreeTablename);
653 return $itemRow[
'item_id'];
663 $statementName = __METHOD__ .
'.' . $uploadTreeTableName;
666 $param[] = $itemTreeBounds->
getLeft();
667 $param[] = $itemTreeBounds->
getRight();
668 $condition =
" lft BETWEEN $1 AND $2";
669 $condition .=
" AND (ufile_mode & (1<<28)) = 0";
671 if (
'uploadtree_a' == $uploadTreeTableName) {
673 $condition .=
" AND upload_fk=$".count($param);
677 SELECT ufile_name, uploadtree_pk, lft, rgt, ufile_mode,
678 pfile_pk, pfile_md5, pfile_sha1, pfile_sha256
679 FROM $uploadTreeTableName
681 ON pfile_fk = pfile_pk
686 $this->
dbManager->prepare($statementName, $sql);
687 $result = $this->
dbManager->execute($statementName, $param);
688 $pfilePerFileName = array();
690 $row = $this->
dbManager->fetchArray($result);
691 $pathStack = array($row[
'ufile_name']);
692 $rgtStack = array($row[
'rgt']);
693 $lastLft = $row[
'lft'];
694 $this->addToPFilePerFileName($pfilePerFileName, $pathStack, $row);
695 while ($row = $this->
dbManager->fetchArray($result)) {
696 if ($row[
'lft'] < $lastLft) {
700 $this->updateStackState($pathStack, $rgtStack, $lastLft, $row);
701 $this->addToPFilePerFileName($pfilePerFileName, $pathStack, $row);
704 return $pfilePerFileName;
707 private function updateStackState(&$pathStack, &$rgtStack, &$lastLft, $row)
709 if ($row[
'lft'] >= $lastLft) {
710 while (count($rgtStack) > 0 && $row[
'lft'] > $rgtStack[count($rgtStack)-1]) {
711 array_pop($pathStack);
712 array_pop($rgtStack);
714 if ($row[
'lft'] > $lastLft) {
715 $pathStack[] = $row[
'ufile_name'];
716 $rgtStack[] = $row[
'rgt'];
717 $lastLft = $row[
'lft'];
722 private function addToPFilePerFileName(&$pfilePerFileName, $pathStack, $row)
724 if (($row[
'ufile_mode'] & (1 << 29)) == 0) {
725 $path = implode(
'/', $pathStack);
726 $pfilePerFileName[$path][
'pfile_pk'] = $row[
'pfile_pk'];
727 $pfilePerFileName[$path][
'uploadtree_pk'] = $row[
'uploadtree_pk'];
728 $pfilePerFileName[$path][
'md5'] = $row[
'pfile_md5'];
729 $pfilePerFileName[$path][
'sha1'] = $row[
'pfile_sha1'];
730 $pfilePerFileName[$path][
'sha256'] = $row[
'pfile_sha256'];
742 $statementName = __METHOD__ .
'.' . $uploadTreeTableName;
745 $param[] = $itemTreeBounds->
getLeft();
746 $param[] = $itemTreeBounds->
getRight();
747 $condition =
" lft BETWEEN $1 AND $2";
748 $condition .=
" AND (ufile_mode & (1<<28)) = 0";
750 if (
'uploadtree_a' == $uploadTreeTableName) {
752 $condition .=
" AND upload_fk=$".count($param);
754 $condition .=
" AND pfile_$hashAlgo IS NOT NULL";
757 SELECT pfile_fk, uploadtree_pk, ufile_mode, pfile_$hashAlgo as hash
758 FROM $uploadTreeTableName
760 ON pfile_fk = pfile_pk
765 $this->
dbManager->prepare($statementName, $sql);
766 $result = $this->
dbManager->execute($statementName, $param);
768 $pfilePerHashAlgo = array();
769 while ($row = $this->
dbManager->fetchArray($result)) {
770 if (($row[
'ufile_mode']&(1<<29)) == 0) {
771 $pfilePerHashAlgo[strtolower($row[
'hash'])][] = array(
'pfile_pk' => $row[
'pfile_fk'],
772 'uploadtree_pk' => $row[
'uploadtree_pk']);
776 return $pfilePerHashAlgo;
783 public function getReportInfo($uploadId)
786 $sql =
"SELECT * FROM report_info WHERE upload_fk = $1";
787 $row = $this->
dbManager->getSingleRow($sql, array($uploadId), $stmt);
791 $stmt = __METHOD__.
'ifempty';
792 $sql =
"INSERT INTO report_info (upload_fk) VALUES ($1) RETURNING *";
793 $row = $this->
dbManager->getSingleRow($sql, array($uploadId), $stmt);
808 if ($column ===
"ri_unifiedcolumns") {
809 $value = json_decode($value,
true);
810 $oldValues = $this->getReportInfo($uploadId)[
"ri_unifiedcolumns"];
811 if (!empty($oldValues)) {
812 $oldValues = json_decode($oldValues,
true);
814 $oldValues = self::UNIFIED_REPORT_HEADINGS;
816 foreach ($value as $key => $val) {
817 $newValText = array_keys($val)[0];
818 $newValValue = array_values($val)[0];
819 $newValValue = ($newValValue ===
true || $newValValue ==
"true") ?
"on" :
null;
820 $oldValues[$key] = [$newValText => $newValValue];
822 $value = json_encode($oldValues);
823 } elseif ($column ===
"ri_excluded_obligations") {
824 $value = json_decode($value,
true);
825 $oldValues = $this->getReportInfo($uploadId)[
"ri_excluded_obligations"];
826 if (!empty($oldValues)) {
827 $oldValues = json_decode($oldValues,
true);
831 foreach ($value as $key => $newValue) {
832 $oldValues[$key] = $newValue;
834 $value = json_encode($oldValues);
835 } elseif ($column ===
"ri_globaldecision") {
836 $value = filter_var($value, FILTER_VALIDATE_BOOL);
839 $sql =
"UPDATE report_info SET $column = $2 WHERE upload_fk = $1;";
840 $stmt = __METHOD__ .
"updateReportInfo" . $column;
841 $this->
dbManager->getSingleRow($sql, [$uploadId, $value], $stmt);
848 public function getGlobalDecisionSettingsFromInfo($uploadId, $setGlobal=
null)
850 $stmt = __METHOD__ .
'get';
851 $sql =
"SELECT ri_globaldecision FROM report_info WHERE upload_fk = $1";
852 $row = $this->
dbManager->getSingleRow($sql, array($uploadId), $stmt);
854 if ($setGlobal ===
null) {
858 $stmt = __METHOD__ .
'ifempty';
859 $sql =
"INSERT INTO report_info (upload_fk, ri_globaldecision) VALUES ($1, $2) RETURNING ri_globaldecision";
860 $row = $this->
dbManager->getSingleRow($sql, array($uploadId, $setGlobal), $stmt);
863 if (!empty($setGlobal)) {
864 $stmt = __METHOD__ .
'update';
865 $sql =
"UPDATE report_info SET ri_globaldecision = $2 WHERE upload_fk = $1 RETURNING ri_globaldecision";
866 $row = $this->
dbManager->getSingleRow($sql, array($uploadId, $setGlobal), $stmt);
869 return $row[
'ri_globaldecision'];
879 $stmt = __METHOD__.
"getUploadHashesFromPfileId";
880 $sql =
"SELECT * FROM pfile WHERE pfile_pk = $1";
881 $row = $this->
dbManager->getSingleRow($sql, array($pfilePk), $stmt);
883 return [
"sha1" => $row[
"pfile_sha1"],
"md5" => $row[
"pfile_md5"],
"sha256" => $row[
"pfile_sha256"]];
893 $stmt = __METHOD__ .
".checkReused";
894 $sql =
"SELECT 1 AS exists FROM report_info WHERE upload_fk = $1 LIMIT 1;";
895 $row = $this->
dbManager->getSingleRow($sql, array($reusedUploadId), $stmt);
897 if (empty($row[
'exists'])) {
903 $stmt = __METHOD__ .
".removeExists";
904 $sql =
"DELETE FROM report_info WHERE upload_fk = $1;";
905 $this->
dbManager->getSingleRow($sql, [$uploadId], $stmt);
907 $stmt = __METHOD__ .
".getAllColumns";
908 $sql =
"SELECT string_agg(column_name, ',') AS columns
909 FROM information_schema.columns
910 WHERE table_name = 'report_info'
911 AND column_name != 'ri_pk'
912 AND column_name != 'upload_fk';";
913 $row = $this->
dbManager->getSingleRow($sql, [], $stmt);
914 $columns = $row[
'columns'];
916 $stmt = __METHOD__.
"CopyinsertReportConfReuse";
918 "INSERT INTO report_info(upload_fk, $columns)
920 FROM report_info WHERE upload_fk = $2"
923 $stmt, array($uploadId, $reusedUploadId)
getUploadtreeIdFromPfile($uploadFk, $pfileFk)
getParentItemBounds($uploadId, $uploadTreeTableName=null)
getReusedUpload($uploadId, $groupId)
createItem($uploadEntry, $uploadTreeTableName)
addReusedUpload($uploadId, $reusedUploadId, $groupId, $reusedGroupId, $reuseMode=0)
getUploadHashes($uploadId)
countNonArtifactDescendants(ItemTreeBounds $itemTreeBounds, $isFlat=true)
getClearingDuration(int $uploadId)
createItemTreeBounds($uploadEntryData, $uploadTreeTableName)
getUploadHashesFromPfileId($pfilePk)
Get Pfile hashes from the pfile id.
getPFileDataPerFileName(ItemTreeBounds $itemTreeBounds)
getContainingFileCount(ItemTreeBounds $itemTreeBounds, UploadTreeProxy $uploadTreeView)
getFatItemId($itemId, $uploadId, $uploadtreeTablename)
getItemTreeBoundsFromUploadId($uploadTreeId, $uploadId)
getAssigneeDate(int $uploadId)
getPFilesDataPerHashAlgo(ItemTreeBounds $itemTreeBounds, $hashAlgo="sha1")
getUploadParent($uploadId)
getItemByDirection($uploadId, $itemId, $direction, $options)
getFatItemArray($itemId, $uploadId, $uploadtreeTablename)
countPlainFiles(ItemTreeBounds $itemTreeBounds)
getNextItem($uploadId, $itemId, $options=null)
getClosedDate(int $uploadId)
updateReportInfo($uploadId, $column, $value)
Update report info for upload.
getPreviousItem($uploadId, $itemId, $options=null)
getItemTreeBounds($itemId, $uploadTreeTableName="uploadtree")
getUploadtreeTableName($uploadId)
Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree".
getAssignee($uploadId, $groupId)
Get the upload assignee id.
getUploadEntry($uploadTreeId, $uploadTreeTableName="uploadtree")
insertReportConfReuse($uploadId, $reusedUploadId)
getStatus($uploadId, $groupId)
Get the upload status.
This class contains the events for the upload_events table.
const UPLOAD_CLOSED_EVENT
static createFromTable($row)
asCTE()
Common Table Expressions.
HumanDuration(DateInterval $duration)
Convert DateInterval to Human readable format.
fo_dbManager * dbManager
fo_dbManager object