[Fusionforge-commits] FusionForge branch master updated. 6.0.4-1202-g6f66f35

Franck Villaume nerville at libremir.placard.fr.eu.org
Fri Dec 2 18:45:34 CET 2016


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  6f66f353f99fdbacf57080fb14ff2d10604eb222 (commit)
       via  69928a6f5bbf7a905abebbe0e10de8f431dae183 (commit)
       via  3063422fee68cc9db98e9bb86e266fff2786a402 (commit)
       via  91e5b200601a38e59d21f15331b80ec2e15c613b (commit)
       via  ea298a90298334bf20e0b1fbf424039d1d2e3666 (commit)
      from  b1312b3458aa29e77c437eafaf37d120da53ad59 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=6f66f353f99fdbacf57080fb14ff2d10604eb222

commit 6f66f353f99fdbacf57080fb14ff2d10604eb222
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Dec 2 18:45:01 2016 +0100

    add missing view: notifyusers

diff --git a/src/common/docman/views/notifyusers.php b/src/common/docman/views/notifyusers.php
index d515f76..8370791 100644
--- a/src/common/docman/views/notifyusers.php
+++ b/src/common/docman/views/notifyusers.php
@@ -33,24 +33,32 @@ if (!forge_check_perm('docman', $group_id, 'approve')) {
 	session_redirect('/docman/?group_id='.$group_id);
 }
 
+$userObjects = $g->getUsers();
+$userNameArray = array();
+$userIDArray = array();
+foreach ($userObjects as $userObject) {
+	$userNameArray[] = $userObject->getRealname();
+	$userIDArray[]   = $userObject->getID();
+}
+
 echo html_ao('div', array('id' => 'notifyUsers'));
 echo $HTML->openForm(array('id' => 'notifyusersdoc', 'name' => 'notifyusersdoc', 'method' => 'post', 'enctype' => 'multipart/form-data'));
 echo $HTML->listTableTop(array());
 $cells = array();
-$cells[] = array(_('Document Title')._(':'));
+$cells[][] = _('Document Title')._(':');
 $cells[][] = html_e('span', array('id' => 'notifytitle', 'type' => 'text', 'name' => 'title'), '', false);
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
-$cells[] = array(_('Description')._(':'));
+$cells[][] = _('Description')._(':');
 $cells[][] = html_e('span', array('id' => 'notifydescription', 'type' => 'text', 'name' => 'description'), '', false);
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
-$cells[] = array(_('File')._(':'));
+$cells[][] = _('File')._(':');
 $cells[][] = html_e('a', array('id' => 'notifyfilelink'), '', false);
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
-$cells[] = array(_('Users Email to notify')._(':'));
-$cells[][] = html_e('input', array('title' => _('Add email addresses, comma separated'), 'id' => 'emails', 'type' => 'text', 'name' => 'emails', 'size' => '40'));
+$cells[][] = _('Users to notify')._(':');
+$cells[][] = html_e('p', array(), html_build_multiple_select_box_from_arrays($userIDArray, $userNameArray, 'userids[]', array(), 8, false, 'none', false, array('id' => 'notify-userids')));
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
 $cells[] = array(_('Specific content to be added to the email body'), 'colspan' => 2, 'title' => _('Project, Folder, Title, Filename and direct link to the document will be added automatically.'));

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=69928a6f5bbf7a905abebbe0e10de8f431dae183

commit 69928a6f5bbf7a905abebbe0e10de8f431dae183
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Dec 2 18:43:39 2016 +0100

    implement helper to retrieve version using the serialid

diff --git a/src/common/docman/DocumentVersion.class.php b/src/common/docman/DocumentVersion.class.php
index ea7ede7..78ee099 100644
--- a/src/common/docman/DocumentVersion.class.php
+++ b/src/common/docman/DocumentVersion.class.php
@@ -43,6 +43,16 @@ function &documentversion_get_object($ver_id, $docid, $group_id, $res = false) {
 	return $DOCUMENTVERSION_OBJ['_'.$ver_id.'_'];
 }
 
+function &documentversion_get_object_by_serialid($serial_id, $docid, $group_id, $res = false) {
+	$res = db_query_params('SELECT serial_id, version, docid, current_version, title, updatedate, createdate, created_by, description, filename, filetype, filesize FROM doc_data_version WHERE serial_id = $1 AND docid = $2',
+						array($serial_id, $docid));
+	if ($res && (db_numrows($res) == 1)) {
+		$arr = db_fetch_array($res);
+		return documentversion_get_object($arr['version'], $docid, $group_id, $res);
+	}
+	return false;
+}
+
 class DocumentVersion extends FFError {
 	/**
 	 * Associative array of data from db.

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=3063422fee68cc9db98e9bb86e266fff2786a402

commit 3063422fee68cc9db98e9bb86e266fff2786a402
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Dec 2 18:42:29 2016 +0100

    remove magic number

diff --git a/src/common/docman/views/addfile.php b/src/common/docman/views/addfile.php
index d9be4c2..bf02b50 100644
--- a/src/common/docman/views/addfile.php
+++ b/src/common/docman/views/addfile.php
@@ -97,15 +97,15 @@ if ($dgf->getNested($stateidArr) == NULL) {
 	echo $HTML->listTableTop(array(), array(), 'infotable');
 	$cells = array();
 	$cells[][] = _('Document Title').utils_requiredField();
-	$cells[][] = html_e('input', array('pattern' => '.{5,}', 'placeholder' => _('Document Title').' '.sprintf(_('(at least %s characters)'), 5), 'title' => _('Document Title')._(': ')._('Refers to the relatively brief title of the document (e.g. How to use the download server).'), 'type' => 'text', 'name' => 'title', 'size' => 40, 'maxlength' => 255, 'required' => 'required'));
+	$cells[][] = html_e('input', array('pattern' => '.{5,}', 'placeholder' => _('Document Title').' '.sprintf(_('(at least %s characters)'), DOCMAN__TITLE_MIN_SIZE), 'title' => _('Document Title')._(': ')._('Refers to the relatively brief title of the document (e.g. How to use the download server).'), 'type' => 'text', 'name' => 'title', 'size' => 40, 'maxlength' => DOCMAN__TITLE_MAX_SIZE, 'required' => 'required'));
 	echo $HTML->multiTableRow(array(), $cells);
 	$cells = array();
 	$cells[][] = _('Description') .utils_requiredField();
-	$cells[][] = html_e('textarea', array('pattern' => '.{10,}', 'placeholder' => _('Description').' '.sprintf(_('(at least %s characters)'), 10), 'title' => _('Editing tips:http,https or ftp: Hyperlinks. [#NNN]: Tracker id NNN. [TNNN]: Task id NNN. [wiki:<pagename>]: Wiki page. [forum:<msg_id>]: Forum post. [DNNN]: Document id NNN.'), 'name' => 'description', 'rows' => 5, 'cols' => 50, 'maxlength' => 255, 'required' => 'required'), '', false);
+	$cells[][] = html_e('textarea', array('pattern' => '.{10,}', 'placeholder' => _('Description').' '.sprintf(_('(at least %s characters)'), DOCMAN__DESCRIPTION_MIN_SIZE), 'title' => _('Editing tips:http,https or ftp: Hyperlinks. [#NNN]: Tracker id NNN. [TNNN]: Task id NNN. [wiki:<pagename>]: Wiki page. [forum:<msg_id>]: Forum post. [DNNN]: Document id NNN.'), 'name' => 'description', 'rows' => 5, 'cols' => 50, 'maxlength' => DOCMAN__DESCRIPTION_MAX_SIZE, 'required' => 'required'), '', false);
 	echo $HTML->multiTableRow(array(), $cells);
 	$cells = array();
 	$cells[][] = _('Comment');
-	$cells[][] = html_e('textarea', array('placeholder' => _('Add free comment'), 'name' => 'vcomment', 'rows' => 5, 'cols' => 50, 'maxlength' => 255), '', false);
+	$cells[][] = html_e('textarea', array('placeholder' => _('Add free comment'), 'name' => 'vcomment', 'rows' => 5, 'cols' => 50, 'maxlength' => DOCMAN__COMMENT_MAX_SIZE), '', false);
 	echo $HTML->multiTableRow(array(), $cells);
 	$cells = array();
 	$cells[][] = _('Type of Document') .utils_requiredField();

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=91e5b200601a38e59d21f15331b80ec2e15c613b

commit 91e5b200601a38e59d21f15331b80ec2e15c613b
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Dec 2 18:41:40 2016 +0100

    implement gentleSelect jquery. use it in docman action: notify users

diff --git a/src/common/docman/actions/notifyusers.php b/src/common/docman/actions/notifyusers.php
index 206ba5a..4c9caab 100644
--- a/src/common/docman/actions/notifyusers.php
+++ b/src/common/docman/actions/notifyusers.php
@@ -56,30 +56,33 @@ if ($d->isError()) {
 	session_redirect($urlparam);
 }
 
-$emails = getStringFromRequest('emails', null);
-if (!$emails) {
-	$warning_msg = _('No email address found.');
+$userIDs = getArrayFromRequest('notify-userids', array());
+if (count($userIDS) <= 0) {
+	$warning_msg = _('No users selected for notification.');
 	session_redirect($urlparam);
 }
+
+$emailsArr = array();
+foreach ($userIDs as $userID) {
+	$user = user_get_object($userID);
+	$emailsArr[] = $user->getEmail();
+}
+
 $details = getStringFromRequest('details');
 $sanitizer = new TextSanitizer();
 $details = $sanitizer->SanitizeHtml($details);
-$emailsErrArr = validate_emails($emails, ',');
-$emailsArr = explode(',', $emails);
 $subject = '['.$d->Group->getPublicName().'] '._('Notification on document').' - '.$d->getName();
 $body = _('Project')._(': ').$d->Group->getPublicName()."\n";
 $body .= _('Document Folder')._(': ').$d->getDocGroupName()."\n";
-$body = _('Document Title')._(': ').$d->getName()."\n";
+$body .= _('Document Title')._(': ').$d->getName()."\n";
 $body .= _('Document Filename')._(': ').$d->getFileName()."\n";
 $body .= _('Direct Link')._(': ').util_make_url('/docman/?group_id='.$d->Group->getID().'&view=listfile&dirid='.$d->getDocGroupID().'&filedetailid='.$d->getID())."\n";
 $body .= _('Notification Comments')._(':')."\n";
 $body .= $details;
 $sendEmails = 0;
 foreach ($emailsArr as $key => $toEmail) {
-	if (!in_array(trim($toEmail), $emailsErrArr)) {
-		util_send_message(trim($toEmail), $subject, $body);
-		$sendEmails++;
-	}
+	util_send_message(trim($toEmail), $subject, $body);
+	$sendEmails++;
 }
 
 $feedback = sprintf(ngettext('%s user notified.', '%s users notified.', $sendEmails), $sendEmails);
diff --git a/src/etc/httpd.conf.d/vhost-main.inc b/src/etc/httpd.conf.d/vhost-main.inc
index ec348d1..ec6c601 100644
--- a/src/etc/httpd.conf.d/vhost-main.inc
+++ b/src/etc/httpd.conf.d/vhost-main.inc
@@ -93,6 +93,7 @@ Alias ${FF__core__url_prefix}scripts/jquery-auto-height/ ${FF__core__source_path
 Alias ${FF__core__url_prefix}scripts/php-date-formatter/ ${FF__core__source_path}/vendor/php-date-formatter/
 Alias ${FF__core__url_prefix}scripts/jquery-mousewheel/ ${FF__core__source_path}/vendor/jquery-mousewheel/
 Alias ${FF__core__url_prefix}scripts/jquery-datetimepicker/ ${FF__core__source_path}/vendor/jquery-datetimepicker/
+Alias ${FF__core__url_prefix}scripts/jquery-gentleSelect/ ${FF__core__source_path}/vendor/jquery-gentleSelect/
 
 # For FusionForge without DNS delegation, uncomment this
 # and remove 30-vhosts-projects.conf
diff --git a/src/www/include/html.php b/src/www/include/html.php
index ce7288a..4988013 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -599,6 +599,11 @@ function html_use_jquerydatetimepicker() {
 	use_stylesheet('/scripts/jquery-datetimepicker/jquery.datetimepicker.css');
 }
 
+function html_use_jquerygentleselect() {
+	html_use_jquery();
+	use_javascript('/scripts/jquery-gentleSelect/jquery-gentleSelect.js');
+	use_stylesheet('/scripts/jquery-gentleSelect/jquery-gentleSelect.css');
+}
 
 /**
  * html_build_select_box_from_arrays() - Takes two arrays, with the first array being the "id" or value and the other
@@ -868,7 +873,7 @@ function html_build_multiple_select_box($result, $name, $checked_array, $size =
  * @throws	Exception
  */
 function html_build_multiple_select_box_from_arrays(
-		$vals, $texts, $name, $checked_array=array(), $size = 8,
+		$vals, $texts, $name, $checked_array = array(), $size = 8,
 		$show_100 = true, $text_100 = 'none',
 		$allowed = false, $attrs = array(),
 		$opts_attrs = array(), $attrs_100 = array(),

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ea298a90298334bf20e0b1fbf424039d1d2e3666

commit ea298a90298334bf20e0b1fbf424039d1d2e3666
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Dec 2 18:39:51 2016 +0100

    remove magic number

diff --git a/src/common/docman/Document.class.php b/src/common/docman/Document.class.php
index d6c26fd..e259910 100644
--- a/src/common/docman/Document.class.php
+++ b/src/common/docman/Document.class.php
@@ -152,7 +152,7 @@ class Document extends FFObject {
 			return false;
 		}
 		if (strlen($description) < DOCMAN__DESCRIPTION_MIN_SIZE) {
-			$this->setError(_('Document Description Must Be At Least 10 Characters'));
+			$this->setError(sprintf_('Document Description Must Be At Least %d Characters'), DOCMAN__DESCRIPTION_MIN_SIZE));
 			return false;
 		}
 

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

Summary of changes:
 src/common/docman/Document.class.php        |  2 +-
 src/common/docman/DocumentVersion.class.php | 10 ++++++++++
 src/common/docman/actions/notifyusers.php   | 23 +++++++++++++----------
 src/common/docman/views/addfile.php         |  6 +++---
 src/common/docman/views/notifyusers.php     | 18 +++++++++++++-----
 src/etc/httpd.conf.d/vhost-main.inc         |  1 +
 src/www/include/html.php                    |  7 ++++++-
 7 files changed, 47 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list