setting defaults of 100 days and directory / and enhanced efficient delete method to be used even if number of days is specified

This commit is contained in:
Ralf Becker 2016-03-03 13:43:42 +00:00
parent de8d48cc20
commit dee934e1f5
4 changed files with 17 additions and 9 deletions

View File

@ -183,9 +183,9 @@ class filemanager_admin extends filemanager_ui
$deleted = $errors = 0; $deleted = $errors = 0;
// shortcut to efficently delete every old version and deleted file // shortcut to efficently delete every old version and deleted file
if ($content['versionedpath'] == '/' && !$content['ctime']) if ($content['versionedpath'] == '/')
{ {
$deleted = Versioning\StreamWrapper::purge_all_versioning(); $deleted = Versioning\StreamWrapper::purge_all_versioning($content['mtime']);
} }
else else
{ {
@ -194,8 +194,8 @@ class filemanager_admin extends filemanager_ui
'hidden' => true, 'hidden' => true,
'depth' => true, 'depth' => true,
'path_preg' => '#/\.(attic|versions)/#', 'path_preg' => '#/\.(attic|versions)/#',
)+(!(int)$content['ctime'] ? array() : array( )+(!(int)$content['mtime'] ? array() : array(
'ctime' => ($content['ctime']<0?'-':'+').(int)$content['ctime'], 'mtime' => ($content['mtime']<0?'-':'+').(int)$content['mtime'],
)), function($path) use (&$deleted, &$errors) )), function($path) use (&$deleted, &$errors)
{ {
if (($is_dir = Vfs::is_dir($path)) && Vfs::rmdir($path) || if (($is_dir = Vfs::is_dir($path)) && Vfs::rmdir($path) ||
@ -218,9 +218,15 @@ class filemanager_admin extends filemanager_ui
} }
} }
} }
else
{
// defaults for deleting of older versions
$content['versionedpath'] = '/';
$content['mtime'] = 100;
}
if (true) $content = array( if (true) $content = array(
'versionedpath' => $content['versionedpath'], 'versionedpath' => $content['versionedpath'],
'ctime' => $content['ctime'], 'mtime' => $content['mtime'],
); );
if ($this->versioning) if ($this->versioning)
{ {

View File

@ -26,6 +26,7 @@
%d erros while moving, %d files successfully moved. filemanager de %d Fehler beim Verschieben (%d Dateien erfolgreich verschoben)! %d erros while moving, %d files successfully moved. filemanager de %d Fehler beim Verschieben (%d Dateien erfolgreich verschoben)!
%d files successfully copied. filemanager de %d Dateien erfolgreich kopiert %d files successfully copied. filemanager de %d Dateien erfolgreich kopiert
%d files successfully moved. filemanager de %d Dateien erfolgreich verschoben %d files successfully moved. filemanager de %d Dateien erfolgreich verschoben
/ = everywhere filemanager de / = überall
0 means all, -n newer then n days filemanager de 0 für alle, -N für neuer als N Tage 0 means all, -n newer then n days filemanager de 0 für alle, -N für neuer als N Tage
accessrights filemanager de Zugangsberechtigungen accessrights filemanager de Zugangsberechtigungen
acl added. filemanager de Zugriffsrecht hinzugefügt. acl added. filemanager de Zugriffsrecht hinzugefügt.
@ -264,6 +265,7 @@ there's already a file with that name! filemanager de Es gibt bereits eine Datei
tile view filemanager de Kachelansicht tile view filemanager de Kachelansicht
to overwrite the existing file store again. filemanager de Zum Überschreiben der Datei nochmal speichern. to overwrite the existing file store again. filemanager de Zum Überschreiben der Datei nochmal speichern.
total files filemanager de Gesamtanzahl Dateien total files filemanager de Gesamtanzahl Dateien
under directory filemanager de unter dem Verzeichnis
unmount filemanager de Unmount unmount filemanager de Unmount
unused space filemanager de Nicht benutzter Platz unused space filemanager de Nicht benutzter Platz
up filemanager de Nach oben up filemanager de Nach oben
@ -273,7 +275,6 @@ upload files filemanager de Dateien hochladen
use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager de Benutzen Sie dieses Symbol für Adressetiketten. Stellen Sie den Inhalt der wiederholt werden soll zwischen 2 Symbole. use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager de Benutzen Sie dieses Symbol für Adressetiketten. Stellen Sie den Inhalt der wiederholt werden soll zwischen 2 Symbole.
used space filemanager de Benutzter Platz used space filemanager de Benutzter Platz
users and groups filemanager de Benutzer und Gruppen users and groups filemanager de Benutzer und Gruppen
versioned directory filemanager de Versioniertes Verzeichnis
versioning filemanager de Versionierung versioning filemanager de Versionierung
vfs mounts and versioning common de VFS einhängen und versionieren vfs mounts and versioning common de VFS einhängen und versionieren
who should be allowed to finally delete deleted files or old versions of a file: filemanager de Wer soll gelöschte Dateien oder ältere Versionen endgültig löschen dürfen: who should be allowed to finally delete deleted files or old versions of a file: filemanager de Wer soll gelöschte Dateien oder ältere Versionen endgültig löschen dürfen:

View File

@ -26,6 +26,7 @@
%d erros while moving, %d files successfully moved. filemanager en %d errors while moving, %d files successfully moved. %d erros while moving, %d files successfully moved. filemanager en %d errors while moving, %d files successfully moved.
%d files successfully copied. filemanager en %d files successfully copied. %d files successfully copied. filemanager en %d files successfully copied.
%d files successfully moved. filemanager en %d files successfully moved. %d files successfully moved. filemanager en %d files successfully moved.
/ = everywhere filemanager en / = everywhere
0 means all, -n newer then n days filemanager en 0 means all, -N newer then N days 0 means all, -n newer then n days filemanager en 0 means all, -N newer then N days
accessrights filemanager en Access rights accessrights filemanager en Access rights
acl added. filemanager en ACL added. acl added. filemanager en ACL added.
@ -264,6 +265,7 @@ there's already a file with that name! filemanager en There's already a file wit
tile view filemanager en Tile view tile view filemanager en Tile view
to overwrite the existing file store again. filemanager en To overwrite the existing filestore again to overwrite the existing file store again. filemanager en To overwrite the existing filestore again
total files filemanager en Total files total files filemanager en Total files
under directory filemanager en under directory
unmount filemanager en Unmount unmount filemanager en Unmount
unused space filemanager en Unused space unused space filemanager en Unused space
up filemanager en Up up filemanager en Up
@ -273,7 +275,6 @@ upload files filemanager en Upload files
use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager en Use this tag for addresslabels. Put the content, you want to repeat, between two tags. use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager en Use this tag for addresslabels. Put the content, you want to repeat, between two tags.
used space filemanager en Used space used space filemanager en Used space
users and groups filemanager en Users and groups users and groups filemanager en Users and groups
versioned directory filemanager en Versioned directory
versioning filemanager en Versioning versioning filemanager en Versioning
vfs mounts and versioning common en VFS mounts and versioning vfs mounts and versioning common en VFS mounts and versioning
who should be allowed to finally delete deleted files or old versions of a file: filemanager en Who should be allowed to finally delete deleted files or old versions of a file: who should be allowed to finally delete deleted files or old versions of a file: filemanager en Who should be allowed to finally delete deleted files or old versions of a file:

View File

@ -69,8 +69,8 @@
<menupopup id="allow_delete_versions" onchange="1" label="Who should be allowed to finally delete deleted files or old versions of a file:" disabled="!@versioning"/> <menupopup id="allow_delete_versions" onchange="1" label="Who should be allowed to finally delete deleted files or old versions of a file:" disabled="!@versioning"/>
</menulist> </menulist>
<hbox disabled="!@versioning"> <hbox disabled="!@versioning">
<integer id="ctime" label="Delete all older versions and deleted files older then %s days" statustext="0 means all, -N newer then N days"/> <integer id="mtime" label="Delete all older versions and deleted files older then %s days" statustext="0 means all, -N newer then N days"/>
<textbox size="30" id="versionedpath" blur="Versioned directory"/> <textbox size="30" label="under directory" id="versionedpath" statustext="/ = everywhere"/>
<button id="delete-versions" label="Finally delete" onclick="et2_dialog.confirm(widget,'Finally delete all older versions and deleted files under given directory.\n\nThis can NOT be undone!','Confirm final delete');" image="delete" background_image="1"/> <button id="delete-versions" label="Finally delete" onclick="et2_dialog.confirm(widget,'Finally delete all older versions and deleted files under given directory.\n\nThis can NOT be undone!','Confirm final delete');" image="delete" background_image="1"/>
</hbox> </hbox>
<grid> <grid>