+                
                     {element}
 
                     
@@ -239,8 +240,22 @@ EOT;
         $style = 'default',
         $size = 'default',
         $class = null,
-        $attributes = array()
+        $attributes = array(),
+        $createElement = false
     ) {
+        if ($createElement) {
+            return $this->createElement(
+                'button',
+                $name,
+                $label,
+                $icon,
+                $style,
+                $size,
+                $class,
+                $attributes
+            );
+        }
+
         return $this->addElement(
             'button',
             $name,
@@ -256,44 +271,89 @@ EOT;
     /**
      * @param string $label
      */
-    public function addButtonSave($label, $name = 'submit')
+    public function addButtonSave($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'floppy-o', 'btn btn-success');
+        return $this->addButton(
+            $name,
+            $label,
+            'check',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * @param string $label
      */
-    public function addButtonCreate($label, $name = 'submit')
+    public function addButtonCreate($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'plus-square', 'btn btn-success');
+        return $this->addButton(
+            $name,
+            $label,
+            'plus',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * Shortcut to create/add button
      * @param string $label
      */
-    public function addButtonUpdate($label, $name = 'submit')
+    public function addButtonUpdate($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'pencil', 'primary');
+        return $this->addButton(
+            $name,
+            $label,
+            'pencil',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * Shortcut to delete button
      * @param string $label
      */
-    public function addButtonDelete($label, $name = 'submit')
+    public function addButtonDelete($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'trash', 'danger');
+        return $this->addButton(
+            $name,
+            $label,
+            'trash',
+            'danger',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * Shortcut to "send" button
      * @param string $label
      */
-    public function addButtonSend($label, $name = 'submit')
+    public function addButtonSend($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'paper-plane', 'primary');
+        return $this->addButton(
+            $name,
+            $label,
+            'paper-plane',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
@@ -305,7 +365,7 @@ EOT;
         if (empty($label))  {
             $label = get_lang('Search');
         }
-        return $this->addButton('submit', $label, 'search','btn btn-primary');
+        return $this->addButton('submit', $label, 'search', 'default');
     }
 
     /**
@@ -321,27 +381,108 @@ EOT;
      * Shortcut to import button
      * @param string $label
      */
-    public function addButtonImport($label, $name = 'submit')
+    public function addButtonImport($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'check', 'primary');
+        return $this->addButton(
+            $name,
+            $label,
+            'check',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * Shortcut to export button
      * @param string $label
      */
-    public function addButtonExport($label, $name = 'submit')
+    public function addButtonExport($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'check', 'primary');
+        return $this->addButton(
+            $name,
+            $label,
+            'check',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
      * Shortcut to filter button
      * @param string $label
      */
-    public function addButtonFilter($label, $name = 'submit')
+    public function addButtonFilter($label, $name = 'submit', $createElement = false)
     {
-        return $this->addButton($name, $label, 'filter', 'primary');
+        return $this->addButton(
+            $name,
+            $label,
+            'filter',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
+    }
+
+    /**
+     * Shortcut to upload button
+     * @param string $label
+     */
+    public function addButtonUpload($label, $name = 'submit', $createElement = false)
+    {
+        return $this->addButton(
+            $name,
+            $label,
+            'upload',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
+    }
+
+    /**
+     * Shortcut to upload button
+     * @param string $label
+     */
+    public function addButtonDownload($label, $name = 'submit', $createElement = false)
+    {
+        return $this->addButton(
+            $name,
+            $label,
+            'download',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
+    }
+
+    /**
+     * Shortcut to preview button
+     * @param string $label
+     */
+    public function addButtonPreview($label, $name = 'submit', $createElement = false)
+    {
+        return $this->addButton(
+            $name,
+            $label,
+            'search',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
     }
 
     /**
@@ -482,6 +623,7 @@ EOT;
      * @param int $delay (optional)	 The number of seconds between the moment the user
      * @param string $label (optional)	Custom label to be shown
      * submits the form and the start of the progress bar.
+     * @deprecated ?
      */
     public function add_progress_bar($delay = 2, $label = '')
     {
diff --git a/main/inc/lib/groupmanager.lib.php b/main/inc/lib/groupmanager.lib.php
index 72d9f10041..423153ca83 100755
--- a/main/inc/lib/groupmanager.lib.php
+++ b/main/inc/lib/groupmanager.lib.php
@@ -1964,7 +1964,11 @@ class GroupManager
             return false;
         }
 
-        if (!$user_is_in_group && $groupInfo['status'] == 0) {
+        if (!$user_is_in_group) {
+            return false;
+        }
+
+        if ($groupInfo['status'] == 0) {
             return false;
         }
 
diff --git a/main/inc/lib/pear/HTML/Common.php b/main/inc/lib/pear/HTML/Common.php
index 80766c4f96..822e08a3c8 100755
--- a/main/inc/lib/pear/HTML/Common.php
+++ b/main/inc/lib/pear/HTML/Common.php
@@ -77,7 +77,7 @@ class HTML_Common
      * @param    int     $tabOffset      Indent offset in tabs
      * @access   public
      */
-    public function HTML_Common($attributes = null, $tabOffset = 0)
+    public function __construct($attributes = null, $tabOffset = 0)
     {
         $this->setAttributes($attributes);
         $this->setTabOffset($tabOffset);
diff --git a/main/inc/lib/pear/HTML/QuickForm.php b/main/inc/lib/pear/HTML/QuickForm.php
index 9a3aeb7f69..2bfb0424b7 100755
--- a/main/inc/lib/pear/HTML/QuickForm.php
+++ b/main/inc/lib/pear/HTML/QuickForm.php
@@ -250,7 +250,7 @@ class HTML_QuickForm extends HTML_Common
      */
     public function __construct($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)
     {
-        HTML_Common::HTML_Common($attributes);
+        parent::__construct($attributes);
         $method = (strtoupper($method) == 'GET') ? 'get' : 'post';
         $action = ($action == '') ? api_get_self() : $action;
         $target = empty($target) ? array() : array('target' => $target);
@@ -547,8 +547,8 @@ class HTML_QuickForm extends HTML_Common
      */
     public function &createElement($elementType)
     {
-        $args =  func_get_args();
-        $element =& HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
+        $args = func_get_args();
+        $element = HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
         return $element;
     } // end func createElement
 
diff --git a/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php b/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
index de3f313017..e4814e7802 100755
--- a/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
+++ b/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
@@ -30,7 +30,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
     */
     public function HTML_QuickForm_advanced_settings($text = null)
     {
-        $this->HTML_QuickForm_static(null, null, $text);
+        parent::__construct(null, null, $text);
         $this->_type = 'html';
     }
 
@@ -52,7 +52,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
                     
                     
                     
-                    '.HTML_QuickForm_static::toHtml().'
+                    '.parent::toHtml().'
                     
                      
                  
diff --git a/main/inc/lib/pear/HTML/QuickForm/button.php b/main/inc/lib/pear/HTML/QuickForm/button.php
index 2cc7759ae7..88de0be852 100755
--- a/main/inc/lib/pear/HTML/QuickForm/button.php
+++ b/main/inc/lib/pear/HTML/QuickForm/button.php
@@ -39,22 +39,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
     private $size;
     private $class;
 
-    /**
-     * @return mixed
-     */
-    public function getClass()
-    {
-        return $this->class;
-    }
-
-    /**
-     * @param mixed $class
-     */
-    public function setClass($class)
-    {
-        $this->class = $class;
-    }
-
     /**
      * @param string $name input name example 'submit'
      * @param string $text button text to show
@@ -64,7 +48,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
      * @param string $class
      * @param array $attributes
      */
-    public function HTML_QuickForm_button(
+    public function __construct(
         $name,
         $text,
         $icon = 'check',
@@ -78,7 +62,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
         $this->setSize($size);
         $this->setClass($class);
 
-        HTML_QuickForm_input::HTML_QuickForm_input(
+        parent::__construct(
             $name,
             null,
             $attributes
@@ -88,6 +72,55 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
         $this->setType('submit');
     }
 
+    /**
+     * @return string
+     */
+    public function toHtml()
+    {
+        if ($this->_flagFrozen) {
+            return $this->getFrozenHtml();
+        } else {
+            $value = null;
+            if (isset($this->_attributes['value'])) {
+                $value = $this->_attributes['value'];
+                unset($this->_attributes['value']);
+            }
+
+            unset($this->_attributes['class']);
+
+            $icon = $this->getIcon();
+
+            if (!empty($icon)) {
+                $icon = '
 ';
+            }
+
+            $class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
+
+            return
+                $this->_getTabs() . '
+                
';
+        }
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getClass()
+    {
+        return $this->class;
+    }
+
+    /**
+     * @param mixed $class
+     */
+    public function setClass($class)
+    {
+        $this->class = $class;
+    }
+
     /**
      * @return mixed
      */
@@ -117,7 +150,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
      */
     public function setStyle($style)
     {
-        $style = !empty($style) ? 'btn-'.$style : null;
+        $style = !empty($style) ? 'btn btn-'.$style : null;
         $this->style = $style;
     }
 
@@ -153,35 +186,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
         $this->size = $size;
     }
 
-    /**
-     * @return string
-     */
-    public function toHtml()
-    {
-        if ($this->_flagFrozen) {
-            return $this->getFrozenHtml();
-        } else {
-            $value = $this->_attributes['value'];
-
-            unset($this->_attributes['value']);
-            unset($this->_attributes['class']);
-
-            $icon = $this->getIcon();
-
-            if (!empty($icon)) {
-                $icon = '
 ';
-            }
-
-            $class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
-
-            return
-                $this->_getTabs() . '
-                
';
-        }
-    }
-
     /**
      * Freeze the element so that only its value is returned
      *
diff --git a/main/inc/lib/pear/HTML/QuickForm/element.php b/main/inc/lib/pear/HTML/QuickForm/element.php
index a60094d318..cbd07b09d3 100755
--- a/main/inc/lib/pear/HTML/QuickForm/element.php
+++ b/main/inc/lib/pear/HTML/QuickForm/element.php
@@ -90,18 +90,18 @@ class HTML_QuickForm_element extends HTML_Common
      */
     function HTML_QuickForm_element($elementName = null, $elementLabel = null, $attributes = null)
     {
-        HTML_Common::HTML_Common($attributes);
+        parent::__construct($attributes);
         if (isset($elementName)) {
             $this->setName($elementName);
         }
         if (isset($elementLabel)) {
 
             $labelFor = "";
-            //Default Inputs generate this
+            // Default Inputs generate this
             if (!empty($attributes['id'])) {
                 $labelFor = $attributes['id'];
             }
-            //Default Labels generate this
+            // Default Labels generate this
             if (!empty($attributes['for'])) {
                 $labelFor = $attributes['for'];
             }
diff --git a/main/inc/lib/pear/HTML/QuickForm/group.php b/main/inc/lib/pear/HTML/QuickForm/group.php
index 681c3cd374..57bc1c7db9 100755
--- a/main/inc/lib/pear/HTML/QuickForm/group.php
+++ b/main/inc/lib/pear/HTML/QuickForm/group.php
@@ -36,8 +36,6 @@
  */
 class HTML_QuickForm_group extends HTML_QuickForm_element
 {
-    // {{{ properties
-
     /**
      * Name of the element
      * @var       string
@@ -78,9 +76,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
     */
     var $_appendName = true;
 
-    // }}}
-    // {{{ constructor
-
     /**
      * Class constructor
      *
@@ -98,7 +93,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
      */
     function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true)
     {
-        $this->HTML_QuickForm_element($elementName, $elementLabel);
+        parent::__construct($elementName, $elementLabel);
         $this->_type = 'group';
         if (isset($elements) && is_array($elements)) {
             $this->setElements($elements);
@@ -109,10 +104,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         if (isset($appendName)) {
             $this->_appendName = $appendName;
         }
-    } //end constructor
-
-    // }}}
-    // {{{ setName()
+    }
 
     /**
      * Sets the group name
@@ -125,10 +117,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
     function setName($name)
     {
         $this->_name = $name;
-    } //end func setName
-
-    // }}}
-    // {{{ getName()
+    }
 
     /**
      * Returns the group name
@@ -140,10 +129,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
     function getName()
     {
         return $this->_name;
-    } //end func getName
-
-    // }}}
-    // {{{ setValue()
+    }
 
     /**
      * Sets values for group's elements
@@ -175,10 +161,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
                 }
             }
         }
-    } //end func setValue
-
-    // }}}
-    // {{{ getValue()
+    }
 
     /**
      * Returns the value of the group
@@ -219,10 +202,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             }
         }
         return $value;
-    } // end func getValue
-
-    // }}}
-    // {{{ setElements()
+    }
 
     /**
      * Sets the grouped elements
@@ -238,10 +218,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         if ($this->_flagFrozen) {
             $this->freeze();
         }
-    } // end func setElements
-
-    // }}}
-    // {{{ getElements()
+    }
 
     /**
      * Gets the grouped elements
@@ -254,10 +231,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
     {
         $this->_createElementsIfNotExist();
         return $this->_elements;
-    } // end func getElements
-
-    // }}}
-    // {{{ getGroupType()
+    }
 
     /**
      * Gets the group type based on its elements
@@ -279,10 +253,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             $prevType = $type;
         }
         return $type;
-    } // end func getGroupType
-
-    // }}}
-    // {{{ toHtml()
+    }
 
     /**
      * Returns Html for the group
@@ -291,20 +262,14 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
      * @access      public
      * @return      string
      */
-    function toHtml()
+    public function toHtml()
     {
-        include_once('HTML/QuickForm/Renderer/Default.php');
-        // Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
-        //$renderer =& new HTML_QuickForm_Renderer_Default();
         $renderer = new HTML_QuickForm_Renderer_Default();
-        //
         $renderer->setElementTemplate('{element}');
         $this->accept($renderer);
-        return $renderer->toHtml();
-    } //end func toHtml
 
-    // }}}
-    // {{{ getElementName()
+        return $renderer->toHtml();
+    }
 
     /**
      * Returns the element name inside the group such as found in the html form
@@ -345,10 +310,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             }
         }
         return $elementName;
-    } //end func getElementName
-
-    // }}}
-    // {{{ getFrozenHtml()
+    }
 
     /**
      * Returns the value of field without HTML tags
@@ -373,10 +335,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             }
         }
         return $html;
-    } //end func getFrozenHtml
-
-    // }}}
-    // {{{ onQuickFormEvent()
+    }
 
     /**
      * Called by HTML_QuickForm whenever form event is made on this element
@@ -415,10 +374,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
                 parent::onQuickFormEvent($event, $arg, $caller);
         }
         return true;
-    } // end func onQuickFormEvent
-
-    // }}}
-    // {{{ accept()
+    }
 
    /**
     * Accepts a renderer
@@ -456,10 +412,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             }
         }
         $renderer->finishGroup($this);
-    } // end func accept
-
-    // }}}
-    // {{{ exportValue()
+    }
 
    /**
     * As usual, to get the group's value we access its elements and call
@@ -507,9 +460,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         return $value;
     }
 
-    // }}}
-    // {{{ _createElements()
-
    /**
     * Creates the group's elements.
     *
@@ -526,9 +476,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         // abstract
     }
 
-    // }}}
-    // {{{ _createElementsIfNotExist()
-
    /**
     * A wrapper around _createElements()
     *
@@ -548,9 +495,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         }
     }
 
-    // }}}
-    // {{{ freeze()
-
     function freeze()
     {
         parent::freeze();
@@ -559,9 +503,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         }
     }
 
-    // }}}
-    // {{{ unfreeze()
-
     function unfreeze()
     {
         parent::unfreeze();
@@ -570,9 +511,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
         }
     }
 
-    // }}}
-    // {{{ setPersistantFreeze()
-
     function setPersistantFreeze($persistant = false)
     {
         parent::setPersistantFreeze($persistant);
@@ -580,7 +518,4 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
             $this->_elements[$key]->setPersistantFreeze($persistant);
         }
     }
-
-    // }}}
-} //end class HTML_QuickForm_group
-?>
\ No newline at end of file
+}
diff --git a/main/inc/lib/pear/HTML/QuickForm/header.php b/main/inc/lib/pear/HTML/QuickForm/header.php
index 5869507d14..9428b0a383 100755
--- a/main/inc/lib/pear/HTML/QuickForm/header.php
+++ b/main/inc/lib/pear/HTML/QuickForm/header.php
@@ -42,11 +42,12 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
     * @access public
     * @return void
     */
-    function HTML_QuickForm_header($elementName = null, $text = null) {
+    function HTML_QuickForm_header($elementName = null, $text = null)
+    {
         if (!empty($elementName)) {
             $text = $elementName;
         }
-        $this->HTML_QuickForm_static($elementName, null, $text);
+        parent::__construct($elementName, null, $text);
         $this->_type = 'header';
     }
 
diff --git a/main/inc/lib/pear/HTML/QuickForm/html.php b/main/inc/lib/pear/HTML/QuickForm/html.php
index 61e750a52f..060f448fb7 100755
--- a/main/inc/lib/pear/HTML/QuickForm/html.php
+++ b/main/inc/lib/pear/HTML/QuickForm/html.php
@@ -36,7 +36,6 @@
  */
 class HTML_QuickForm_html extends HTML_QuickForm_static
 {
-    // {{{ constructor
 
    /**
     * Class constructor
@@ -45,34 +44,21 @@ class HTML_QuickForm_html extends HTML_QuickForm_static
     * @access public
     * @return void
     */
-    function HTML_QuickForm_html($text = null)
+    public function __construct($text = null)
     {
-        $this->HTML_QuickForm_static(null, null, $text);
+        parent::__construct(null, null, $text);
         $this->_type = 'html';
     }
 
-    // }}}
-    // {{{ accept()
-
    /**
     * Accepts a renderer
     *
     * @param HTML_QuickForm_Renderer    renderer object (only works with Default renderer!)
     * @access public
     * @return void
-    */    
-    function accept(&$renderer, $required = false, $error = null)
+    */
+    public function accept(&$renderer, $required = false, $error = null)
     {
         $renderer->renderHtml($this);
-    } // end func accept
-    
-    
-    function toHtml()
-    {
-         return HTML_QuickForm_static::toHtml();
-    } //end func toHtml
-
-    
-
-    // }}}
-} //end class HTML_QuickForm_html
+    }
+}
diff --git a/main/inc/lib/pear/HTML/QuickForm/label.php b/main/inc/lib/pear/HTML/QuickForm/label.php
index 6540952cb0..611c37db02 100755
--- a/main/inc/lib/pear/HTML/QuickForm/label.php
+++ b/main/inc/lib/pear/HTML/QuickForm/label.php
@@ -33,7 +33,7 @@ class HTML_QuickForm_label extends HTML_QuickForm_static
         $text = null,
         $attributes = null
     ) {
-        $this->HTML_QuickForm_static(null, $label, $text, $attributes);
+        parent::__construct(null, $label, $text, $attributes);
         $this->_type = 'html';
     }
 
diff --git a/main/inc/lib/pear/HTML/QuickForm/select.php b/main/inc/lib/pear/HTML/QuickForm/select.php
index f2285a0692..0da1450cc8 100755
--- a/main/inc/lib/pear/HTML/QuickForm/select.php
+++ b/main/inc/lib/pear/HTML/QuickForm/select.php
@@ -34,7 +34,8 @@
  * @version     Release: 3.2.11
  * @since       1.0
  */
-class HTML_QuickForm_select extends HTML_QuickForm_element {
+class HTML_QuickForm_select extends HTML_QuickForm_element
+{
 
     // {{{ properties
 
@@ -81,7 +82,7 @@ class HTML_QuickForm_select extends HTML_QuickForm_element {
         if (is_array($attributes) || empty($attributes)) {
             $attributes['class'] = 'form-control';
         }
-        HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+        parent::__construct($elementName, $elementLabel, $attributes);
         $this->_persistantFreeze = true;
         $this->_type = 'select';
         if (isset($options)) {
diff --git a/main/inc/lib/pear/HTML/QuickForm/static.php b/main/inc/lib/pear/HTML/QuickForm/static.php
index a07b48906f..24f3fecc23 100755
--- a/main/inc/lib/pear/HTML/QuickForm/static.php
+++ b/main/inc/lib/pear/HTML/QuickForm/static.php
@@ -30,7 +30,8 @@
  * @version     Release: 3.2.11
  * @since       2.7
  */
-class HTML_QuickForm_static extends HTML_QuickForm_element {
+class HTML_QuickForm_static extends HTML_QuickForm_element
+{
 
     // {{{ properties
 
@@ -52,9 +53,9 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
      * @access    public
      * @return    void
      */
-    function HTML_QuickForm_static($elementName = null, $elementLabel = null, $text = null, $attributes = null)
+    public function __construct($elementName = null, $elementLabel = null, $text = null, $attributes = null)
     {
-        HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+        parent::__construct($elementName, $elementLabel, $attributes);
         $this->_persistantFreeze = false;
         $this->_type = 'static';
         $this->_text = $text;
@@ -128,7 +129,7 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
      * @access    public
      * @return    string
      */
-    function toHtml()
+    public function toHtml()
     {
         return $this->_getTabs() . $this->_text;
     } //end func toHtml
@@ -190,7 +191,4 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
     {
         return null;
     }
-
-    // }}}
-} //end class HTML_QuickForm_static
-?>
+}
diff --git a/main/inc/lib/pear/HTML/QuickForm/submit.php b/main/inc/lib/pear/HTML/QuickForm/submit.php
index 2b476f3e8e..320d9ca555 100755
--- a/main/inc/lib/pear/HTML/QuickForm/submit.php
+++ b/main/inc/lib/pear/HTML/QuickForm/submit.php
@@ -46,7 +46,7 @@ class HTML_QuickForm_submit extends HTML_QuickForm_input
      * @access    public
      * @return    void
      */
-    function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
+    public function __construct($elementName=null, $value=null, $attributes=null)
     {
         HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
         $this->setValue($value);
diff --git a/main/inc/lib/pear/HTML/QuickForm/text.php b/main/inc/lib/pear/HTML/QuickForm/text.php
index 4b3ad9b164..c21a8f7236 100755
--- a/main/inc/lib/pear/HTML/QuickForm/text.php
+++ b/main/inc/lib/pear/HTML/QuickForm/text.php
@@ -45,7 +45,7 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
      * @access    public
      * @return    void
      */
-    public function HTML_QuickForm_text(
+    public function __construct(
         $elementName = null,
         $elementLabel = null,
         $attributes = array()
diff --git a/main/inc/lib/pear/HTML/QuickForm/textarea.php b/main/inc/lib/pear/HTML/QuickForm/textarea.php
index ac796b9c4e..e208a1995d 100755
--- a/main/inc/lib/pear/HTML/QuickForm/textarea.php
+++ b/main/inc/lib/pear/HTML/QuickForm/textarea.php
@@ -57,10 +57,10 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
      * @access    public
      * @return    void
      */
-    public function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null)
+    public function __construct($elementName=null, $elementLabel=null, $attributes=null)
     {
         $attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control';
-        HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+        parent::__construct($elementName, $elementLabel, $attributes);
         $this->_persistantFreeze = true;
         $this->_type = 'textarea';
     } //end constructor
diff --git a/main/inc/lib/pear/HTML/Table.php b/main/inc/lib/pear/HTML/Table.php
index cb4799b471..a2c6343d72 100755
--- a/main/inc/lib/pear/HTML/Table.php
+++ b/main/inc/lib/pear/HTML/Table.php
@@ -172,7 +172,7 @@ class HTML_Table extends HTML_Common {
      */
     function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
     {
-        HTML_Common::HTML_Common($attributes, (int)$tabOffset);
+        parent::__construct($attributes, (int)$tabOffset);
         $this->_useTGroups = (boolean)$useTGroups;
         $this->addBody();
         if ($this->_useTGroups) {
diff --git a/main/inc/lib/pear/HTML/Table/Storage.php b/main/inc/lib/pear/HTML/Table/Storage.php
index 087c2f330f..af47cc0fc0 100755
--- a/main/inc/lib/pear/HTML/Table/Storage.php
+++ b/main/inc/lib/pear/HTML/Table/Storage.php
@@ -128,7 +128,7 @@ class HTML_Table_Storage extends HTML_Common {
      */
     function HTML_Table_Storage($tabOffset = 0, $useTGroups = false)
     {
-        HTML_Common::HTML_Common(null, (int)$tabOffset);
+        parent::__construct(null, (int)$tabOffset);
         $this->_useTGroups = (boolean)$useTGroups;
     }
 
diff --git a/main/survey/reporting.php b/main/survey/reporting.php
index f30ac6cc18..3e6a07848d 100755
--- a/main/survey/reporting.php
+++ b/main/survey/reporting.php
@@ -79,8 +79,13 @@ $people_filled = survey_manager::get_people_who_filled_survey(
 SurveyUtil::check_parameters($people_filled);
 
 $survey_data = survey_manager::get_survey($survey_id);
+
+$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
+    api_get_user_id(),
+    api_get_course_info()
+);
 /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
-if (!api_is_allowed_to_edit(false, true)) {
+if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
 	Display :: display_header(get_lang('ToolSurvey'));
     // Show error message if the survey can be seen only by tutors
     if ($survey_data['visible_results'] != SURVEY_VISIBLE_TUTOR) {
@@ -151,13 +156,19 @@ echo '
'.Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').' ';
-	echo '