Problem after upgrade

If you need support with TeamCal Pro (installation, configuration, usage) post your request here.
Post Reply
Easyspace
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 2008-01-04, 18:15

Problem after upgrade

Post by Easyspace » 2009-09-02, 16:47

Hiya,

Updated our install to the latest version and pretty much everything works smoothly. Except in editprofile.php

When the popup appears its fine, you can click on:

Personal Data/Membership/Options and they all open.

Privileges/Absences/Other do not open, they just go black as if you've clicked on it but they don't load.

Any ideas?

Content of my editprofile.php:

Code: Select all

<?php
/**
 * editprofile.php
 * 
 * Displays the edit user dialog
 * 
 * @package TeamCalPro
 * @version 3.2 
 * @author George Lewe
 * @copyright Copyright (c) 2004-2009 by George Lewe
 * @link http://www.lewe.com
 * @license http://www.lewe.com/tcpro/doc/license.txt Extended GNU Public License
 */
 
//echo "<script type=\"text/javascript\">alert(\"Debug: \");</script>";
 
/**
 * Includes 
 */
require ("config.tcpro.php");
require_once ("includes/functions.tcpro.php");
getOptions();
if (strlen($CONF['options']['lang'])) require ("includes/lang/" . $CONF['options']['lang'] . ".tcpro.php");
else                                  require ("includes/lang/english.tcpro.php");

require_once( "includes/tcabsence.class.php" );
require_once( "includes/tcallowance.class.php" );
require_once( "includes/tcavatar.class.php" );
require_once( "includes/tcconfig.class.php");
require_once( "includes/tcdaynote.class.php" );
require_once( "includes/tcgroup.class.php" );
require_once( "includes/tcholiday.class.php" );
require_once( "includes/tclogin.class.php" );
require_once( "includes/tclog.class.php" );
require_once( "includes/tcregion.class.php" );
require_once( "includes/tctemplate.class.php" );
require_once( "includes/tcuser.class.php" );
require_once( "includes/tcusergroup.class.php" );
require_once( "includes/tcuseroption.class.php" );

if ( isset($_REQUEST['username']) ) $username = $_REQUEST['username']; 

$A  = new tcAbsence;
$AV = new tcAvatar;
$B  = new tcAllowance;
$C = new tcConfig; 
$G  = new tcGroup;
$L  = new tcLogin;
$LOG = new tcLog;
$N  = new tcDaynote;
$R  = new tcRegion;
$T  = new tcTemplate;
$U  = new tcUser;
$UG = new tcUserGroup;
$UL = new tcUser;
$UO = new tcUserOption;

$error=false;
$grouprights=false;
$msg = false;
$pwdmismatch = false;

if ($user = $L->checkLogin()) $UL->findByName($user);
$U->findByName(stripslashes($_REQUEST['username']));

/**
 * Check authorization 
 */
if ( !checkAuth("editProfile",$U->username) ) {

   $error=true;
   $err_short=$LANG['err_not_authorized_short'];
   $err_long=$LANG['err_not_authorized_long'];
   $err_module="editprofile.php";

}else{
 
   /**
    * Default period for absence count
    */
   $today     = getdate();
   $countfrom = $today['year']."0101";
   $countto   = $today['year']."1231";

   /**
    * Update User 
    */
   if (isset($_POST['btn_update'])) {
      
      /**
       * Set password
       */
      if ( strlen($_POST['password']) ) {
         if ( $_POST['password']==$_POST['password2'] ) {
            $U->password = crypt($_POST['password'],$CONF['salt']);
            $U->last_pw_change = date("Y-m-d H:I:s");
            $U->clearStatus($CONF['USCHGPWD']);
         } else {
            $pwdmismatch = true;
            $msg = true;
            $message = $LANG['error_password_mismatch'];
         }
      }
      
      if ( !$pwdmismatch ) {
         $U->lastname    = htmlspecialchars($_POST['lastname'],ENT_QUOTES);
         $U->firstname   = htmlspecialchars($_POST['firstname'],ENT_QUOTES);
         $U->title       = htmlspecialchars($_POST['title'],ENT_QUOTES);
         $U->position    = htmlspecialchars($_POST['position'],ENT_QUOTES);
         $U->phone       = htmlspecialchars($_POST['phone'],ENT_QUOTES);
         $U->mobile      = htmlspecialchars($_POST['mobile'],ENT_QUOTES);
         $U->email       = $_POST['email'];
         $U->birthday    = str_replace("-","",$_POST['birthday']);
         $U->idnumber    = htmlspecialchars($_POST['idnumber'],ENT_QUOTES);
         $U->custom1     = htmlspecialchars($_POST['custom1'],ENT_QUOTES);
         $U->custom2     = htmlspecialchars($_POST['custom2'],ENT_QUOTES);
         $U->custom3     = htmlspecialchars($_POST['custom3'],ENT_QUOTES);
         $U->custom4     = htmlspecialchars($_POST['custom4'],ENT_QUOTES);
         $U->custom5     = htmlspecialchars($_POST['custom5'],ENT_QUOTES);
         $U->customFree  = addslashes(str_replace("\r\n","<br>",trim($_POST['customFree'])));
         $U->customPopup = addslashes(str_replace("\r\n","<br>",trim($_POST['customPopup'])));

         /**
          * Set gender
          */
         switch ($_POST['opt_gender']) {
         case "ut_male":
            $U->setUserType($CONF['UTMALE']);
            break;
         case "ut_female":
            $U->clearUserType($CONF['UTMALE']);
            break;
         default:
            $U->setUserType($CONF['UTMALE']);
            break;
         }
         
         /**
          * Set user options
          */
         if ( $UO->find($U->username,"owngroupsonly") ) $UO->update($U->username,"owngroupsonly","no");
         else $UO->create($U->username,"owngroupsonly","no");
         
         if ( $UO->find($U->username,"showbirthday") ) $UO->update($U->username,"showbirthday","no");
         else $UO->create($U->username,"showbirthday","no");
         
         if ( $UO->find($U->username,"ignoreage") ) $UO->update($U->username,"ignoreage","no");
         else $UO->create($U->username,"ignoreage","no");
         
         if ( $UO->find($U->username,"notifybirthday") ) $UO->update($U->username,"notifybirthday","no");
         else $UO->create($U->username,"notifybirthday","no");
         
         if ( $UO->find($U->username,"language") ) $UO->update($U->username,"language","english");
         else $UO->create($U->username,"language","english");
         
         if ( $UO->find($U->username,"defgroup") ) $UO->update($U->username,"defgroup",$C->readConfig("defgroupfilter"));
         else $UO->create($U->username,"defgroup",$C->readConfig("defgroupfilter"));
         
         if ( $UO->find($U->username,"defregion") ) $UO->update($U->username,"defregion",$C->readConfig("defregion"));
         else $UO->create($U->username,"defregion",$C->readConfig("defregion"));
         
         if ( !$UO->find($U->username,"deftheme") ) $UO->create($U->username,"deftheme",$C->readConfig("theme"));
         
         foreach($_POST as $key=>$value) {
            switch ($key) {
            case "uo_owngroups":
               $UO->update($U->username,"owngroupsonly","yes");
               break;
            case "uo_showbirthday":
               $UO->update($U->username,"showbirthday","yes");
               break;
            case "uo_ignoreage":
               $UO->update($U->username,"ignoreage","yes");
               break;
            case "uo_notifybirthday":
               $UO->update($U->username,"notifybirthday","yes");
               break;
            case "uo_language":
               $UO->update($U->username,"language",$_POST['uo_language']);
               break;
            case "uo_defgroup":
               $UO->update($U->username,"defgroup",$_POST['uo_defgroup']);
               break;
            case "uo_defregion":
               $UO->update($U->username,"defregion",$_POST['uo_defregion']);
               break;
            case "uo_deftheme":
               if ($C->readConfig("allowUserTheme")) {
                  $UO->update($U->username,"deftheme",$_POST['uo_deftheme']);
               }
               break;
            }
         }

         /**
          * Set user type
          */
         if ( checkAuth("editUserType") ) {
            $U->clearUserType($CONF['UTDIRECTOR']);
            $U->clearUserType($CONF['UTADMIN']);
            $U->clearUserType($CONF['UTTEMPLATE']);
            switch ($_POST['opt_usertype']) {
            case "ut_admin":
               $U->setUserType($CONF['UTADMIN']);
               break;
            case "ut_director":
               $U->setUserType($CONF['UTDIRECTOR']);
               break;
            case "ut_user":
               $U->setUserType($CONF['UTUSER']);
               break;
            case "ut_template":
               $U->setUserType($CONF['UTTEMPLATE']);
               break;
            }
         }
         
         /**
          * Set group membership
          */
         if ( checkAuth("editUserGroup") ) {
            // First, delete all group memberships for this user
            $UG->deleteByUser($U->username);
            // Now set all new memberships for this user
            foreach($_POST as $key=>$value) {
               if ($key{0}=="X") {
                  $theGroup=substr($key,1);
                  if ( isset($_POST["M".$theGroup]) ) {
                     //echo "<script type=\"text/javascript\">alert(\"Debug: ".$theGroup."\");</script>";
                     switch ($_POST["M".$theGroup]) {
                     case "ismember":
                        if (!$UG->isMemberOfGroup($U->username,$theGroup)) {
                           $UG->createUserGroupEntry($U->username,$theGroup,"member");
                        }else{
                           $UG->updateUserGroupType($U->username,$theGroup,"member");
                        }
                        $U->clearUserType($CONF['UTMANAGER']);
                        break;
                     case "ismanager":
                        if (!$UG->isMemberOfGroup($U->username,$theGroup)) {
                           $UG->createUserGroupEntry($U->username,$theGroup,"manager");
                        }else{
                           $UG->updateUserGroupType($U->username,$theGroup,"manager");
                        }
                        $U->setUserType($CONF['UTMANAGER']);
                        break;
                     default:
                        break;
                     }
                  }
               }
            }
         }

         /**
          * Set user status
          */
         if ( checkAuth("editUserStatus") ) {
            $U->bad_logins = 0;
            $U->bad_logins_start = "";
            $U->clearStatus($CONF['USLOCKED']);
            $U->clearStatus($CONF['USLOGLOC']);
            $U->clearStatus($CONF['USHIDDEN']);
            foreach($_POST as $key=>$value) {
               switch ($key) {
               case "us_locked":
                  $U->setStatus($CONF['USLOCKED']);
                  break;
               case "us_logloc":
                  $U->bad_logins = intval($C->readConfig("badLogins"));
                  $U->bad_logins_start = date("U");
                  $U->setStatus($CONF['USLOGLOC']);
                  $U->update($U->username);
                  break;
               case "us_hidden":
                  $U->setStatus($CONF['USHIDDEN']);
                  break;
               }
            }
         }
         
         /**
          * Set notification options
          */
         $U->notify=0;
         foreach($_POST as $key=>$value) {
            switch ($key) {
            case "notify_team":
               $U->notify+=$CONF['userchg'];
               break;
            case "notify_groups":
               $U->notify+=$CONF['groupchg'];
               break;
            case "notify_month":
               $U->notify+=$CONF['monthchg'];
               break;
            case "notify_absence":
               $U->notify+=$CONF['absencechg'];
               break;
            case "notify_holiday":
               $U->notify+=$CONF['holidaychg'];
               break;
            case "notify_usercal":
               $U->notify+=$CONF['usercalchg'];
               $U->notify_group = $_POST['lbxNotifyGroup'];
               break;
            }
         }
         
         /**
          * Deploy the changes
          */
         $U->update($U->username);
         
         /**
          * Send notification e-mails
          */
         $fullname = $U->firstname." ".$U->lastname;
         sendNotification("userchange",$fullname,"");
         
         /**
          * Set $msg to true if you wanna see a Javascript popup after update
          */
         $msg = false;
         $message = $LANG['profile_updated'];
         
         /**
          * Log this event
          */
         $LOG->log("logUser",$L->checkLogin(),"User profile updated: ".$U->username);
         
      } // endif !$pwdmismatch
   
   /**
    * Update Allowance 
    */
   }
   elseif ( isset($_POST['btn_abs_update']) ) {

      $countfrom = stripslashes($_POST['cntfrom']);
      $countto = stripslashes($_POST['cntto']);

      $query  = "SELECT `cfgsym` FROM `".$A->table."` ORDER BY `dspname`;";
      $result = $A->db->db_query($query);
      while ( $row = $A->db->db_fetch_array($result,MYSQL_ASSOC) ){
         $A->findBySymbol($row['cfgsym']);
         if ($A->cfgsym!=".") {
            if ( isset($_POST['lastyear-'.$A->cfgsym]) && isset($_POST['allowance-'.$A->cfgsym]) )
            {
               if ( is_numeric($_POST['lastyear-'.$A->cfgsym]) && is_numeric($_POST['allowance-'.$A->cfgsym]) )
               {
                  $newlastyear = floatval($_POST['lastyear-'.$A->cfgsym]);
                  $newallowance = floatval($_POST['allowance-'.$A->cfgsym]);
                  if ($B->findAllowance($U->username,$A->cfgsym)) {
                     /**
                      * This user has an individual allowance record for this
                      * absence type. Let's update it...
                      */
                     $B->updateAllowance($U->username,$A->cfgsym,$newlastyear,$newallowance);
                  }else{
                     /**
                      * This user does not have an individual allowance record
                      * for this absence type yet. Let's create one if a left
                      * over from last year was specified or if the allowance
                      * differs from the general allowance for this absence type.
                      */
                     if ( $newlastyear>0 || $newallowance<>floatval($A->allowance)) {
                        $B->createAllowance($U->username,$A->cfgsym,$newlastyear,$newallowance);
                     }
                  }
               }else{
                  echo "<script type=\"text/javascript\">alert(\"".$LANG['err_allowance_not_numeric']."\");</script>";
               }
            }
         }
      }
      /**
       * Log this event
       */
      $LOG->log("logUser",$L->checkLogin(),"User allowance updated: ".$U->username);

   /**
    * Update Avatar 
    */
   }
   elseif ( isset($_POST['btn_avatar_upload']) ) {
      $AV->save($U->username);
      if ($AV->message)
      {
         $error=true;
         $err_short="Avatar Upload Error";
         $err_long=$AV->message;
         $err_module="editprofile.php";
      }
      else
      {
         /**
          * Log this event
          */
         $LOG->log("logUser",$L->checkLogin(),"User avatar uploaded: ".$U->username);
      }
   }
   elseif (isset($_POST['btn_done'])) {
      if (isset($_REQUEST['referrer']))
         jsCloseAndReload($_REQUEST['referrer'].".php");   
      else
         jsCloseAndReload("userlist.php");
   }
}
 
require( "includes/header.html.inc.php" );

if ($error) {
   include ("error.php");
}
else { ?> 

<body onload='setupPanes("editprofile", "default");'>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
   <form enctype="multipart/form-data" name="userprofile" method="POST" action="<?=$_SERVER['PHP_SELF']."?referrer=".$_REQUEST['referrer']."&username=".$U->username."&lang=".$CONF['options']['lang']?>">
      <table class="dlg">
         <tr>
            <td class="dlg-header">
               <?php printDialogTop($LANG['edit_profile_title'].": ".$U->title." ".$U->firstname." ".$U->lastname,"edit_profile.html","ico_users.png"); ?>
            </td>
         </tr>

         <tr>
            <td class="dlg-body">
               <br>
               <div class="tab-container" id="editprofile">
                  <ul class="tabs">
                     <li><a href="#" onclick="return showPane('pane1',this)" id="default"><?=$LANG['tab_personal_data']?></a></li>
                     <li><a href="#" onclick="return showPane('pane2',this)"><?=$LANG['tab_membership']?></a></li>
                     <li><a href="#" onclick="return showPane('pane3',this)"><?=$LANG['tab_options']?></a></li>
                     <?php if (checkAuth("tabOptions")) { ?>
                     <li><a href="#" onclick="return showPane('pane4',this)"><?=$LANG['tab_privileges']?></a></li>
                     <?php } ?>
                     <li><a href="#" onclick="return showPane('pane5',this)"><?=$LANG['tab_absences']?></a></li>
                     <?php if ($C->readConfig("showAvatars")) { ?>
                     <li><a href="#" onclick="return showPane('pane6',this)"><?=$LANG['tab_avatar']?></a></li>
                     <?php } ?>
                     <li><a href="#" onclick="return showPane('pane7',this)"><?=$LANG['tab_other']?></a></li>
                  </ul>
                  <div class="tab-panes">
                     
                     <!-- PERSONAL DATA -->
                     <div id="pane1">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <?php printDialogFrameTop($LANG['frame_personal_details'],"500"); ?>
                                 <table class="dlg-frame">
                                    <tr>
                                       <td class="dlg-body" width="80"><strong><?=$LANG['show_profile_name']?></strong></td>
                                       <td class="dlg-body2"><strong><?=$U->firstname." ".$U->lastname?></strong></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_uname']?></strong></td>
                                       <td class="dlg-body"><?=$U->username?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_password']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="password" id="password" size="50" type="password" class="text" value="">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_verify_password']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="password2" id="password2" size="50" type="password" class="text" value="">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_lname']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="lastname" id="lastname" size="50" type="text" class="text" value="<?=$U->lastname?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_fname']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="firstname" id="firstname" size="50" type="text" class="text" value="<?=$U->firstname?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_usertitle']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="title" id="title" size="50" type="text" class="text" value="<?=$U->title?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_position']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="position" id="position" size="50" type="text" class="text" value="<?=$U->position?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_idnumber']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="idnumber" id="idnumber" size="50" type="text" class="text" value="<?=$U->idnumber?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_phone']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="phone" id="phone" size="50" type="text" class="text" value="<?=$U->phone?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_mobile']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="mobile" id="mobile" size="50" type="text" class="text" value="<?=$U->mobile?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_email']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="email" id="email" size="50" type="text" class="text" value="<?=$U->email?>">
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_birthday']?></strong></td>
                                       <td class="dlg-body">
                                          <table cellspacing="0" cellpadding="0" border="0">
                                             <tr>
                                                <td>
                                                   <input name="birthday" id="birthday" size="10" maxlength="10" type="text" class="text" value="<?=substr($U->birthday,0,4)."-".substr($U->birthday,4,2)."-".substr($U->birthday,6,2);
                                                   ?>">
                                                   <img src="themes/<?=$theme?>/img/ico_calendar.png" id="datepicker" title="<?=$LANG['date_picker']?>" alt="<?=$LANG['date_picker']?>" align="middle" onmouseover="return overlib('<?=$LANG['date_picker_tt']?>',<?=$CONF['ovl_tt_settings']?>);" onmouseout="return nd();">
                                                   <script type="text/javascript">
                                                      <!--
                                                      Calendar.setup({
                                                         inputField  : "birthday",     // id of the input field
                                                         ifFormat    : "%Y-%m-%d",       // format of the input field
                                                         date        : "",
                                                         button      : "datepicker",   // trigger for the calendar (button ID)
                                                         align       : "Tr",           // alignment (defaults to "Bl")
                                                         singleClick : true
                                                      });
                                                      -->
                                                   </script>
                                                    <?=$LANG['show_profile_birthday_format']?>
                                                </td>
                                             </tr>
                                          </table>
                                       </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-body"><strong><?=$LANG['show_profile_gender']?></strong></td>
                                       <td class="dlg-body">
                                          <input name="opt_gender" id="utmale" type="radio" value="ut_male" <?php if ( $U->checkUserType($CONF['UTMALE']) ) echo "CHECKED"; ?> ><?=$LANG['show_profile_male']?>
                                            
                                          <input name="opt_gender" id="utfemale" type="radio" value="ut_female" <?php if ( !$U->checkUserType($CONF['UTMALE']) ) echo "CHECKED"; ?> ><?=$LANG['show_profile_female']?>
                                       </td>
                                    </tr>
                                 </table>
                                 <?php printDialogFrameBottom(); ?>
                              </td>
                           </tr>
                        </table>
                     </div>
                     
                     <!-- MEMBERSHIP -->
                     <div id="pane2">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <?php printDialogFrameTop($LANG['frame_user_groupmember'],"500"); ?>
                                 <table width="99%">
                                    <tr>
                                       <td class="dlg-frame-body"><strong><?=$LANG['tab_membership_group']?></strong></td>
                                       <td class="dlg-frame-bodyc"><strong><img src="themes/<?=$theme?>/img/ico_usr.png" alt=""><?=$LANG['tab_membership_member']?></strong></td>
                                       <td class="dlg-frame-bodyc"><strong><img src="themes/<?=$theme?>/img/ico_usr_manager.png" alt=""><?=$LANG['tab_membership_manager']?></strong></td>
                                    </tr>
                                    <?php
                                       $Gquery  = "SELECT * FROM `".$G->table."` ORDER BY `groupname`;";
                                       $Gresult = $G->db->db_query($Gquery);
                                       $rowstyle=1;
                                       while ( $row=$G->db->db_fetch_array($Gresult,MYSQL_ASSOC) ) {
                                          $membership="";
                                          $ismember="DISABLED";
                                          $ismanager="DISABLED";
                                          if ($UG->isMemberOfGroup($U->username,$row['groupname'])) {
                                             $membership="CHECKED";
                                             if ($UG->type=="manager") {
                                                $ismember="";
                                                $ismanager="CHECKED";
                                             }else{
                                                $ismember="CHECKED";
                                                $ismanager="";
                                             }
                                          }
                                          if ( !checkAuth("editUserGroup",$U->username) ) {
                                             $membership .= " DISABLED";
                                             $ismember   .= " DISABLED";
                                             $ismanager  .= " DISABLED";
                                          }
                                          $gname = $row['groupname'];
                                          echo '<tr class="row'.$rowstyle.'">
                                             <td class="dlg-frame-body">
                                                <input name="X'.$gname.'" type="checkbox" onclick="javascript:toggleGrp(\''.$gname.'\');" '.$membership.'>'.$gname.'
                                             </td>
                                             <td class="dlg-frame-bodyc">
                                                <input name="M'.$gname.'" value="ismember" type="radio" '.$ismember.'>
                                             </td>
                                             <td class="dlg-frame-bodyc">
                                                <input name="M'.$gname.'" value="ismanager" type="radio" '.$ismanager.'>
                                             </td>
                                          </tr>
                                          ';
                                          if ($rowstyle) $rowstyle=0; else $rowstyle=1;
                                       }
                                    ?>
                                 </table>
                                 <?php printDialogFrameBottom(); ?>
                              </td>
                           </tr>
                        </table>
                     </div>
                     
                     <!-- USER OPTIONS -->
                     <div id="pane3">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                              <!-- OPTIONS -->
                              <?php printDialogFrameTop($LANG['frame_uo'],"400"); ?>
                                 <table>
                                    <tr>
                                       <td class="dlg-frame-body" colspan="3"><strong><?=$LANG['uo_caption']?></strong></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="uo_owngroups" id="uo_owngroups" type="checkbox" value="uo_owngroups" <?=$UO->true($U->username,"owngroupsonly")?"CHECKED":""?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['uo_owngroupsonly']?></td>
                                    </tr>
                                    <tr>
			                           <td class="dlg-frame-body">
			                              <input name="uo_showbirthday" id="uo_showbirthday" type="checkbox" value="uo_showbirthday" onclick="javascript: var obj = document.getElementById('thisid'); if (document.forms[0].uo_showbirthday.checked==true) { document.forms[0].uo_ignoreage.disabled=false; obj.style.color = '#333333'; } else { document.forms[0].uo_ignoreage.disabled=true; document.forms[0].uo_ignoreage.checked=false; obj.style.color = '#BBBBBB'; }" <?=$UO->true($U->username,"showbirthday")?"CHECKED":""?> >
                                       </td>
					                   <td class="dlg-frame-body" colspan="2">
					                      <?=$LANG['uo_showbirthday']?>
					                   </td>
					                </tr>
                                    <tr>
                                       <td class="dlg-frame-body"> </td>
                                       <td class="dlg-frame-body">
                                          <input name="uo_ignoreage" id="uo_ignoreage" type="checkbox" value="uo_ignoreage" <?=$UO->true($U->username,"ignoreage")?"CHECKED":""?>>
                                       </td>
                                       <td class="dlg-frame-body">
                                          <div id="thisid"><?=$LANG['uo_ignoreage']?></div>
                                          <script type="text/javascript">
                                          <!--
                                          var obj = document.getElementById('thisid');
                                          if (document.forms[0].uo_showbirthday.checked==true) {
                                             document.forms[0].uo_ignoreage.disabled=false;
                                             obj.style.color = '#333333';
                                          } else {
                                             document.forms[0].uo_ignoreage.disabled=true;
                                             document.forms[0].uo_ignoreage.checked=false;
                                             obj.style.color = '#BBBBBB';
                                          }
                                          -->
                                          </script>
			                           </td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="uo_notifybirthday" id="uo_notifybirthday" type="checkbox" value="uo_notifybirthday" <?=$UO->true($U->username,"notifybirthday")?"CHECKED":""?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2">
                                          <?=$LANG['uo_notifybirthday']?>
                                       </td>
                                    </tr>
                                 </table>
                                 <table>
                                    <tr>
                                       <td class="dlg-frame-body"><?=$LANG['uo_language']?>:</td>
                                       <td class="dlg-frame-body"> 
                                          <select name="uo_language" id="uo_language" class="select">
                                          <?php
                                          $array = getLanguages(); // Collects language name of all installed language files
                                          if ($deflang=$UO->find($U->username,"language")) $CONF['options']['lang']=$deflang;
                                          foreach( $array as $langfile ) {
                                             if ($langfile==$CONF['options']['lang']) 
                                                echo "<option value=\"".$langfile."\" SELECTED=\"selected\">".$langfile."</option>";
                                             else
                                                echo "<option value=\"".$langfile."\">".$langfile."</option>";
                                          }
                                           ?>
                                          </select>
                                       </td>
                                       <td class="dlg-frame-body">  </td>
                                       <td class="dlg-frame-body"><?=$LANG['uo_defgroup']?>:</td>
                                       <td class="dlg-frame-body"> 
                                          <select name="uo_defgroup" id="uo_defgroup" class="select">
                                          <?php
                                          if ($thisdefgroup=$UO->find($U->username,"defgroup")) $defgroup=$thisdefgroup;
                                          ?>
                                          <option class="option" value="default" <?=($defgroup=="default"?"SELECTED":"")?>>default</option>
                                          <option class="option" value="All" <?=($defgroup=="All"?"SELECTED":"")?>><?=$LANG['drop_group_all']?></option>
                                          <option class="option" value="Allbygroup" <?=($defgroup=="Allbygroup"?"SELECTED":"")?>><?=$LANG['drop_group_allbygroup']?></option>
                                          <?php
                                          $query  = "SELECT `groupname` FROM `".$CONF['db_table_groups']."` WHERE 1 ORDER BY `groupname`;";
                                          $result = $G->db->db_query($query);
                                          while ( $row = $G->db->db_fetch_array($result) ){
                                             $G->findByName(stripslashes($row['groupname']));
                                             if ($defgroup==$G->groupname) echo ("<option value=\"" . $defgroup . "\" SELECTED=\"selected\">" . $defgroup . "</option>");
                                             else                          echo ("<option value=\"" . $G->groupname . "\" >" . $G->groupname . "</option>");
                                          }
                                          ?>
                                          </select>
                                       </td>
                                    </tr>
                                 </table>
                                 <?php if ($C->readConfig("allowUserTheme")) { ?>
                                 <table>
                                    <tr>
                                       <td class="dlg-frame-body"><?=$LANG['uo_deftheme']?>:</td>
                                       <td class="dlg-frame-body"> 
                                          <select name="uo_deftheme" id="uo_deftheme" class="select">
                                          <?php
                                          $themearray = getThemes();
                                          $themearray[]['name']="default";
                                          sort($themearray);
                                          if ($thisdeftheme=$UO->find($U->username,"deftheme")) $deftheme=$thisdeftheme;
                                          else $deftheme="default";
                                          foreach( $themearray as $mytheme ) {
                                             if ($mytheme['name']==$thisdeftheme) {
                                                echo "<option value=\"".$mytheme['name']."\" SELECTED=\"selected\">".$mytheme['name']."</option>";
                                             }
                                             else
                                                echo "<option value=\"".$mytheme['name']."\">".$mytheme['name']."</option>";
                                          }
                                          ?>
                                          </select>
                                       </td>
                                       <td class="dlg-frame-body">  </td>
                                       <td class="dlg-frame-body"><?=$LANG['uo_defregion']?>:</td>
                                       <td class="dlg-frame-body"> 
                                          <select name="uo_defregion" id="uo_defregion" class="select">
                                          <?php
                                          if ($thisdefregion=$UO->find($U->username,"defregion")) $defregion=$thisdefregion; else $defregion="default";
                                          ?>
                                          <option class="option" value="default" <?=($defregion=="default"?"SELECTED":"")?>>default</option>
                                          <?php
                                          $query  = "SELECT `regionname` FROM `".$R->table."` ORDER BY `regionname`;";
                                          $result = $R->db->db_query($query);
                                          while ( $row = $R->db->db_fetch_array($result,MYSQL_ASSOC) ){
                                             $R->findByName(stripslashes($row['regionname']));
                                             if ($R->regionname!="default") {
                                                if ($defregion==$R->regionname) echo ("<option value=\"" . $defregion . "\" SELECTED=\"selected\">" . $defregion . "</option>");
                                                else                            echo ("<option value=\"" . $R->regionname . "\" >" . $R->regionname . "</option>");
                                             }
                                          }
                                          ?>
                                          </select>
                                       </td>
                                    </tr>
                                 </table>
                                 <?php } ?>
                              <?php printDialogFrameBottom(); ?>
                              
                              <!-- NOTIFICATION -->
                              <?php printDialogFrameTop($LANG['frame_mail_notification'],"400"); ?>
                                 <table>
                                    <tr>
                                       <td class="dlg-frame-body" colspan="3"><strong><?=$LANG['notify_caption']?></strong></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_team" id="notify_team" type="checkbox" value="notify_team" <?=($U->notify&$CONF['userchg'])==$CONF['userchg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['notify_team']?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_groups" id="notify_groups" type="checkbox" value="notify_groups" <?=($U->notify&$CONF['groupchg'])==$CONF['groupchg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['notify_groups']?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_month" id="notify_month" type="checkbox" value="notify_month" <?=($U->notify&$CONF['monthchg'])==$CONF['monthchg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['notify_month']?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_absence" id="notify_absence" type="checkbox" value="notify_month" <?=($U->notify&$CONF['absencechg'])==$CONF['absencechg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['notify_absence']?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_holiday" id="notify_holiday" type="checkbox" value="notify_month" <?=($U->notify&$CONF['holidaychg'])==$CONF['holidaychg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body" colspan="2"><?=$LANG['notify_holiday']?></td>
                                    </tr>
                                    <tr>
                                       <td class="dlg-frame-body">
                                          <input name="notify_usercal" id="notify_usercal" type="checkbox" value="notify_member" <?=($U->notify&$CONF['usercalchg'])==$CONF['usercalchg']?"CHECKED":"" ?> >
                                       </td>
                                       <td class="dlg-frame-body"><?=$LANG['notify_usercal']?></td>
                                       <td class="dlg-frame-body"> <?=$LANG['notify_ofgroup']?> 
                                          <select name="lbxNotifyGroup" id="lbxNotifyGroup" class="select">
                                             <option class="option" value="All"><?=$LANG['drop_group_all']?></option>
                                             <?php
                                             $query  = "SELECT `groupname` FROM `".$G->table."` ORDER BY `groupname`;";
                                             $result = $G->db->db_query($query);
                                             $i=1;
                                             while ( $row = $G->db->db_fetch_array($result,MYSQL_ASSOC) ){
                                                if ($U->notify_group==$row['groupname']) {
                                                   echo "<option class=\"option\" value=\"".$U->notify_group."\" SELECTED=\"selected\">".$U->notify_group."</option>";
                                                }else{
                                                   echo "<option class=\"option\" value=\"".$row['groupname']."\" >".$row['groupname']."</option>";
                                                }
                                             }
                                             ?>
                                          </select>
                                       </td>
                                    </tr>
                                 </table>
                                 <?php printDialogFrameBottom(); ?>
                              </td>
                           </tr>
                        </table>
                     </div>
                     
                     <!-- PRIVILEGES -->
                     <div id="pane4">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <!-- USER TYPE -->
                                 <?php if ( checkAuth("editUserType") ) { 
                                    printDialogFrameTop($LANG['frame_user_type'],"400"); ?>
                                    <table>
                                       <tr>
                                          <td class="dlg-frame-body" colspan="3"><strong><?=$LANG['ut_caption']?></strong><br>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body" width="20">
                                             <input name="opt_usertype" id="utuser" type="radio" value="ut_user" <?php if ( !$U->checkUserType($CONF['UTDIRECTOR']) && !$U->checkUserType($CONF['UTADMIN']) ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['ut_user']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body" width="20">
                                             <input name="opt_usertype" id="utdirector" type="radio" value="ut_director" <?php if ( $U->checkUserType($CONF['UTDIRECTOR']) ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['ut_director']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body">
                                             <input name="opt_usertype" id="utadmin" type="radio" value="ut_admin" <?php if ( $U->checkUserType($CONF['UTADMIN']) ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['ut_admin']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body">
                                             <input name="opt_usertype" id="uttemplate" type="radio" value="ut_template" <?php if ( $U->checkUserType($CONF['UTTEMPLATE']) ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['ut_template']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                    </table>
                                    <?php printDialogFrameBottom();
                                 } ?>
                              
                                 <!-- USER STATUS -->
                                 <?php if ( checkAuth("editUserStatus") ) { 
                                    printDialogFrameTop($LANG['frame_user_status'],"400"); ?>
                                    <table>
                                       <tr>
                                          <td class="dlg-frame-body" colspan="3"><strong><?=$LANG['us_caption']?></strong><br>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body">
                                             <input name="us_locked" id="us_locked" type="checkbox" value="us_locked" <?php if ( $U->status & $CONF['USLOCKED'] ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['us_locked']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body">
                                             <input name="us_logloc" id="us_logloc" type="checkbox" value="us_logloc" <?php if ( $U->status & $CONF['USLOGLOC'] ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['us_logloc']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                       <tr>
                                          <td class="dlg-frame-body">
                                             <input name="us_hidden" id="us_hidden" type="checkbox" value="us_hidden" <?php if ( $U->status & $CONF['USHIDDEN'] ) echo "CHECKED"; ?> >
                                          </td>
                                          <td class="dlg-frame-body"><?=$LANG['us_hidden']?></td>
                                          <td class="dlg-frame-body"> </td>
                                       </tr>
                                    </table>
                                    <?php printDialogFrameBottom();
                                 } ?>
                              </td>
                           </tr>
                        </table>
                     </div>
                     
                     <!-- ABSENCES -->
                     <div id="pane5">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <?php include( "includes/absencecount.inc.php" ); ?>
                              </td>
                           </tr>
                        </table>
                     </div>

                     <!-- AVATAR -->
                     <?php if($C->readConfig("showAvatars")) { ?>
                     <div id="pane6">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <?php include( "includes/avatar.inc.php" ); ?>
                              </td>
                           </tr>
                        </table>
                     </div>
                     <?php } ?>

                     <!-- OTHER -->
                     <div id="pane7">
                        <table class="pane">
                           <tr>
                              <td class="pane">
                                 <?php include( "includes/other.inc.php" ); ?>
                              </td>
                           </tr>
                        </table>
                     </div>

                  </div>
               </div>
            </td>
         </tr>
         <tr>
            <td class="dlg-menu">
               <input name="btn_update" type="submit" class="button" value="<?=$LANG['btn_apply']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';"> 
               <input name="btn_help" type="button" class="button" onclick="javascript:this.blur(); openPopup('help/<?=$CONF['options']['helplang']?>/html/index.html?edit_profile.html','help','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,titlebar=0,resizable=0,dependent=1,width=740,height=500');" value="<?=$LANG['btn_help']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
               <input name="btn_close" type="button" class="button" onclick="javascript:window.close();" value="<?=$LANG['btn_close']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
               <input name="btn_done" type="submit" class="button" value="<?=$LANG['btn_done']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
            </td>
         </tr>
      </table>
   </form>
   


<?php
}
if ($msg) echo ("<script type=\"text/javascript\">alert(\"".$message."\")</script>");
require( "includes/footer.html.inc.php");
?>

User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 420
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re:Problem after upgrade

Post by George » 2009-10-06, 23:51

Hi Easyspace,

I apologize for the late (yes, very late) reply. I was extremely tied up in business.

Maybe you have solved the issue meanwhile. If not, can you attach the file as a ZIP. That way it is easier for me to check it.

Best regards,
George
TeamCal Neo is free for private use but requires licensing for use in a commercial environment:
https://georgelewe.atlassian.net/wiki/s ... eo+License

Post Reply