[Fusionforge-commits] FusionForge branch master updated. e08fba1edd646066e0aa0b89449fde453d11d1ce

Franck Villaume nerville at fusionforge.org
Wed Sep 3 17:35:54 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  e08fba1edd646066e0aa0b89449fde453d11d1ce (commit)
       via  fa7806857bac28670cae52fd67259ea901418193 (commit)
      from  2a43cf3781b4d8223a45894f16f442798b2b703b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e08fba1edd646066e0aa0b89449fde453d11d1ce
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Sep 3 17:31:32 2014 +0200

    FRS: fix monitoring. You need to be logged to get own monitoring action/status

diff --git a/src/common/frs/views/listpackages.php b/src/common/frs/views/listpackages.php
index 8a22705..eb7bcbe 100644
--- a/src/common/frs/views/listpackages.php
+++ b/src/common/frs/views/listpackages.php
@@ -77,18 +77,21 @@ if (count($FRSPackages) < 1) {
 		$package_id = $FRSPackage->getID();
 		$package_name = $FRSPackage->getName();
 		$url = '/frs/?group_id='.$FRSPackage->Group->getID().'&package_id='.$package_id.'&action=monitor';
-		if($FRSPackage->isMonitoring()) {
-			$title = html_entity_decode($package_name).' - '._('Stop monitoring this package');
-			$url .= '&status=0';
-			$image = $HTML->getStopMonitoringPic($title);
+		if (session_loggedin()) {
+			if($FRSPackage->isMonitoring()) {
+				$title = html_entity_decode($package_name).' - '._('Stop monitoring this package');
+				$url .= '&status=0';
+				$image = $HTML->getStopMonitoringPic($title);
+			} else {
+				$title = html_entity_decode($package_name).' - '._('Start monitoring this package');
+				$url .= '&status=1';
+				$image = $HTML->getStartMonitoringPic($title);
+			}
+			$errorMessage = _('Unable to set monitoring');
+			$package_monitor = util_make_link('#', $image, array('id' => 'pkgid'.$package_id, 'onclick' => 'javascript:controllerFRS.doAction({action:\''.$url.'\', id:\'pkgid'.$package_id.'\'})'), true);
 		} else {
-			$title = html_entity_decode($package_name).' - '._('Start monitoring this package');
-			$url .= '&status=1';
-			$image = $HTML->getStartMonitoringPic($title);
+			$package_monitor = '';
 		}
-		$errorMessage = _('Unable to set monitoring');
-		$package_monitor = util_make_link('#', $image, array('id' => 'pkgid'.$package_id, 'onclick' => 'javascript:controllerFRS.doAction({action:\''.$url.'\', id:\'pkgid'.$package_id.'\'})'), true);
-
 		$package_name_protected = $HTML->toSlug($package_name);
 		echo html_e('h2', array('id' => 'title_'. $package_name_protected), html_entity_decode($package_name).html_e('span', array('class' => 'frs-monitor-package'), $package_monitor));
 

commit fa7806857bac28670cae52fd67259ea901418193
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Sep 3 16:42:40 2014 +0200

    start [#727] provide FRS better notification on action

diff --git a/src/common/include/Group.class.php b/src/common/include/Group.class.php
index 6edcdf8..5e054a8 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -1537,7 +1537,7 @@ class Group extends Error {
 	}
 
 	/**
-	 * DocEmailAll - whether or not this group has opted to use receive notices on all doc updates.
+	 * docEmailAll - whether or not this group has opted to use receive notices on all doc updates.
 	 *
 	 * @return	bool	email_on_all_doc_updates.
 	 */
@@ -1546,6 +1546,24 @@ class Group extends Error {
 	}
 
 	/**
+	 * getFRSEmailAddress - get email address(es) to send FRS notifications to.
+	 *
+	 * @return	string	email address.
+	 */
+	function getFRSEmailAddress() {
+		return $this->data_array['new_frs_address'];
+	}
+
+	/**
+	 * frsEmailAll - whether or not this group has opted to use receive notices on all frs updates.
+	 *
+	 * @return	bool	email_on_all_frs_updates.
+	 */
+	function frsEmailAll() {
+		return $this->data_array['send_all_frs'];
+	}
+
+	/**
 	 * getHomePage - The URL for this project's home page.
 	 *
 	 * @return	string	homepage URL.
diff --git a/src/db/20140903-group-add-frs-sendemail-columns.sql b/src/db/20140903-group-add-frs-sendemail-columns.sql
new file mode 100644
index 0000000..6c01c2e
--- /dev/null
+++ b/src/db/20140903-group-add-frs-sendemail-columns.sql
@@ -0,0 +1,6 @@
+ALTER TABLE GROUPS ADD COLUMN send_all_frs INT;
+ALTER TABLE GROUPS ALTER COLUMN send_all_frs SET DEFAULT 0;
+UPDATE GROUPS SET send_all_frs = 0;
+ALTER TABLE GROUPS ADD COLUMN new_frs_address TEXT;
+ALTER TABLE GROUPS ALTER COLUMN new_frs_address SET DEFAULT '';
+UPDATE GROUPS SET new_frs_address = '';
diff --git a/src/www/project/admin/index.php b/src/www/project/admin/index.php
index 95d7d15..31cc4de 100644
--- a/src/www/project/admin/index.php
+++ b/src/www/project/admin/index.php
@@ -69,6 +69,8 @@ if (getStringFromRequest('submit')) {
 	$addTags = getArrayFromRequest('addTags');
 	$new_doc_address = getStringFromRequest('new_doc_address');
 	$send_all_docs = getStringFromRequest('send_all_docs');
+	$new_frs_address = getStringFromRequest('new_frs_address');
+	$send_all_frs = getStringFromRequest('send_all_frs');
 
 	if (trim($tags) != "") {
 		$tags .= ",";
@@ -97,7 +99,9 @@ if (getStringFromRequest('submit')) {
 		$use_stats,
 		$tags,
 		$use_activity,
-		0
+		0,
+		$new_frs_address,
+		$send_all_frs
 	);
 
 	//100 $logo_image_id
@@ -249,17 +253,42 @@ if(forge_get_config('use_news')) {
 <?php
 }
 
+if ((forge_get_config('use_docman') && $group->usesDocman()) || (forge_get_config('use_frs') && $group->usesFRS())) {
+	echo html_e('h2', array(), _('Notifications setup'));
+}
+
 if(forge_get_config('use_docman')) {
 ?>
 <input type="hidden" name="use_docman" value="<?php echo ($group->usesDocman() ? '1' : '0'); ?>" />
-<p>
-<?php echo _('If you wish, you can provide default email addresses to which new submissions will be sent') ?>.<br />
-<strong><?php echo _('New Document Submissions')._(':'); ?></strong><br />
-<input type="email" name="new_doc_address" value="<?php echo $group->getDocEmailAddress(); ?>" size="40" maxlength="250" />
+<?php
+	if ($group->usesDocman()) {
+?>
+	<p>
+	<?php echo _('If you wish, you can provide default email addresses to which new submissions (documents or folders) will be sent') ?>.<br />
+	<strong><?php echo _('New document or folder Submissions')._(':'); ?></strong><br />
+	<input type="email" name="new_doc_address" value="<?php echo $group->getDocEmailAddress(); ?>" size="40" maxlength="250" />
+	<?php echo _('(send on all updates)') ?>
+	<input type="checkbox" name="send_all_docs" value="1" <?php echo c($group->docEmailAll()); ?> />
+	</p>
+	<?php
+	}
+}
+
+if(forge_get_config('use_frs')) {
+?>
+<input type="hidden" name="use_frs" value="<?php echo ($group->usesFRS() ? '1' : '0'); ?>" />
+<?php
+	if ($group->usesFRS()) {
+?>
+	<p>
+<?php echo _('If you wish, you can provide default email addresses to which new FRS (packages, releases or files) will be sent') ?>.<br />
+<strong><?php echo _('New packages, releases, files Submissions')._(':'); ?></strong><br />
+<input type="email" name="new_frs_address" value="<?php echo $group->getFRSEmailAddress(); ?>" size="40" maxlength="250" />
 <?php echo _('(send on all updates)') ?>
-<input type="checkbox" name="send_all_docs" value="1" <?php echo c($group->docEmailAll()); ?> />
+<input type="checkbox" name="send_all_frs" value="1" <?php echo c($group->frsEmailAll()); ?> />
 </p>
 <?php
+	}
 }
 
 if(forge_get_config('use_ftp')) {
@@ -273,11 +302,7 @@ if(forge_get_config('use_tracker')) {
 <input type="hidden" name="use_tracker" value="<?php echo ($group->usesTracker() ? '1' : '0'); ?>" />
 <?php
 }
-
-if(forge_get_config('use_frs')) {
 ?>
-<input type="hidden" name="use_frs" value="<?php echo ($group->usesFRS() ? '1' : '0'); ?>" />
-<?php } ?>
 
 <input type="hidden" name="use_stats" value="<?php echo ($group->usesStats() ? '1' : '0'); ?>" />
 

-----------------------------------------------------------------------

Summary of changes:
 src/common/frs/views/listpackages.php              |   23 +++++-----
 src/common/include/Group.class.php                 |   20 ++++++++-
 .../20140903-group-add-frs-sendemail-columns.sql   |    6 +++
 src/www/project/admin/index.php                    |   45 +++++++++++++++-----
 4 files changed, 73 insertions(+), 21 deletions(-)
 create mode 100644 src/db/20140903-group-add-frs-sendemail-columns.sql


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list