phpScheduleIt
June 19, 2013, 05:31:12 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: adding columns to "user permission" view of ressources  (Read 2694 times)
Pete
Guest
« on: September 27, 2008, 03:06:35 PM »

Getting Nicks comment on how to add columns to the "user permission" view of ressource allocation I changed the
lib/DBEngine.class.php
line 296 until 301 to:
        $sql = 'SELECT machid, name, location, status, approval, min_notice_time, max_notice_time FROM ' . $this->get_table('resources');
        if ($scheduleid != null) {
            $sql .= ' WHERE scheduleid = ?';
            $values = array($scheduleid);
        }
        $sql .= ' ORDER BY location';
and
templates/admin.template
line 668 until 689:
            <td width="240"><?php echo translate('Location')?></td>
            <td width="60"><?php echo translate('Allowed')?></td>
          </tr>
         
      <?php
         if (!$rs) echo '<tr class="cellColor0" style="text-align: center;"><td colspan="2">' . $err . '</td></tr>';

         for ($i = 0; is_array($rs) && $i < count($rs); $i++) {
            echo '<tr class="cellColor"><td>' . $rs[$i]['name'] . '</td><td>' . $rs[$i]['location']
               . '<td style="text-align: center;">'
                . '<input type="checkbox" name="machid[]" value="' . $rs[$i]['machid'] . '"';
            if ($user->has_perm($rs[$i]['machid']))
               echo ' checked="checked"';
            echo '/></td></tr>';
           }

      // Close off tables/forms.  Print buttons and hidden field
      ?>
          <tr class="cellColor1">
            <td>&nbsp;</td>
            <td style="text-align: center;">
              </td><td style="text-align: center;"><input type="checkbox" name="checkAll" onclick="checkAllBoxes(this);" />

The result is "Location" column after the "Resource Name" column.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!