mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 07:22:11 +00:00
make it work in recent versions of seeddms
This commit is contained in:
parent
9d69bd12eb
commit
2f0fdfca19
|
@ -18,16 +18,12 @@
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
include("../inc/inc.Settings.php");
|
include("../../inc/inc.Settings.php");
|
||||||
include("../inc/inc.AccessUtils.php");
|
include("../../inc/inc.Utils.php");
|
||||||
include("../inc/inc.ClassAccess.php");
|
include("../../inc/inc.LogInit.php");
|
||||||
include("../inc/inc.ClassDocument.php");
|
include("../../inc/inc.Language.php");
|
||||||
include("../inc/inc.ClassFolder.php");
|
include("../../inc/inc.Init.php");
|
||||||
include("../inc/inc.ClassGroup.php");
|
include("../../inc/inc.DBInit.php");
|
||||||
include("../inc/inc.ClassUser.php");
|
|
||||||
include("../inc/inc.DBAccess.php");
|
|
||||||
include("../inc/inc.FileUtils.php");
|
|
||||||
include("../inc/inc.Authentication.php");
|
|
||||||
|
|
||||||
print "<html></body>";
|
print "<html></body>";
|
||||||
|
|
||||||
|
@ -42,7 +38,7 @@ function update_content()
|
||||||
GLOBAL $db,$settings;
|
GLOBAL $db,$settings;
|
||||||
|
|
||||||
// create temp folder
|
// create temp folder
|
||||||
if (!makedir($settings->_contentDir."/temp")) return false;
|
if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp")) return false;
|
||||||
|
|
||||||
// for all contents
|
// for all contents
|
||||||
$queryStr = "SELECT * FROM tblDocumentContent";
|
$queryStr = "SELECT * FROM tblDocumentContent";
|
||||||
|
@ -53,19 +49,19 @@ function update_content()
|
||||||
for ($i=0;$i<count($contents);$i++){
|
for ($i=0;$i<count($contents);$i++){
|
||||||
|
|
||||||
// create temp/documentID folder
|
// create temp/documentID folder
|
||||||
if (!makedir($settings->_contentDir."/temp/".$contents[$i]["document"])) return false;
|
if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp/".$contents[$i]["document"])) return false;
|
||||||
|
|
||||||
// move every content in temp/documentID/version.fileType
|
// move every content in temp/documentID/version.fileType
|
||||||
$source = $settings->_contentDir."/".$contents[$i]["dir"]."/data".$contents[$i]["fileType"];
|
$source = $settings->_contentDir."/".$contents[$i]["dir"]."/data".$contents[$i]["fileType"];
|
||||||
|
|
||||||
$target = $settings->_contentDir."/temp/".$contents[$i]["document"]."/".$contents[$i]["version"].$contents[$i]["fileType"];
|
$target = $settings->_contentDir."/temp/".$contents[$i]["document"]."/".$contents[$i]["version"].$contents[$i]["fileType"];
|
||||||
if (!copyFile($source, $target)) return false;
|
if (!SeedDMS_Core_File::copyFile($source, $target)) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// change directory
|
// change directory
|
||||||
if (!renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false;
|
if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false;
|
||||||
if (!renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false;
|
if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user