mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 14:11:35 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
ae34e29fed
|
@ -93,6 +93,12 @@ class SeedDMS_Download_Mgr {
|
||||||
*/
|
*/
|
||||||
protected $filenames;
|
protected $filenames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var boolean $skipdefaultcols skip default columns, will only export extracols
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected $skipdefaultcols;
|
||||||
|
|
||||||
function __construct($tmpdir = '') {
|
function __construct($tmpdir = '') {
|
||||||
$this->tmpdir = $tmpdir;
|
$this->tmpdir = $tmpdir;
|
||||||
$this->items = array();
|
$this->items = array();
|
||||||
|
@ -105,8 +111,13 @@ class SeedDMS_Download_Mgr {
|
||||||
$this->extraheader = array();
|
$this->extraheader = array();
|
||||||
$this->folder_extraheader = array();
|
$this->folder_extraheader = array();
|
||||||
$this->filenames = array();
|
$this->filenames = array();
|
||||||
|
$this->skipdefaultcols = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setSkipDefaultCols($v) { /* {{{ */
|
||||||
|
$this->skipdefaultcols = (bool) $v;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
public function addHeader($extraheader) { /* {{{ */
|
public function addHeader($extraheader) { /* {{{ */
|
||||||
$this->extraheader = $extraheader;
|
$this->extraheader = $extraheader;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
@ -137,6 +148,7 @@ class SeedDMS_Download_Mgr {
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$col = 1;
|
$col = 1;
|
||||||
|
if(!$this->skipdefaultcols)
|
||||||
foreach($this->header as $h)
|
foreach($this->header as $h)
|
||||||
$sheet->setCellValue([$col++, $i], $h);
|
$sheet->setCellValue([$col++, $i], $h);
|
||||||
foreach($this->extraheader as $h)
|
foreach($this->extraheader as $h)
|
||||||
|
@ -151,13 +163,14 @@ class SeedDMS_Download_Mgr {
|
||||||
$approvalStatus = $item->getApprovalStatus();
|
$approvalStatus = $item->getApprovalStatus();
|
||||||
|
|
||||||
$col = 1;
|
$col = 1;
|
||||||
|
$l = $i; // Number of reviewers
|
||||||
|
$k = $i; // Number of approvers
|
||||||
|
if(!$this->skipdefaultcols) {
|
||||||
$sheet->setCellValue([$col++, $i], $document->getID());
|
$sheet->setCellValue([$col++, $i], $document->getID());
|
||||||
$sheet->setCellValue([$col++, $i], $document->getName());
|
$sheet->setCellValue([$col++, $i], $document->getName());
|
||||||
$sheet->setCellValue([$col++, $i], $document->getID()."-".$item->getOriginalFileName());
|
$sheet->setCellValue([$col++, $i], $document->getID()."-".$item->getOriginalFileName());
|
||||||
$sheet->setCellValue([$col++, $i], getOverallStatusText($status['status']));
|
$sheet->setCellValue([$col++, $i], getOverallStatusText($status['status']));
|
||||||
$sheet->setCellValue([$col++, $i], $item->getVersion());
|
$sheet->setCellValue([$col++, $i], $item->getVersion());
|
||||||
$l = $i;
|
|
||||||
$k = $i;
|
|
||||||
if($reviewStatus) {
|
if($reviewStatus) {
|
||||||
foreach ($reviewStatus as $r) {
|
foreach ($reviewStatus as $r) {
|
||||||
switch ($r["type"]) {
|
switch ($r["type"]) {
|
||||||
|
@ -181,7 +194,7 @@ class SeedDMS_Download_Mgr {
|
||||||
$tcol = $col;
|
$tcol = $col;
|
||||||
$sheet->setCellValue([$tcol++, $l], $reqName);
|
$sheet->setCellValue([$tcol++, $l], $reqName);
|
||||||
$sheet->setCellValue([$tcol, $l], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
|
$sheet->setCellValue([$tcol, $l], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
|
||||||
$sheet->getStyleByColumnAndRow($tcol++, $l)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
|
$sheet->getStyle([$tcol++, $l])->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
|
||||||
$sheet->setCellValue([$tcol++, $l], $r['comment']);
|
$sheet->setCellValue([$tcol++, $l], $r['comment']);
|
||||||
$sheet->setCellValue([$tcol++, $l], getReviewStatusText($r["status"]));
|
$sheet->setCellValue([$tcol++, $l], getReviewStatusText($r["status"]));
|
||||||
$l++;
|
$l++;
|
||||||
|
@ -212,7 +225,7 @@ class SeedDMS_Download_Mgr {
|
||||||
$tcol = $col;
|
$tcol = $col;
|
||||||
$sheet->setCellValue([$tcol++, $k], $reqName);
|
$sheet->setCellValue([$tcol++, $k], $reqName);
|
||||||
$sheet->setCellValue([$tcol, $k], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
|
$sheet->setCellValue([$tcol, $k], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
|
||||||
$sheet->getStyleByColumnAndRow($tcol++, $k)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
|
$sheet->getStyle([$tcol++, $k])->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
|
||||||
$sheet->setCellValue([$tcol++, $k], $r['comment']);
|
$sheet->setCellValue([$tcol++, $k], $r['comment']);
|
||||||
$sheet->setCellValue([$tcol++, $k], getApprovalStatusText($r["status"]));
|
$sheet->setCellValue([$tcol++, $k], getApprovalStatusText($r["status"]));
|
||||||
$k++;
|
$k++;
|
||||||
|
@ -220,6 +233,7 @@ class SeedDMS_Download_Mgr {
|
||||||
$k--;
|
$k--;
|
||||||
}
|
}
|
||||||
$col += 4;
|
$col += 4;
|
||||||
|
}
|
||||||
if(isset($this->extracols[$item->getID()]) && $this->extracols[$item->getID()]) {
|
if(isset($this->extracols[$item->getID()]) && $this->extracols[$item->getID()]) {
|
||||||
foreach($this->extracols[$item->getID()] as $column)
|
foreach($this->extracols[$item->getID()] as $column)
|
||||||
$sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column );
|
$sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column );
|
||||||
|
@ -239,6 +253,7 @@ class SeedDMS_Download_Mgr {
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$col = 1;
|
$col = 1;
|
||||||
|
if(!$this->skipdefaultcols)
|
||||||
foreach($this->folder_header as $h)
|
foreach($this->folder_header as $h)
|
||||||
$sheet->setCellValue([$col++, $i], $h);
|
$sheet->setCellValue([$col++, $i], $h);
|
||||||
foreach($this->folder_extraheader as $h)
|
foreach($this->folder_extraheader as $h)
|
||||||
|
@ -251,8 +266,10 @@ class SeedDMS_Download_Mgr {
|
||||||
$dms = $folder->_dms;
|
$dms = $folder->_dms;
|
||||||
|
|
||||||
$col = 1;
|
$col = 1;
|
||||||
|
if(!$this->skipdefaultcols) {
|
||||||
$sheet->setCellValue([$col++, $i], $folder->getID());
|
$sheet->setCellValue([$col++, $i], $folder->getID());
|
||||||
$sheet->setCellValue([$col++, $i], $folder->getName());
|
$sheet->setCellValue([$col++, $i], $folder->getName());
|
||||||
|
}
|
||||||
if(isset($this->folder_extracols[$item->getID()]) && $this->folder_extracols[$item->getID()]) {
|
if(isset($this->folder_extracols[$item->getID()]) && $this->folder_extracols[$item->getID()]) {
|
||||||
foreach($this->folder_extracols[$item->getID()] as $column)
|
foreach($this->folder_extracols[$item->getID()] as $column)
|
||||||
$sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column );
|
$sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column );
|
||||||
|
|
|
@ -729,9 +729,10 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
case 'select':
|
case 'select':
|
||||||
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
|
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
|
||||||
$multiple = empty($conf['multiple']) ? false : $conf['multiple'];
|
$multiple = empty($conf['multiple']) ? false : $conf['multiple'];
|
||||||
|
$order = empty($conf['order']) ? '' : $conf['order'];
|
||||||
if(!empty($conf['options'])) {
|
if(!empty($conf['options'])) {
|
||||||
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
||||||
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_option")."\" style=\"width: 100%;\">";
|
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "").($order ? " order=\"".$order."\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_option")."\" style=\"width: 100%;\">";
|
||||||
if(is_array($conf['options'])) {
|
if(is_array($conf['options'])) {
|
||||||
$options = $conf['options'];
|
$options = $conf['options'];
|
||||||
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
|
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
|
||||||
|
@ -745,7 +746,12 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
echo "<option value=\"".$key."\"";
|
echo "<option value=\"".$key."\"";
|
||||||
if(in_array($key, $selections))
|
if(in_array($key, $selections))
|
||||||
echo " selected";
|
echo " selected";
|
||||||
echo ">".htmlspecialchars(getMLText($extname.'_'.$opt, array(), $opt))."</option>";
|
if(is_array($opt)) {
|
||||||
|
echo " data-subtitle=\"".htmlspecialchars($opt['subtitle'])."\">".htmlspecialchars($opt['value']);
|
||||||
|
} else {
|
||||||
|
echo ">".htmlspecialchars(getMLText($extname.'_'.$opt, array(), $opt));
|
||||||
|
}
|
||||||
|
echo "</option>";
|
||||||
}
|
}
|
||||||
echo "</select>";
|
echo "</select>";
|
||||||
} elseif(!empty($conf['internal'])) {
|
} elseif(!empty($conf['internal'])) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user