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  2b2a644982287e13b06147c54112e1134181a236 (commit)
       via  08f4255f53d743fb6552d47fd670458d7c6f5d04 (commit)
      from  2570526260a63012d5dbe6b156b09c1e5d6f3034 (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=2b2a644982287e13b06147c54112e1134181a236

commit 2b2a644982287e13b06147c54112e1134181a236
Author: Franck Villaume <[email protected]>
Date:   Sat Oct 24 13:38:41 2015 +0200

    sync CHANGES

diff --git a/src/CHANGES b/src/CHANGES
index 724a44b..e281877 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -2,6 +2,7 @@ FusionForge 6.X:
 * Spellcheck (Anders Jonsson)
 * Docman: limit number of returned documents on search query [#794] 
(TrivialDev)
 * Docman: limit search using from & to dates [#798] (TrivialDev)
+* Plugin AuthBuiltin: add captcha after 3 attempts with the same login [#795] 
(TrivialDev)
 
 Fusionforge 6.0.3:
 * Layout: fix rss url when url is absolute (TrivialDev)

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

commit 08f4255f53d743fb6552d47fd670458d7c6f5d04
Author: Franck Villaume <[email protected]>
Date:   Sat Oct 24 13:36:37 2015 +0200

    implement [#798] docman search: limit using from - to dates

diff --git a/src/CHANGES b/src/CHANGES
index aa42cdd..724a44b 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -1,6 +1,7 @@
 FusionForge 6.X:
 * Spellcheck (Anders Jonsson)
-* Docman: limit number of found documents on search query [#794] (TrivialDev)
+* Docman: limit number of returned documents on search query [#794] 
(TrivialDev)
+* Docman: limit search using from & to dates [#798] (TrivialDev)
 
 Fusionforge 6.0.3:
 * Layout: fix rss url when url is absolute (TrivialDev)
diff --git a/src/common/docman/views/search.php 
b/src/common/docman/views/search.php
index d255e03..3c9b916 100644
--- a/src/common/docman/views/search.php
+++ b/src/common/docman/views/search.php
@@ -41,11 +41,17 @@ $searchString = trim(getStringFromPost('textsearch'));
 $insideDocuments = getStringFromPost('insideDocuments');
 $subprojectsIncluded = getStringFromPost('includesubprojects');
 $limitNbSearchDocs = getStringFromPost('limitNbSearchDocs');
+$limitByStartDate = getIntFromPost('limitByStartDate', 0);
+$limitByEndDate = getIntFromPost('limitByEndDate', 0);
+$received_begin = getStringFromRequest('start_date', 0);
+$received_end = getStringFromRequest('end_date', 0);
 $allchecked = '';
 $onechecked = '';
 $insideDocumentsCheckbox = '';
 $attrsInputSearchAll = array('type' => 'radio', 'name' => 'search_type', 
'required' => 'required', 'value' => 'all', 'title' => _('All searched words 
are mandatory'));
 $attrsInputSearchOne = array('type' => 'radio', 'name' => 'search_type', 
'required' => 'required', 'value' => 'one', 'title' => _('At least one word 
must be found'));
+$date_format_js = _('yy-mm-dd');
+$date_format = _('Y-m-d');
 
 if (getStringFromPost('search_type') == 'one') {
        $attrsInputSearchOne['checked'] = 'checked';
@@ -54,6 +60,30 @@ if (getStringFromPost('search_type') == 'one') {
 }
 
 echo html_ao('div', array('id' => 'docman_search', 'class' => 
'docmanDivIncluded'));
+echo html_ao('script', array('type' => 'text/javascript'));
+?>
+//<![CDATA[
+var controllerSearch;
+
+jQuery(document).ready(function() {
+       controllerSearch = new DocManSearchController({
+               buttonStartDate:        jQuery('#limitByStartDate'),
+               buttonEndDate:          jQuery('#limitByEndDate'),
+               datePickerStartDate:    jQuery('#datepicker_start'),
+               datePickerEndDate:      jQuery('#datepicker_end'),
+       });
+
+       jQuery('#datepicker_start').datepicker({
+               dateFormat: "<?php echo $date_format_js ?>"
+       });
+       jQuery('#datepicker_end').datepicker({
+               dateFormat: "<?php echo $date_format_js ?>"
+       });
+});
+
+//]]>
+<?php
+echo html_ac(html_ap() - 1);
 echo $HTML->openForm(array('method' => 'post', 'action' => 
util_make_uri('/docman/?group_id='.$group_id.'&view=search')));
 echo html_e('div', array('id' => 'docman_search_query_words'),
                html_e('span', array('id' => 'docman_search_query_label'), 
_('Query').utils_requiredField()._(': ')).
@@ -68,6 +98,13 @@ if ($g->useDocmanSearch()) {
                $attrsInputInsideDocs['checked'] = 'checked';
        echo html_e('input', $attrsInputInsideDocs)._('Inside documents');
 }
+$attrsFieldSet = array('id' => 'fieldset1_closed', 'class' => 'coolfieldset');
+if ($limitByStartDate || $limitByEndDate || is_integer($limitNbSearchDocs)) {
+       $attrsFieldSet['id'] = 'fieldset1';
+}
+echo html_ao('fieldset', $attrsFieldSet);
+echo html_e('legend', array(), _('Advanced Options'));
+echo html_ao('div');
 if ($g->usesPlugin('projects-hierarchy')) {
        $projectsHierarchy = plugin_get_object('projects-hierarchy');
        $projectIDsArray = $projectsHierarchy->getFamily($group_id, 'child', 
true, 'validated');
@@ -75,10 +112,34 @@ if ($g->usesPlugin('projects-hierarchy')) {
                $attrsInputIncludeSubprojects = array('type' => 'checkbox', 
'name'  => 'includesubprojects', 'value' => 1, 'title' => _('search into childs 
following project hierarchy'));
                if ($subprojectsIncluded)
                        $attrsInputIncludeSubprojects['checked'] = 'checked';
-               echo html_e('input', $attrsInputIncludeSubprojects)._('Include 
child projects');
+               echo html_e('p', array(), html_e('input', 
$attrsInputIncludeSubprojects)._('Include child projects'));
        }
 }
 echo html_e('p', array(), _('limit search results 
to').html_build_select_box_from_array(array(_('All'), '10', '25', '50', '100'), 
'limitNbSearchDocs', _('All'), 1)._('documents'));
+$attrsInputLimitByStartDate = array('type' => 'checkbox', 'id' => 
'limitByStartDate', 'name' => 'limitByStartDate', 'value' => 1, 'title' => 
_('Set created start date limitation for this search. If not enable, not 
limitation.'));
+$attrsDatePickerLimitByStartDate = array('id' => 'datepicker_start', 'name' => 
'start_date', 'size' => 10, 'maxlength' => 10, 'disabled' => 'disabled');
+if ($limitByStartDate) {
+       $attrsInputLimitByStartDate['checked'] = 'checked';
+       unset($attrsDatePickerLimitByStartDate['disabled']);
+       $attrsDatePickerLimitByStartDate['required'] = 'required';
+       if ($received_begin) {
+               $attrsDatePickerLimitByStartDate['value'] = 
util_html_encode($received_begin);
+       }
+}
+$attrsInputLimitByEndDate = array('type' => 'checkbox', 'id' => 
'limitByEndDate', 'name' => 'limitByEndDate', 'value' => 1, 'title' => _('Set 
created end date limitation for this search. If not enable, not limitation.'));
+$attrsDatePickerLimitByEndDate = array('id' => 'datepicker_end', 'name' => 
'end_date', 'size' => 10, 'maxlength' => 10, 'disabled' => 'disabled');
+if ($limitByEndDate) {
+       $attrsInputLimitByEndDate['checked'] = 'checked';
+       unset($attrsDatePickerLimitByEndDate['disabled']);
+       $attrsDatePickerLimitByEndDate['required'] = 'required';
+       if ($received_end) {
+               $attrsDatePickerLimitByStartDate['value'] = 
util_html_encode($received_end);
+       }
+}
+echo html_e('p', array(), _('Set dates')._(': ').html_e('br').
+                       _('From')._(': ').html_e('input', 
$attrsInputLimitByStartDate).html_e('input', $attrsDatePickerLimitByStartDate).
+                       _('To')._(': ').html_e('input', 
$attrsInputLimitByEndDate).html_e('input', $attrsDatePickerLimitByEndDate));
+echo html_ac(html_ap() - 2);
 echo $HTML->addRequiredFieldsInfoBox();
 echo $HTML->closeForm();
 echo html_ac(html_ap() - 1);
@@ -126,10 +187,26 @@ if ($searchString) {
        $params['includesubprojects'] = $subprojectsIncluded;
        plugin_hook('docmansearch_has_hierarchy', $params);
        $qpa = db_construct_qpa($qpa, ' ) ', array());
+       if ($received_begin) {
+               $arrDateBegin = DateTime::createFromFormat($date_format, 
$received_begin);
+       }
+       if ($received_end) {
+               $arrDateEnd = DateTime::createFromFormat($date_format, 
$received_end);
+       }
+
+       if (isset($arrDateBegin) && !isset($arrDateEnd)) {
+               $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate >= $1', 
array($arrDateBegin->getTimestamp()));
+       } elseif (!isset($arrDateBegin) && isset($arrDateEnd)) {
+               $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate <= $1', 
array($arrDateEnd->getTimestamp()));
+       } elseif (isset($arrDateBegin) && isset($arrDateEnd)) {
+               $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate between 
$1 and $2', array($arrDateBegin->getTimestamp(), $arrDateEnd->getTimestamp()));
+       }
+
        $qpa = db_construct_qpa($qpa, ' ORDER BY updatedate, createdate');
        if (is_integer($limitNbSearchDocs)) {
                $qpa = db_construct_qpa($qpa, ' LIMIT $1', 
array($limitNbSearchDocs));
        }
+
        $result = db_query_qpa($qpa);
        if (!$result) {
                echo $HTML->error_msg(_('Database query error'));
diff --git a/src/www/docman/scripts/DocManController.js 
b/src/www/docman/scripts/DocManController.js
index 9980c4c..17d8227 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -3,7 +3,7 @@
  *
  * Copyright 2010, Antoine Mercadal - Capgemini
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2011-2014, Franck Villaume - TrivialDev
+ * Copyright 2011-2015, Franck Villaume - TrivialDev
  * Copyright 2011, Alain Peyrat
  * http://fusionforge.org
  *
@@ -49,6 +49,12 @@ DocManAddFileController = function(params)
        this.bindControls();
 };
 
+DocManSearchController = function(params)
+{
+       this.params     = params;
+       this.bindControls();
+};
+
 DocManListFileController.prototype =
 {
        /*! Binds the controls to the actions
@@ -495,3 +501,33 @@ DocManAddFileController.prototype =
                this.params.editNameRow.show();
        }
 };
+
+DocManSearchController.prototype =
+{
+       /*! Binds the controls to the actions
+        */
+       bindControls: function() {
+               this.params.buttonStartDate.click(jQuery.proxy(this, 
'setStartDate'));
+               this.params.buttonEndDate.click(jQuery.proxy(this, 
'setEndDate'));
+       },
+
+       setStartDate: function() {
+               if (this.params.buttonStartDate.is(':checked')) {
+                       this.params.datePickerStartDate.removeAttr('disabled');
+                       this.params.datePickerStartDate.attr('required', 
'required');
+               } else {
+                       this.params.datePickerStartDate.attr('disabled', 
'disabled');
+                       this.params.datePickerStartDate.removeAttr('required');
+               }
+       },
+
+       setEndDate: function() {
+               if (this.params.buttonEndDate.is(':checked')) {
+                       this.params.datePickerEndDate.removeAttr('disabled');
+                       this.params.datePickerEndDate.attr('required', 
'required');
+               } else {
+                       this.params.datePickerEndDate.attr('disabled', 
'disabled');
+                       this.params.datePickerEndDate.removeAttr('required');
+               }
+       },
+};

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

Summary of changes:
 src/CHANGES                                |  4 +-
 src/common/docman/views/search.php         | 79 +++++++++++++++++++++++++++++-
 src/www/docman/scripts/DocManController.js | 38 +++++++++++++-
 3 files changed, 118 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to