Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/index.php,v
retrieving revision 1.30.2.9.2.18
diff -u -w -d -b -r1.30.2.9.2.18 index.php
--- index.php	19 Jul 2004 07:57:48 -0000	1.30.2.9.2.18
+++ index.php	27 Oct 2004 12:47:20 -0000
@@ -978,6 +997,25 @@
 				}
 	
 				###
+				# Lock is on or off
+				###
+				if ( $GLOBALS['settings']['locks'] )
+				{
+					html_table_col_begin ();
+					$lock = @end($files['locks']);
+					if ( $lock ) 
+					{
+						$t = explode('-',$lock['timeout']);
+						html_text ($t[1] .'s');
+					}
+					else
+					{
+						html_text('-');
+					}
+					html_table_col_end ();
+				}
+				
+				###
 				# MIME type
 				###
 	
@@ -1156,6 +1194,12 @@
 								html_form_select_begin ('menu',0,"document.getElementById('file_menu').selectedIndex>5 ? (document.getElementById('menu_todir').disabled=false) : document.getElementById('form_files').submit()",NULL,True,'file_menu');
 									html_form_option ('',lang('Menu -->'),1);
 									html_form_option ('edit',lang('Edit'));
+									//FIXME: This is only available for webdav 'till now
+									if ( $GLOBALS['phpgw_info']['server']['file_repository'] == 'dav' )
+									{
+										html_form_option ('lock',lang('Lock'));
+										html_form_option ('unlock',lang('Unlock'));
+									}
 									html_form_option ('rename',lang('Rename'));
 									html_form_option ('delete',lang('Delete'));
 									html_form_option ('edit_comments',lang('Edit comments'));
@@ -1852,6 +1896,63 @@
 	html_break (2);
 	html_link_back ();
 }
-
+##
+# Handle locking files
+##
+elseif($menu == 'lock')
+{
+	while (list ($num, $file) = @each ($fileman))
+	{
+		$fileop = array ( 'string'        => $path . '/' . $file,
+				'relatives'     => array (RELATIVE_NONE),
+				'checksubdirs'  => False,
+				'nofiles'       => True
+				);
+		if ( $GLOBALS['settings']['lock_timeout'] )
+		{
+			$fileop += array('timeout' => $GLOBALS['settings']['lock_timeout']);
+		}
+		else
+		{
+			$fileop += array('timeout' => 3600);
+		}
+		if ( ($ans = $GLOBALS['phpgw']->vfs->lock($fileop)) )
+		{
+			html_text( lang( 'Locking the files ok !' ) );
+			$tok = $GLOBALS['phpgw']->vfs->lock_token($fileop);
+			$fileinfo['token'] = $tok;
+			//Doing this allow us (and only us !) to work on the file for this session
+			$GLOBALS['phpgw']->vfs->add_lock_override($fileop,$tok);
+		}
+		else
+		{
+			html_text( lang( 'Locking file failed !' ));
+		}
+	}
+	html_break (2);
+	html_link_back ();
+}
+elseif($menu == 'unlock')
+{
+	while (list ($num, $file) = @each ($fileman))
+	{
+		$fileop = array ( 'string'        => $path . '/' . $file,
+				'relatives'     => array (RELATIVE_NONE),
+				'checksubdirs'  => False,
+				'nofiles'       => True
+				);
+		$tok = $GLOBALS['phpgw']->vfs->lock_token($fileop,false);
+		if ( !empty($tok) && $GLOBALS['phpgw']->vfs->unlock($fileop,$tok) )
+		{
+			html_text(lang( 'unlocking ok' ) );
+		}
+		else
+		{
+			html_text( lang( 'unlocking failed !' ));
+		}
+	}
+	html_break (2);
+	html_link_back ();
+}
 html_page_close ();
 ?>
Index: preferences.php
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/preferences.php,v
retrieving revision 1.6.2.2.2.8
diff -u -w -d -b -r1.6.2.2.2.8 preferences.php
--- preferences.php	26 Feb 2004 01:45:07 -0000	1.6.2.2.2.8
+++ preferences.php	27 Oct 2004 12:47:20 -0000
@@ -37,6 +37,11 @@
 	   displayed name, value values are choices in the dropdown
 	*/
 	$other_dropdown = array ("show_upload_boxes" => array (lang("Default number of upload fields to show"), "1", "5", "10", "20", "30"));
+	if ( $GLOBALS['phpgw_info']['server']['file_repository'] == 'dav' )
+	{
+		// the 0 value is for getting the default from apache server
+		$other_dropdown += array ('lock_timeout' => array(lang('Dav Locks Timeout (in seconds)'),"0","600","3600","28800"));
+	}
 	
 	/*
 	   To add a input field preferences, add it here.  Key is internal name, value key is
Index: inc/main.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/inc/Attic/main.inc.php,v
retrieving revision 1.14.2.2.2.4
diff -u -w -d -b -r1.14.2.2.2.4 main.inc.php
--- inc/main.inc.php	26 Feb 2004 01:45:08 -0000	1.14.2.2.2.4
+++ inc/main.inc.php	27 Oct 2004 12:47:20 -0000
@@ -83,8 +83,11 @@
 # This is used both by internally and externally for things like preferences
 ###
 
+if ( $GLOBALS['phpgw_info']['server']['file_repository'] == 'dav' )
+{
 $file_attributes = Array(
 	'name' => lang('File Name'),
+	'locks' => lang('Locks'),
	'mime_type' => lang('MIME Type'),
 	'size' => lang('Size'),
 	'created' => lang('Created'),
@@ -97,6 +100,24 @@
 	'comment' => lang('Comment'),
 	'version' => lang('Version')
 );
+}
+else
+{
+	$file_attributes = Array(
+		'name' => lang('File Name'),
+		'mime_type' => lang('MIME Type'),
+		'size' => lang('Size'),
+		'created' => lang('Created'),
+		'modified' => lang('Modified'),
+		'owner' => lang('Owner'),
+		'createdby_id' => lang('Created by'),
+		'modifiedby_id' => lang('Created by'),
+		'modifiedby_id' => lang('Modified by'),
+		'app' => lang('Application'),
+		'comment' => lang('Comment'),
+		'version' => lang('Version')
+	);
+}
 
 ###
 # Calculate and display B or KB or MB
Index: setup/phpgw_en.lang
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/setup/phpgw_en.lang,v
retrieving revision 1.1.2.3.2.6
diff -u -w -d -b -r1.1.2.3.2.6 phpgw_en.lang
--- setup/phpgw_en.lang	26 Feb 2004 01:45:09 -0000	1.1.2.3.2.6
+++ setup/phpgw_en.lang	27 Oct 2004 12:47:20 -0000
@@ -3,6 +3,7 @@
 back to file manager	filemanager	en	Back to file manager
 cannot create directory because it begins or ends in a space	filemanager	en	Cannot create directory because it begins or ends in a space
 cannot replace %1 because it is a directory	filemanager	en	Cannot replace %1 because it is a directory
+choose directory -->	filemanager	en	Choose Directory -->
 command sucessfully run	filemanager	en	Command sucessfully run
 comment	filemanager	en	Comment
 comments cannot contain "%1"	filemanager	en	Comments cannot contain "%1"
@@ -10,15 +11,15 @@
 copy to	filemanager	en	Copy To
 copy to:	filemanager	en	Copy to:
 could not copy %1 to %2	filemanager	en	Could not copy %1 to %2
-Could not copy %1 to %2 Quota exceeded	filemanager	en	Could not copy %1 to %2 Quota exceeded
+could not copy %1 to %2 quota exceeded	filemanager	en	Could not copy %1 to %2 Quota exceeded
 could not create %1	filemanager	en	Could not create %1
 could not create directory %1	filemanager	en	Could not create directory %1
 could not delete %1	filemanager	en	Could not delete %1
 could not move %1 to %2	filemanager	en	Could not move %1 to %2
-Could not move %1 to %2 Quota exceeded	filemanager	en	Could not move %1 to %2 Quota exceeded
+could not move %1 to %2 quota exceeded	filemanager	en	Could not move %1 to %2 Quota exceeded
 could not rename %1 to %2	filemanager	en	Could not rename %1 to %2
 could not save %1	filemanager	en	Could not save %1
-could not upload %1 Quota exceeded	filemanager	en	could not upload %1 Quota exceeded
+could not upload %1 quota exceeded	filemanager	en	could not upload %1 Quota exceeded
 create file	filemanager	en	Create File
 create folder	filemanager	en	Create Folder
 created	filemanager	en	Created
@@ -26,6 +27,7 @@
 created by	filemanager	en	Created by
 created directory %1	filemanager	en	Created directory %1
 date	filemanager	en	Date
+dav locks timeout (in seconds)	filemanager	en	Dav Locks Timeout (in seconds)
 default number of upload fields to show	filemanager	en	Default number of upload fields to show
 delete	filemanager	en	Delete
 deleted %1	filemanager	en	Deleted %1
@@ -38,7 +40,7 @@
 edit	filemanager	en	Edit
 edit comments	filemanager	en	Edit comments
 edit quota	filemanager	en	Edit Quota
-Enter comma separated Quota value in MB	filemanager	en	Enter comma separated Quota value in MB
+enter comma separated quota value in mb	filemanager	en	Enter comma separated Quota value in MB
 erroneous input! check quota value!	filemanager	en	Erroneous input! Check Quota value!
 error running command	filemanager	en	Error running command
 execute	filemanager	en	Execute
@@ -58,7 +60,12 @@
 go to your home directory	filemanager	en	Go to your home directory
 go to:	filemanager	en	Go to:
 home	filemanager	en	Home
+lock	filemanager	en	Lock
 locked	filemanager	en	Locked
+locking file failed !	filemanager	en	Locking file failed !
+locking the files ok !	filemanager	en	Locking the files ok !
+locks	filemanager	en	Locks
+menu -->	filemanager	en	Menu -->
 mime type	filemanager	en	MIME Type
 modified	filemanager	en	Modified
 modified by	filemanager	en	Modified by
@@ -67,9 +74,11 @@
 moved %1 to %2	filemanager	en	Moved %1 to %2
 no version history for this file/directory	filemanager	en	No version history for this file/directory
 operation	filemanager	en	Operation
+other settings	filemanager	en	other settings
 owner	filemanager	en	Owner
 preview %1	filemanager	en	Preview %1
 preview of %1	filemanager	en	Preview of %1
+préférences	preferences	en	Préférences
 refresh	filemanager	en	Refresh
 rename	filemanager	en	Rename
 renamed %1 to %2	filemanager	en	Renamed %1 to %2
@@ -80,12 +89,17 @@
 show	filemanager	en	Show
 show ..	filemanager	en	Show ..
 show .files	filemanager	en	Show .files
+show command line (experimental. dangerous)	filemanager	en	Show command line (EXPERIMENTAL. DANGEROUS)
 show command line (experimental. dangerous.)	filemanager	en	Show command line (EXPERIMENTAL. DANGEROUS.)
+show dotfiles	filemanager	en	Show dotfiles
 show help	filemanager	en	Show help
 size	filemanager	en	Size
 sort by:	filemanager	en	Sort by:
 total files	filemanager	en	Total Files
 unknown mime-type defaults to text/plain when viewing	filemanager	en	Unknown MIME-type defaults to text/plain when viewing
+unlock	filemanager	en	Unlock
+unlocking failed !	filemanager	en	unlocking failed !
+unlocking ok	filemanager	en	unlocking ok
 unused space	filemanager	en	Unused space
 up	filemanager	en	Up
 update	filemanager	en	Update
Index: setup/phpgw_fr.lang
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/setup/phpgw_fr.lang,v
retrieving revision 1.1.2.4.2.3
diff -u -w -d -b -r1.1.2.4.2.3 phpgw_fr.lang
--- setup/phpgw_fr.lang	21 Apr 2003 18:04:09 -0000	1.1.2.4.2.3
+++ setup/phpgw_fr.lang	27 Oct 2004 12:47:20 -0000
@@ -3,6 +3,7 @@
 back to file manager	filemanager	fr	Retourner au gestionnaire de fichiers
 cannot create directory because it begins or ends in a space	filemanager	fr	Ne peut créér le répertoire car il commence ou finit sur un espace
 cannot replace %1 because it is a directory	filemanager	fr	Ne peut remplacer %1 parce-que c'est un répertoire
+choose directory -->	filemanager	fr	Choisir un répertoire -->
 command sucessfully run	filemanager	fr	Commande exécutée avec succès
 comment	filemanager	fr	Commentaire
 comments cannot contain "%1"	filemanager	fr	Les commentaires ne peuvent pas contenir "%1"
@@ -10,30 +11,37 @@
 copy to	filemanager	fr	Copier vers
 copy to:	filemanager	fr	Copier vers:
 could not copy %1 to %2	filemanager	fr	N'a pas pu copier %1 vers %2
+could not copy %1 to %2 quota exceeded	filemanager	fr	N'a pas pu copier %1 vers %2 (Dépassement de quota)
 could not create %1	filemanager	fr	N'a pas pu créér %1
 could not create directory %1	filemanager	fr	N'a pas pu créér le répertoire %1
 could not delete %1	filemanager	fr	N'a pas pu effacer %1
 could not move %1 to %2	filemanager	fr	N'a pas pu déplacer %1 to %2
+could not move %1 to %2 quota exceeded	filemanager	fr	N'a pas pu déplacer %1 to %2 (Dépassement de quota)
 could not rename %1 to %2	filemanager	fr	N'a pas pu renommer %1 to %2
 could not save %1	filemanager	fr	N'a pas pu enregistrer %1
-create file	filemanager	fr	Créér fichier
-create folder	filemanager	fr	Créér dossier
+could not upload %1 quota exceeded	filemanager	fr	N'a pas pu enregistrer %1 (Dépassement de quota)
+create file	filemanager	fr	Créer un fichier
+create folder	filemanager	fr	Créer un dossier
 created	filemanager	fr	Créé
 created %1	filemanager	fr	%1 créé
 created by	filemanager	fr	Créé par
 created directory %1	filemanager	fr	Répertoire %1 créé
 date	filemanager	fr	Date
+dav locks timeout (in seconds)	filemanager	fr	Délai maximal d'expiration du vérrou (en secondes)
 default number of upload fields to show	filemanager	fr	Nombre de champs d'upload par défaut à montrer
 delete	filemanager	fr	Effacer
 deleted %1	filemanager	fr	%1 effacé
 directory	filemanager	fr	Répertoire
 directory %1 already exists	filemanager	fr	Le répertoire %1 existe déjà
-Directory %1 does not exist	filemanager	fr	Le répertoire %1 n'existe pas
+directory %1 does not exist	filemanager	fr	Le répertoire %1 n'existe pas
 directory names cannot contain "%1"	filemanager	fr	Les noms de répertoire ne peuvent pas contenir "%1"
 display attributes	filemanager	fr	Afficher les attributs
 download	filemanager	fr	Downloader
 edit	filemanager	fr	Modifier
 edit comments	filemanager	fr	Modifier les commentaires
+edit quota	filemanager	fr	Modifier le quota
+enter comma separated quota value in mb	filemanager	fr	Rentrer les valeurs de quota, séparées par des virgules
+erroneous input! check quota value!	filemanager	fr	Entrée érronée ! La valeur du quota n'est pas valide.
 error running command	filemanager	fr	Erreur à l'exécution de la commande
 execute	filemanager	fr	Exécuter
 failed to create directory	filemanager	fr	Echec de création du répertoire
@@ -42,7 +50,7 @@
 file %1 could not be created.	filemanager	fr	Le fichier %1 n'a pas pu être créé.
 file name	filemanager	fr	Nom du fichier
 file names cannot contain "%1"	filemanager	fr	Les noms de fichier ne peuvent contenir "%1"
-File names cannot contain \ or /	filemanager	fr	Les noms de fichier ne peuvent contenir \ ou /
+file names cannot contain \ or /	filemanager	fr	Les noms de fichier ne peuvent contenir \ ou /
 filemanager	common	fr	Gestionnaire de fichiers
 filemanager preferences	filemanager	fr	Préférences filemanager
 files	filemanager	fr	Fichiers
@@ -52,7 +60,12 @@
 go to your home directory	filemanager	fr	Aller dans votre répertoire "home" (maison)
 go to:	filemanager	fr	Aller dans:
 home	filemanager	fr	Maison
+lock	filemanager	fr	Vérrouiller
 locked	filemanager	fr	Verouillé
+locking file failed !	filemanager	fr	La tentative de vérouillage a échoué !
+locking the files ok !	filemanager	fr	Le(s) vérrou(s) est(sont) acquis
+locks	filemanager	fr	Vérrous
+menu -->	filemanager	fr	Menu -->
 mime type	filemanager	fr	Type MIME
 modified	filemanager	fr	Modifié
 modified by	filemanager	fr	Modifié par
@@ -61,9 +74,12 @@
 moved %1 to %2	filemanager	fr	Déplacé %1 dans %2
 no version history for this file/directory	filemanager	fr	pas d'historique de versions pour ce fichier/répertoire
 operation	filemanager	fr	Opération
+other settings	filemanager	fr	Autres paramêtres
 owner	filemanager	fr	Propriétaire
 preview %1	filemanager	fr	Prévisualisation %1
 preview of %1	filemanager	fr	Prévisualisation de %1
+préférences	preferences	fr	Préférences
+refresh	filemanager	fr	Rafraîchir
 rename	filemanager	fr	Renommer
 renamed %1 to %2	filemanager	fr	Renommé %1 en %2
 replaced %1	filemanager	fr	Remplacé %1
@@ -73,22 +89,27 @@
 show	filemanager	fr	Montrer
 show ..	filemanager	fr	Montrer ..
 show .files	filemanager	fr	Montrer .fichiers
+show command line (experimental. dangerous)	filemanager	fr	Montrer la ligne de commande (EXPERIMENTAL. DANGEREUX.)
 show command line (experimental. dangerous.)	filemanager	fr	Montrer la ligne de commande (EXPERIMENTAL. DANGEREUX.)
+show dotfiles	filemanager	fr	Montrer les fichiers cachés
 show help	filemanager	fr	Montrer l'aide
 size	filemanager	fr	Taille
 sort by:	filemanager	fr	Trié par:
 total files	filemanager	fr	Total de fichiers
 unknown mime-type defaults to text/plain when viewing	filemanager	fr	text/plain utilisé par défaut si type MIME inconnu
+unlock	filemanager	fr	Dévérouiller
+unlocking failed !	filemanager	fr	La tentative de dévérouillage a échoué !
+unlocking ok	filemanager	fr	Le(s) vérou(s) a(ont) été retiré(s)
 unused space	filemanager	fr	Espace inutilisé
 up	filemanager	fr	Haut
 update	filemanager	fr	Mettre à jour
 updated comment for %1	filemanager	fr	Commentaire pour %1 mis à jour
-upload fields	filemanager	fr	Champs d'upload
-upload files	filemanager	fr	Fichiers d'upload
+upload fields	filemanager	fr	champs pour les fichiers à déposer
+upload files	filemanager	fr	Déposer ces fichiers
 used space	filemanager	fr	Espace utilisé
 users	filemanager	fr	Utilisateurs
 version	filemanager	fr	Version
 view documents in new window	filemanager	fr	Voir les documents dans une nouvelle fenêtre
 view documents on server (if available)	filemanager	fr	Voir les documents sur le serveur (si disponible)
 who	filemanager	fr	Qui
-You do not have access to %1	filemanager	fr	Vous n'avez pas accès à %1
+you do not have access to %1	filemanager	fr	Vous n'avez pas accès à %1
