mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
add hook to set extra columns, fix column counting if approval or review does not exists
This commit is contained in:
parent
2188babab8
commit
8c77b0734c
|
@ -39,13 +39,21 @@ class SeedDMS_Download_Mgr {
|
||||||
*/
|
*/
|
||||||
protected $items;
|
protected $items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array $extracols list of arrays with extra columns per item
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected $extracols;
|
||||||
|
|
||||||
function __construct($tmpdir = '') {
|
function __construct($tmpdir = '') {
|
||||||
$this->tmpdir = $tmpdir;
|
$this->tmpdir = $tmpdir;
|
||||||
$this->items = array();
|
$this->items = array();
|
||||||
|
$this->extracols = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addItem($item) { /* {{{ */
|
public function addItem($item, $extracols) { /* {{{ */
|
||||||
$this->items[$item->getID()] = $item;
|
$this->items[$item->getID()] = $item;
|
||||||
|
$this->extracols[$item->getID()] = $extracols;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
public function createToc($file) { /* {{{ */
|
public function createToc($file) { /* {{{ */
|
||||||
|
@ -113,9 +121,9 @@ class SeedDMS_Download_Mgr {
|
||||||
$sheet->setCellValueByColumnAndRow($tcol++, $l, getReviewStatusText($r["status"]));
|
$sheet->setCellValueByColumnAndRow($tcol++, $l, getReviewStatusText($r["status"]));
|
||||||
$l++;
|
$l++;
|
||||||
}
|
}
|
||||||
$col = $tcol;
|
|
||||||
$l--;
|
$l--;
|
||||||
}
|
}
|
||||||
|
$col += 4;
|
||||||
if($approvalStatus) {
|
if($approvalStatus) {
|
||||||
foreach ($approvalStatus as $r) {
|
foreach ($approvalStatus as $r) {
|
||||||
switch ($r["type"]) {
|
switch ($r["type"]) {
|
||||||
|
@ -144,9 +152,13 @@ class SeedDMS_Download_Mgr {
|
||||||
$sheet->setCellValueByColumnAndRow($tcol++, $k, getApprovalStatusText($r["status"]));
|
$sheet->setCellValueByColumnAndRow($tcol++, $k, getApprovalStatusText($r["status"]));
|
||||||
$k++;
|
$k++;
|
||||||
}
|
}
|
||||||
$col = $tcol;
|
|
||||||
$k--;
|
$k--;
|
||||||
}
|
}
|
||||||
|
$col += 4;
|
||||||
|
if(isset($this->extracols[$item->getID()]) && $this->extracols[$item->getID()]) {
|
||||||
|
foreach($this->extracols[$item->getID()] as $column)
|
||||||
|
$sheet->setCellValueByColumnAndRow($col++, $i, $column);
|
||||||
|
}
|
||||||
$i = max($l, $k);
|
$i = max($l, $k);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user