diff --git a/plugins/pdfConverter/pdfConverter.php b/plugins/pdfConverter/pdfConverter.php
index 4dd6afa..7c7a140 100644
--- a/plugins/pdfConverter/pdfConverter.php
+++ b/plugins/pdfConverter/pdfConverter.php
@@ -185,7 +185,7 @@ class pdfConverter extends BaseProcessor
$mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
//$mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
/* */
-
+ $mime_types[] = 'image/tiff';
return $mime_types;
}
@@ -208,9 +208,13 @@ class pdfConverter extends BaseProcessor
// Create a temporary file to store the converted document
$targetFile = tempnam($tempDir, 'pdfconverter') . '.pdf';
- // Get contents and send to converter
- $result = $this->xmlrpc->convertDocument($sourceFile, $targetFile, $this->ooHost, $this->ooPort);
-
+ if($ext == "tiff" || $ext == "tif") { // Also known as tif.
+ $this->convertTiff($sourceFile, $targetFile);
+ } else {
+ // Get contents and send to converter
+ $result = $this->xmlrpc->convertDocument($sourceFile, $targetFile, $this->ooHost, $this->ooPort);
+ }
+
if(is_string($result)){
$default->log->error('PDF Converter Plugin: Conversion to PDF Failed');
@unlink($sourceFile);
@@ -241,5 +245,18 @@ class pdfConverter extends BaseProcessor
return true;
}
+
+ function convertTiff($sourceFile, $targetFile) {
+ global $default;
+ $pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert'; // Retrieve convert location
+ if (stristr(PHP_OS,'WIN')) { // windows path may contain spaces
+ $cmd = "\"{$pathConvert}\" \"{$sourceFile}\" \"$targetFile\"";
+ }
+ else {
+ $cmd = "{$pathConvert} {$sourceFile} $targetFile";
+ }
+
+ $result = KTUtil::pexec($cmd);
+ }
}
?>
\ No newline at end of file
diff --git a/plugins/thumbnails/thumbnails.php b/plugins/thumbnails/thumbnails.php
index c71a043..99b8a03 100755
--- a/plugins/thumbnails/thumbnails.php
+++ b/plugins/thumbnails/thumbnails.php
@@ -210,12 +210,13 @@ class thumbnailGenerator extends BaseProcessor
}
// do generation
$pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert';
+ $pageNumber = $type == 'pdf' ? "[0]" : $mimeType == 'image/tiff' ? "[0]":""; // If its a pdf or tiff, just convert first page
// windows path may contain spaces
if (stristr(PHP_OS,'WIN')) {
- $cmd = "\"{$pathConvert}\" \"{$srcFile}" . ($type == 'pdf' ? "[0]" : "") . "\" -resize 200x200 \"$thumbnailfile\"";
+ $cmd = "\"{$pathConvert}\" \"{$srcFile}" . $pageNumber . "\" -resize 200x200 \"$thumbnailfile\"";
}
else {
- $cmd = "{$pathConvert} {$srcFile}" . ($type == 'pdf' ? "[0]" : "") . " -resize 200x200 $thumbnailfile";
+ $cmd = "{$pathConvert} {$srcFile}" . $pageNumber . " -resize 200x200 $thumbnailfile";
}
$result = KTUtil::pexec($cmd);
diff --git a/setup/upgrade/upgradeUtil.php b/setup/upgrade/upgradeUtil.php
index 6bfd6f2..33268e4 100644
--- a/setup/upgrade/upgradeUtil.php
+++ b/setup/upgrade/upgradeUtil.php
@@ -161,8 +161,7 @@ class UpgradeUtil extends InstallUtil {
$mechanism = "--port=\"$dbPort\"";
}
-// $tmpdir = $this->resolveTempDir();
- $this->resolveTempDir();
+ $this->util->resolveTempDir();
$stmt = $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism drop \"$dbName\"
";
$stmt .= $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism create \"$dbName\"
";
@@ -214,24 +213,7 @@ class UpgradeUtil extends InstallUtil {
return '';
}
- public function resolveTempDir()
- {
- $dir = '';
- if (!WINDOWS_OS) {
- $dir='/tmp/kt-db-backup';
- }
- else {
- $dir='c:/kt-db-backup';
- }
-// $oKTConfig =& KTConfig::getSingleton();
-// $dir = $oKTConfig->get('backup/backupDirectory',$dir);
-
- if (!is_dir($dir)) {
- mkdir($dir);
- }
- return $dir;
- }
}
?>
\ No newline at end of file
diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php
index 0e4d47f..407db15 100644
--- a/setup/wizard/installUtil.php
+++ b/setup/wizard/installUtil.php
@@ -1071,11 +1071,11 @@ class InstallUtil {
}
}
if (substr($sDst, 0, strlen($sSrc)) === $sSrc) {
- return false; //PEAR::raiseError(_kt("Destination of move is within source"));
+ return false;
}
$hSrc = @opendir($sSrc);
if ($hSrc === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Could not open source directory: %s"), $sSrc));
+ return false;
}
@mkdir($sDst, 0777);
while (($sFilename = readdir($hSrc)) !== false) {
@@ -1112,34 +1112,47 @@ class InstallUtil {
}
$aSrcStat = stat($sSrc);
if ($aSrcStat === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Couldn't stat source file: %s"), $sSrc));
+ return false;
}
$aDstStat = stat(dirname($sDst));
if ($aDstStat === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Couldn't stat destination location: %s"), $sDst));
+ return false;
}
if ($aSrcStat["dev"] === $aDstStat["dev"]) {
$res = @rename($sSrc, $sDst);
if ($res === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Couldn't move file to destination: %s"), $sDst));
+ return false;
}
return;
}
$res = @copy($sSrc, $sDst);
if ($res === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Could not copy to destination: %s"), $sDst));
+ return false;
}
$res = @unlink($sSrc);
if ($res === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Could not remove source: %s"), $sSrc));
+ return false;
}
} else {
$res = @rename($sSrc, $sDst);
if ($res === false) {
- return false; //PEAR::raiseError(sprintf(_kt("Could not move to destination: %s"), $sDst));
+ return false;
}
}
}
- // }}}
+
+ public function resolveTempDir() {
+ $dir = '';
+ if (!WINDOWS_OS) {
+ $dir='/tmp/kt-db-backup';
+ } else {
+ $dir='c:/kt-db-backup';
+ }
+
+ if (!is_dir($dir)) {
+ mkdir($dir);
+ }
+ return $dir;
+ }
}
?>
diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php
index a1b3a57..0cca189 100644
--- a/setup/wizard/lib/services/unixScheduler.php
+++ b/setup/wizard/lib/services/unixScheduler.php
@@ -112,7 +112,6 @@ class unixScheduler extends unixService {
$content = "#!/bin/sh\n";
$content .= "cd ".SYS_BIN_DIR."\n";
$content .= "while true; do\n";
- // TODO : This will not work without CLI
$content .= "{$this->phpCli} -Cq scheduler.php\n";
$content .= "sleep 30\n";
$content .= "done";
@@ -176,24 +175,15 @@ class unixScheduler extends unixService {
* @return array
*/
function start() {
- // TODO : Write sh on the fly? Not sure the reasoning here
$source = $this->getSchedulerSourceLoc();
-// $this->writeSchedulerTask();
$logFile = "/dev/null";
-// @unlink($logFile);
if($source) { // Source
$cmd = "nohup ".$source." > ".$logFile." 2>&1 & echo $!";
} else { // Could be Stack
$source = SYS_BIN_DIR.$this->schedulerSource;
$cmd = "nohup ".$source." > ".$logFile." 2>&1 & echo $!";
}
-// if(DEBUG) {
-// echo "$cmd
";
-// return ;
-// }
- //$response = $this->util->pexec($cmd);
-
-// return $response;
+
return false;
}
diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php
index efdf603..2e14227 100644
--- a/setup/wizard/lib/services/windowsLucene.php
+++ b/setup/wizard/lib/services/windowsLucene.php
@@ -172,10 +172,10 @@ class windowsLucene extends windowsService {
return true;
}
}
- // TODO: Will not detect, but a java pre-check is done in services, before this
if(file_exists($this->varDir.'outJVHome')) {
$this->javaBin = file_get_contents($this->varDir.'outJVHome');
- if($this->javaBin != '') return true;
+ if($this->javaBin != '')
+ return true;
}
return false;
@@ -400,8 +400,7 @@ class windowsLucene extends windowsService {
*/
public function getJavaJVM() {
$this->javaJVM = SYSTEM_ROOT . "java\jre\bin\client\jvm.dll";
- return SYSTEM_ROOT . "java\jre\bin\client\jvm.dll"; // Hard code
- //return $this->javaJVM; // TODO: PUT BACK!!!
+ return SYSTEM_ROOT . "java\jre\bin\client\jvm.dll";
}
private function writeLuceneInstall($cmd) {
diff --git a/setup/wizard/lib/validation/luceneValidation.php b/setup/wizard/lib/validation/luceneValidation.php
index 80dcf47..8302815 100644
--- a/setup/wizard/lib/validation/luceneValidation.php
+++ b/setup/wizard/lib/validation/luceneValidation.php
@@ -380,28 +380,6 @@ class luceneValidation extends serviceValidation {
}
$javaExecutable = $this->java;
}
- if(WINDOWS_OS) {
- $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\"";
- $func = OS."ReadJVFromFile";
- if($this->$func($cmd)) {
- return true;
- } else {
- $this->java = $this->util->useZendJava(); // Java not installed
- $javaExecutable = $this->java;
- $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\"";
- if($this->$func($cmd)) {
- return true;
- }
- }
- } else {
- $cmd = "\"$javaExecutable\" -version > ".$this->outputDir."outJV 2>&1 echo $!";
- $func = OS."ReadJVFromFile";
- if($this->$func($cmd)) {
- return true;
- } else {
- // TODO: Not sure
- }
- }
$this->javaVersionInCorrect();
$this->javaCheck = 'cross';
diff --git a/setup/wizard/lib/validation/schedulerValidation.php b/setup/wizard/lib/validation/schedulerValidation.php
index 1faa6a1..49333f7 100644
--- a/setup/wizard/lib/validation/schedulerValidation.php
+++ b/setup/wizard/lib/validation/schedulerValidation.php
@@ -89,7 +89,6 @@ class schedulerValidation extends serviceValidation {
}
public function binaryChecks() {
- // TODO: Better detection
$phpDir = $this->util->useZendPhp();
if(WINDOWS_OS) {
$phpPath = "$phpDir"."php.exe";
@@ -101,29 +100,6 @@ class schedulerValidation extends serviceValidation {
}
}
- function detPhpSettings() {
- // TODO: Better php handling
- return true;
- $phpExecutable = $this->util->phpSpecified();// Retrieve java bin
- $cmd = "$phpExecutable -version > ".$this->outputDir."/outPHP 2>&1 echo $!";
- $response = $this->util->pexec($cmd);
- if(file_exists($this->outputDir.'outPHP')) {
- $tmp = file_get_contents($this->outputDir.'outPHP');
- preg_match('/PHP/',$tmp, $matches);
- if($matches) {
- $this->phpCheck = 'tick';
-
- return true;
- } else {
- $this->phpCheck = 'cross_orange';
- $this->phpExeError = "PHP : Incorrect path specified";
- $this->error[] = "PHP executable required";
-
- return false;
- }
- }
- }
-
/**
* Set template view to specify php
*
@@ -150,7 +126,7 @@ class schedulerValidation extends serviceValidation {
return $this->php;
}
- public function storeSilent() { // TODO : PHP detection
+ public function storeSilent() {
$this->temp_variables['schedulerInstalled'] = $this->installed;
$this->temp_variables['phpCheck'] = $this->phpCheck;
$this->temp_variables['phpExeError'] = $this->phpExeError;