mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Merge branch '3.7'
This commit is contained in:
@@ -176,7 +176,6 @@ class task_period_archive extends task_abstract
|
|||||||
<?php echo $form ?>.copy_spe.checked = <?php echo \p4field::isyes($sxml->copy_spe) ? "true" : "false" ?>;
|
<?php echo $form ?>.copy_spe.checked = <?php echo \p4field::isyes($sxml->copy_spe) ? "true" : "false" ?>;
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
return "BAD XML";
|
return "BAD XML";
|
||||||
@@ -204,7 +203,6 @@ class task_period_archive extends task_abstract
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +248,6 @@ class task_period_archive extends task_abstract
|
|||||||
<input type="checkbox" name="delfolder" onchange="chgxmlck(this, 'delfolder');"> <?php echo _('task::archive:supprimer les repertoires apres archivage') ?><br/>
|
<input type="checkbox" name="delfolder" onchange="chgxmlck(this, 'delfolder');"> <?php echo _('task::archive:supprimer les repertoires apres archivage') ?><br/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +397,6 @@ class task_period_archive extends task_abstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->setLastExecTime();
|
$this->setLastExecTime();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ( ! ($this->sxTaskSettings = @simplexml_load_string($this->getSettings()))) {
|
if ( ! ($this->sxTaskSettings = @simplexml_load_string($this->getSettings()))) {
|
||||||
throw new Exception(sprintf('Error fetching or reading settings of the task \'%d\'', $this->getID()));
|
throw new Exception(sprintf('Error fetching or reading settings of the task \'%d\'', $this->getID()));
|
||||||
@@ -601,6 +597,7 @@ class task_period_archive extends task_abstract
|
|||||||
$this->log("=========== archive ========== : \n" . $dom->saveXML());
|
$this->log("=========== archive ========== : \n" . $dom->saveXML());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->running) {
|
||||||
$this->bubbleResults($dom, $root, $path_in);
|
$this->bubbleResults($dom, $root, $path_in);
|
||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
$this->log("=========== bubbleResults ========== : \n" . $dom->saveXML());
|
$this->log("=========== bubbleResults ========== : \n" . $dom->saveXML());
|
||||||
@@ -610,7 +607,7 @@ class task_period_archive extends task_abstract
|
|||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
$this->log("=========== moveFiles ========== (returned " . ($r ? 'true' : 'false') . ") : \n" . $dom->saveXML());
|
$this->log("=========== moveFiles ========== (returned " . ($r ? 'true' : 'false') . ") : \n" . $dom->saveXML());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($this->movedFiles) {
|
if ($this->movedFiles) {
|
||||||
|
|
||||||
// something happened : a least one file has moved
|
// something happened : a least one file has moved
|
||||||
@@ -912,7 +909,7 @@ class task_period_archive extends task_abstract
|
|||||||
|
|
||||||
$xpath = new DOMXPath($dom);
|
$xpath = new DOMXPath($dom);
|
||||||
|
|
||||||
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
|
for ($n = $node->firstChild; $this->running && $n; $n = $n->nextSibling) {
|
||||||
if (($iloop ++ % 100) == 0) {
|
if (($iloop ++ % 100) == 0) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
@@ -1020,7 +1017,7 @@ class task_period_archive extends task_abstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
// scan again for unmatched files
|
// scan again for unmatched files
|
||||||
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
|
for ($n = $node->firstChild; $this->running && $n; $n = $n->nextSibling) {
|
||||||
if ( ! $n->getAttribute('isdir') == '1' && ! $n->getAttribute('match')) {
|
if ( ! $n->getAttribute('isdir') == '1' && ! $n->getAttribute('match')) {
|
||||||
// still no match, now it's an error (bubble to the top)
|
// still no match, now it's an error (bubble to the top)
|
||||||
for ($nn = $n; $nn && $nn->nodeType == XML_ELEMENT_NODE; $nn = $nn->parentNode) {
|
for ($nn = $n; $nn && $nn->nodeType == XML_ELEMENT_NODE; $nn = $nn->parentNode) {
|
||||||
@@ -1059,7 +1056,7 @@ class task_period_archive extends task_abstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nodesToDel = array();
|
$nodesToDel = array();
|
||||||
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
|
for ($n = $node->firstChild; $this->running && $n; $n = $n->nextSibling) {
|
||||||
if (($iloop ++ % 20) == 0) {
|
if (($iloop ++ % 20) == 0) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
@@ -1151,7 +1148,7 @@ class task_period_archive extends task_abstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nodesToDel = array();
|
$nodesToDel = array();
|
||||||
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
|
for ($n = $node->firstChild; $this->running && $n; $n = $n->nextSibling) {
|
||||||
if (($iloop ++ % 20) == 0) {
|
if (($iloop ++ % 20) == 0) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
@@ -1280,6 +1277,7 @@ class task_period_archive extends task_abstract
|
|||||||
*/
|
*/
|
||||||
private function moveFiles(\DOMDocument $dom, \DOMElement $node, $path, $path_archived, $path_error, $depth = 0)
|
private function moveFiles(\DOMDocument $dom, \DOMElement $node, $path, $path_archived, $path_error, $depth = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
static $iloop = 0;
|
static $iloop = 0;
|
||||||
if ($depth == 0) {
|
if ($depth == 0) {
|
||||||
$iloop = 0;
|
$iloop = 0;
|
||||||
@@ -1749,7 +1747,7 @@ class task_period_archive extends task_abstract
|
|||||||
private function archiveFilesToGrp(\DOMDocument $dom, \DOMElement $node, $path, $path_archived, $path_error, $grp_rid)
|
private function archiveFilesToGrp(\DOMDocument $dom, \DOMElement $node, $path, $path_archived, $path_error, $grp_rid)
|
||||||
{
|
{
|
||||||
$nodesToDel = array();
|
$nodesToDel = array();
|
||||||
for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
|
for ($n = $node->firstChild; $this->running && $n; $n = $n->nextSibling) {
|
||||||
if ($n->getAttribute('isdir') == '1') {
|
if ($n->getAttribute('isdir') == '1') {
|
||||||
// in a grp, all levels goes in the same grp
|
// in a grp, all levels goes in the same grp
|
||||||
$node->setAttribute('archived', '1'); // the main grp folder is 'keep'ed, but not subfolders
|
$node->setAttribute('archived', '1'); // the main grp folder is 'keep'ed, but not subfolders
|
||||||
|
Reference in New Issue
Block a user