Location: PHPKode > projects > Phpgw Time Tracking Add On App > timetrack/preferences.php
<?php
  /**************************************************************************\
  * phpGroupWare - Time Tracking                                             *
  * http://www.phpgroupware.org                                              *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  /* $Id: preferences.php,v 1.5 2001/01/12 22:35:40 rschader Exp $ */

 if($submit) {
  $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
 }

  $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
  $phpgw_info["flags"]["currentapp"] = "timetrack";
  include("../header.inc.php");

  if ($submit) {
     //$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"timetrack");
     //$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"cnamesize","timetrack");
     $phpgw->preferences->change("timetrack","cnamesize",$cnamesize);
     $phpgw->preferences->commit();

     Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
     exit;
  }

  if ($totalerrors) {  
     echo "<p><center>" . $phpgw->common->error_list($errors) . "</center>";
  }

  echo "<p><b>" . lang("Time Tracking Preferences") . ":" . "</b><hr><p>";
  // Preference items for this app:
  // 1. Definitely need a "company_name_dropdown_size" field for unix browsers.
  //    Use drop downs for this to limit entries (1, 5, 10, 15, 20)
  // 2. Other dropdown sizes?
  // 3. Columns to display for jobslist, customerlist.
?>
 <form action="<?php echo $phpgw->link(); ?>" method="POST">
  <table border="0" align="center" width="50%">
  <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
   <td colspan="2">&nbsp;</td>
  </tr>

  <?php
    $current_csize = $phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"];
    $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
  ?>
  <tr bgcolor="<?php echo $tr_color; ?>">
   <td><?php echo lang("Height for Company Name Dropdown"); ?></td>
   <td align="center">
    <?php
      echo '<select name="cnamesize">';
      $sizes = array(1,5,10,15,20);
      for($i=0; $i<5; $i++){
        echo '<option value="' . $sizes[$i] . '"';
        if($sizes[$i] == $current_csize) echo " selected";
        echo '>' . $sizes[$i] . '</option>';
      }
      echo '</select>';
    ?>
  </td>

  </tr>
  <tr><td align="center"><input type="submit" name="submit" value="<?php echo lang("submit"); ?>"></td></tr>
 </table>
</form>

<?php 
    $phpgw->common->phpgw_footer();
?>
Return current item: Phpgw Time Tracking Add On App