From 1c98c14fa6a5c5bd7b3dfa2d3844a749c304b605 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Wed, 8 Jul 2015 21:22:49 +0000
Subject: [PATCH] lint: Lint test fixes

---
 include/class.forms.php       | 6 +++---
 include/class.staff.php       | 2 +-
 include/class.task.php        | 1 +
 scp/staff.inc.php             | 2 +-
 setup/inc/class.installer.php | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index dbd05a2b9..47d6ae86d 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -174,13 +174,13 @@ class Form {
         echo $this->getMedia();
     }
 
-    function getLayout() {
+    function getLayout($title=false, $options=array()) {
         $rc = @$options['renderer'] ?: static::$renderer;
         return new $rc($title, $options);
     }
 
     function asTable($options=array()) {
-        return $this->getLayout()->asTable($this);
+        return $this->getLayout(false, $options)->asTable($this);
         // XXX: Media can't go in a table
         echo $this->getMedia();
     }
@@ -386,7 +386,7 @@ implements FormRenderer {
           $attrs = array('colspan' => $size, 'rowspan' => $layout->getHeight(),
               'style' => '"'.$layout->getOption('style').'"');
           if ($offs) { ?>
-              <td colspan="<?php echo $offset; ?>"></td> <?php
+              <td colspan="<?php echo $offs; ?>"></td> <?php
           }
           ?>
           <td class="cell" <?php echo Format::array_implode('=', ' ', array_filter($attrs)); ?>
diff --git a/include/class.staff.php b/include/class.staff.php
index 153bdc0a0..6725a9c85 100644
--- a/include/class.staff.php
+++ b/include/class.staff.php
@@ -1047,7 +1047,7 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
         return !$errors;
     }
 
-    function updatePerms($vars, &$errors) {
+    function updatePerms($vars, &$errors=array()) {
         if (!$vars) {
             $this->permissions = '';
             return;
diff --git a/include/class.task.php b/include/class.task.php
index b5c086a19..f8c2ae765 100644
--- a/include/class.task.php
+++ b/include/class.task.php
@@ -805,6 +805,7 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
                     ));
         // Send alert to collaborators
         if ($alert && $vars['emailcollab']) {
+            $signature = '';
             $this->notifyCollaborators($response,
                 array('signature' => $signature)
             );
diff --git a/scp/staff.inc.php b/scp/staff.inc.php
index edbc81300..bb06f3eb8 100644
--- a/scp/staff.inc.php
+++ b/scp/staff.inc.php
@@ -76,7 +76,7 @@ if (!$thisstaff || !$thisstaff->getId() || !$thisstaff->isValid()) {
 //2) if not super admin..check system status and group status
 if(!$thisstaff->isAdmin()) {
     //Check for disabled staff or group!
-    if(!$thisstaff->isactive() || !$thisstaff->isGroupActive()) {
+    if (!$thisstaff->isactive()) {
         staffLoginPage(__('Access Denied. Contact Admin'));
         exit;
     }
diff --git a/setup/inc/class.installer.php b/setup/inc/class.installer.php
index 3986191a9..6ab645e7d 100644
--- a/setup/inc/class.installer.php
+++ b/setup/inc/class.installer.php
@@ -199,7 +199,7 @@ class Installer extends SetupWizard {
             Organization::PERM_DELETE,
             FAQ::PERM_MANAGE,
             Email::PERM_BANLIST,
-        ), $errors);
+        ));
         $staff->setPassword($vars['passwd']);
         if (!$staff->save()) {
             $this->errors['err'] = __('Unable to create admin user (#6)');
-- 
GitLab