[Fusionforge-commits] r11224 - in trunk/src: common/docman/actions common/docman/views www/docman www/themes/funky

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Thu Oct 28 11:23:05 CEST 2010


Author: nerville
Date: 2010-10-28 11:23:05 +0200 (Thu, 28 Oct 2010)
New Revision: 11224

Added:
   trunk/src/common/docman/actions/lockfile.php
Modified:
   trunk/src/common/docman/views/listfile.php
   trunk/src/www/docman/index.php
   trunk/src/www/themes/funky/Theme.class.php
Log:
dynamic lock/unlock based on jquery in funky theme

Copied: trunk/src/common/docman/actions/lockfile.php (from rev 11223, trunk/src/common/docman/actions/reservefile.php)
===================================================================
--- trunk/src/common/docman/actions/lockfile.php	                        (rev 0)
+++ trunk/src/common/docman/actions/lockfile.php	2010-10-28 09:23:05 UTC (rev 11224)
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2010, Franck Villaume - Capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* please do not add require here : use www/docman/index.php to add require */
+/* global variables used */
+global $g; //group object
+global $dirid; //id of doc_group
+global $group_id; // id of group
+global $LUSER; // User object
+
+if (!forge_check_perm ('docman', $group_id, 'approve')) {
+	$return_msg = _('Document Action Denied');
+	session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&warning_msg='.urlencode($return_msg));
+} else {
+
+	$fileid = getIntFromRequest('fileid');
+    $lock = getIntFromRequest('lock');
+	$d= new Document($g,$fileid);
+
+	if ($d->isError())
+	    session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($d->getErrorMessage()));
+
+	echo $d->setLock($lock);
+    exit;
+}
+?>

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2010-10-27 23:33:16 UTC (rev 11223)
+++ trunk/src/common/docman/views/listfile.php	2010-10-28 09:23:05 UTC (rev 11224)
@@ -72,8 +72,12 @@
 	var divid = 'editfile'+id;
 	if ( 'none' == document.getElementById(divid).style.display ) {
 		document.getElementById(divid).style.display = 'block';
+        jQuery.get('http://forge/docman/',
+                    {group_id:6,action:'lockfile',lock:1,fileid:id});
 	} else {
 		document.getElementById(divid).style.display = 'none';
+        jQuery.get('http://forge/docman/',
+                    {group_id:6,action:'lockfile',lock:0,fileid:id});
 	}
 }
 </script>

Modified: trunk/src/www/docman/index.php
===================================================================
--- trunk/src/www/docman/index.php	2010-10-27 23:33:16 UTC (rev 11223)
+++ trunk/src/www/docman/index.php	2010-10-28 09:23:05 UTC (rev 11224)
@@ -96,6 +96,7 @@
 	case "reservefile":
 	case "releasefile":
 	case "enforcereserve":
+	case "lockfile":
 		include ("docman/actions/$action.php");
 		break;
 }

Modified: trunk/src/www/themes/funky/Theme.class.php
===================================================================
--- trunk/src/www/themes/funky/Theme.class.php	2010-10-27 23:33:16 UTC (rev 11223)
+++ trunk/src/www/themes/funky/Theme.class.php	2010-10-28 09:23:05 UTC (rev 11224)
@@ -401,9 +401,10 @@
         echo '<script type="text/javascript" src="/scripts/codendi/validate.js"></script>';
         echo '<script type="text/javascript" src="/scripts/codendi/Tooltip.js"></script>';
         
-        // echo '<script type="text/javascript" src="'.$this->themeurl.'js/jquery-1.4.2.min.js"></script>' ."\n";
+        echo '<script type="text/javascript" src="'.$this->themeurl.'js/jquery-1.4.2.min.js"></script>' ."\n";
         ?>
         <script>
+            var JQuery = jQuery.noConflict();
             $(window).load(function(){
                     jQuery(".quicknews").hide();
             });




More information about the Fusionforge-commits mailing list