Request window

Topics brought up by the TimeTrex open source community.
Locked
guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Request window

Post by guanaco » Wed Feb 23, 2011 12:47 pm

After updating to V. 4.2.0 the window where the request from an employee changed and we are not able to see the request anymore.
Image

Ever since I installed Timetrex no update cause this problem. Can you please help me?

Thank you

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 1:43 pm

No such version (v4.2.0) of TimeTrex exists, what version are you really using? Also what version did you upgrade from?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 1:47 pm

shaunw wrote:No such version (v4.2.0) of TimeTrex exists, what version are you really using? Also what version did you upgrade from?
I am so sorry... I really dont know where I got that from... is V3.4.0

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 1:50 pm

When you are viewing the request, are you doing it from a supervisor login with the purpose of authorizing the request? Or from an employee login with the purpose of just viewing the request itself?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 2:40 pm

shaunw wrote:When you are viewing the request, are you doing it from a supervisor login with the purpose of authorizing the request? Or from an employee login with the purpose of just viewing the request itself?
Either with the Administrator or the Supervisors level the same window appear. I check the Group Permissions on both levels and they have everything enabled in the Request subject.

noamparn
Posts: 115
Joined: Thu Aug 27, 2009 9:17 am

Re: Request window

Post by noamparn » Wed Feb 23, 2011 3:11 pm

Is it possible that the window is too small for everything that is supposed to be in it?
Can you stretch the window, and see more in it?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 3:16 pm

noamparn wrote:Is it possible that the window is too small for everything that is supposed to be in it?
Can you stretch the window, and see more in it?
There is nothing else... I maximised it but thats everything shown. After updating my installation to the newest version this started to happen.

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 3:27 pm

guanaco wrote:
shaunw wrote:When you are viewing the request, are you doing it from a supervisor login with the purpose of authorizing the request? Or from an employee login with the purpose of just viewing the request itself?
Either with the Administrator or the Supervisors level the same window appear. I check the Group Permissions on both levels and they have everything enabled in the Request subject.
If you are logged in a supervisor/administrator, you should at least be seeing the Authorize/Decline buttons. If you aren't its likely that you don't have the Request -> Authorize permission allowed.

Have you modified the permissions at all?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 3:33 pm

shaunw wrote:
guanaco wrote:
shaunw wrote:When you are viewing the request, are you doing it from a supervisor login with the purpose of authorizing the request? Or from an employee login with the purpose of just viewing the request itself?
Either with the Administrator or the Supervisors level the same window appear. I check the Group Permissions on both levels and they have everything enabled in the Request subject.
If you are logged in a supervisor/administrator, you should at least be seeing the Authorize/Decline buttons. If you aren't its likely that you don't have the Request -> Authorize permission allowed.

Have you modified the permissions at all?
I have never touched the permissions.

Image
This is the permission layout of the Administrator (My account)
Image

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 3:44 pm

Is this happening for all requests, even requests submitted after the upgrade to v3.4.0?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 3:47 pm

shaunw wrote:Is this happening for all requests, even requests submitted after the upgrade to v3.4.0?
This is happening for all requests, even the ones submitted prior the upgrade

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 3:48 pm

When viewing the request, can you please view the HTML source and attach the entire source here.

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 3:54 pm

shaunw wrote:When viewing the request, can you please view the HTML source and attach the entire source here.

Code: Select all

<html>
<head>
<link rel="stylesheet" href="/timetrex/interface/global.css.php" type="text/css" />

<title>TimeTrex</title>

<SCRIPT language=JavaScript src="/timetrex/interface/global.js.php" type=text/javascript></SCRIPT>

<SCRIPT language=JavaScript>

function help_window(group) {
	help=window.open('/timetrex/interface/help/WindowViewHelp.php?script='+ encodeURI(group) +'&title='+ encodeURI('View Request'),"Help","toolbar=0,status=1,menubar=0,scrollbars=1,fullscreen=no,width=400,height=600,resizable=1");
}


</SCRIPT>

</head>

<body id="body" onLoad="fixWidth();;firstElementFocus();">



<a name="top"></a>
<!-- End Header --><script	language=JavaScript>


function fixWidth() {
	resizeWindowToFit( document.getElementById('body'), 'both' );
}

function viewTimeSheet(userID,dateStamp) {
	window.opener.location.href = '/timetrex/interface/timesheet/ViewUserTimeSheet.php?filter_data[user_id]='+ encodeURI(userID) +'&filter_data[date]='+ encodeURI(dateStamp);
}

</script>

<div id="rowContent">
  <div id="titleTab"><div class="textTitle"><span class="textTitleSub">View Request</span></div>
</div>
<div id="rowContentInner">

		<form method="post" name="wage" action="/timetrex/interface/request/ViewRequest.php">
		    <div id="contentBoxTwoEdit">

				
				<table class="editTable">

				<tr>
					<td class="cellLeftEditTable">
						Employee:					</td>
					<td class="cellRightEditTable">
						Jorge Ramirez
					</td>
				</tr>

				<tr onClick="showHelpEntry('date_stamp')">
					<td class="cellLeftEditTable">
						Date:					</td>
					<td class="cellRightEditTable">
						23-Feb-11 [ <a href="javascript:viewTimeSheet('18','1298440800');">View TimeSheet</a> ]
					</td>
				</tr>

				<tr onClick="showHelpEntry('type_id')">
					<td class="cellLeftEditTable">
						Type:					</td>
					<td class="cellRightEditTable">
						Punch Adjustment
					</td>
				</tr>

				<tr>

					<td colspan="2">
						
I know that is cut but thats everything that shows

This is the code of the ViewRequest.tpl file

Code: Select all

{include file="sm_header.tpl" body_onload="fixWidth();"}
<script language=JavaScript>

{literal}
function fixWidth() {
        resizeWindowToFit( document.getElementById('body'), 'both' );
}

function viewTimeSheet(userID,dateStamp) {
        window.opener.location.href = '{/literal}{$BASE_URL}{literal}timesheet/ViewUserTimeSheet.php?filter_data[user_id]='+ encodeURI(userID) +'&filter_data[date]='+ encodeURI(dateStamp);
}
{/literal}
</script>

<div id="rowContent">
  <div id="titleTab"><div class="textTitle"><span class="textTitleSub">{$title}</span></div>
</div>
<div id="rowContentInner">

                <form method="post" name="wage" action="{$smarty.server.SCRIPT_NAME}">
                    <div id="contentBoxTwoEdit">
                                {if !$rf->Validator->isValid()}
                                        {include file="form_errors.tpl" object="rf"}
                                {/if}

                                <table class="editTable">

                                <tr>
                                        <td class="cellLeftEditTable">
                                                {t}Employee:{/t}
                                        </td>
                                        <td class="cellRightEditTable">
                                                {$data.user_full_name}
                                        </td>
                                </tr>

                                <tr onClick="showHelpEntry('date_stamp')">
                                        <td class="{isvalid object="rf" label="datestamp" value="cellLeftEditTable"}">
                                                {t}Date:{/t}
                                        </td>
                                        <td class="cellRightEditTable">
                                                {getdate type="DATE" epoch=$data.date_stamp} [ <a href="javascript:viewTimeSheet('{$data.user_id}','{$data.date_stamp}');">{t}View TimeSheet{/t}</a> ]
                                        </td>
                                </tr>

                                <tr onClick="showHelpEntry('type_id')">
                                        <td class="{isvalid object="rf" label="type" value="cellLeftEditTable"}">
                                                {t}Type:{/t}
                                        </td>
                                        <td class="cellRightEditTable">
                                                {$data.type}
                                        </td>
                                </tr>

                                <tr>
                                        <td colspan="2">
                                                {embeddedauthorizationlist object_type_id=50 object_id=$data.id}
                                        </td>
                                </tr>

                                {if $data.authorized == FALSE AND $permission->Check('request','authorize') }
                                        <tr class="tblHeader">
                                                <td colspan="2"> 1
                                                        <input type="submit" class="button" name="action:decline" value="{t}Decline{/t}">
                                                        <input type="submit" class="button" name="action:pass" value="{t}Pass{/t}">
                                                        <input type="submit" class="button" name="action:authorize" value="{t}Authorize{/t}">
                                                </td>
                                        </tr>
                                {/if}

                        </table>
                </div>

                <input type="hidden" name="request_id" value="{$data.id}">
                <input type="hidden" name="selected_level" value="{$selected_level}">
                <input type="hidden" name="request_queue_ids" value="{$request_queue_ids}">

                </form>
        </div>
</div>

{if $data.id != ''}
<br>
<br>
<div id="rowContent">
  <div id="titleTab"><div class="textTitle"><span class="textTitleSub">{t}Messages{/t}</span></div>
</div>
<div id="rowContentInner">
        <div id="contentBoxTwoEdit">
                <table class="tblList">
                        <tr>
                                <td>
                                        {embeddedmessagelist object_type_id=50 object_id=$data.id}
                                </td>
                        </tr>
                </table>
        </div>
</div>
{/if}
{* {include file="footer.tpl"} *}

noamparn
Posts: 115
Joined: Thu Aug 27, 2009 9:17 am

Re: Request window

Post by noamparn » Wed Feb 23, 2011 5:15 pm

Have you tried clearing your TimeTrex cache, as well as your browser cache?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 5:19 pm

noamparn wrote:Have you tried clearing your TimeTrex cache, as well as your browser cache?
Just did that and nothing changed... this happens in several "supervisors" level computers besides mine.

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Wed Feb 23, 2011 6:00 pm

The fact that the HTML source is being cut off leads me to believe there is a PHP error happening somewhere that is halting execution of the script before the end. Have you checked your PHP error logs for any clues?

How did you install TimeTrex originally, with our automated installer or from the .ZIP file?

What operating system is TimeTrex running on?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Wed Feb 23, 2011 6:06 pm

shaunw wrote:The fact that the HTML source is being cut off leads me to believe there is a PHP error happening somewhere that is halting execution of the script before the end. Have you checked your PHP error logs for any clues?

How did you install TimeTrex originally, with our automated installer or from the .ZIP file?

What operating system is TimeTrex running on?
I installed it with the .zip file, I am running it on Ubuntu Server 10.04. It was working fine until I upgrade to this version... All previous updates did not generate this behaivior.

In the PHP logs I am getting this error:
[Wed Feb 23 13:38:33 2011] [error] [client 10.10.3.20] PHP Fatal error: Call to a member function getById() on a non-object in /var/www/timetrex/classes/smarty/libs/plugins/function.embeddedauthorizationlist.php on line 23, referer: http://10.10.254.51/timetrex/interface/ ... geList.php

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Thu Feb 24, 2011 8:31 am

guanaco wrote:
shaunw wrote:The fact that the HTML source is being cut off leads me to believe there is a PHP error happening somewhere that is halting execution of the script before the end. Have you checked your PHP error logs for any clues?

How did you install TimeTrex originally, with our automated installer or from the .ZIP file?

What operating system is TimeTrex running on?
I installed it with the .zip file, I am running it on Ubuntu Server 10.04. It was working fine until I upgrade to this version... All previous updates did not generate this behaivior.

In the PHP logs I am getting this error:
[Wed Feb 23 13:38:33 2011] [error] [client 10.10.3.20] PHP Fatal error: Call to a member function getById() on a non-object in /var/www/timetrex/classes/smarty/libs/plugins/function.embeddedauthorizationlist.php on line 23, referer: http://10.10.254.51/timetrex/interface/ ... geList.php
I have just modified the file /var/www/timetrex/classes/smarty/libs/plugins/function.embeddedauthorizationlist.php

Code: Select all

<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

function smarty_function_EmbeddedAuthorizationList($params, &$smarty)
{
    global $current_company, $current_user;

    $object_type_id = $params['object_type_id'];
    $object_id = $params['object_id'];

    $ulf = new UserListFactory();

    $hlf = new HierarchyListFactory();
    $hotlf = new HierarchyObjectTypeListFactory();

    $alf = new AuthorizationListFactory();
    $alf->setObjectType($object_type_id);
    //$authorizing_obj = $alf->getObjectHandler()->getById( $object_id )->getCurrent();
[b]//[/b]    $tmp_authorizing_obj = $alf->getObjectHandler()->getById( $object_id );
    if ( is_object($tmp_authorizing_obj) ) {
I added the "//" on the $tmp_authorizing_obj sentence (line 23) and the request window is now displayed completely.

Should this generate any other problem in other section? I will give it a try and let you know if something gets messed up.

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Thu Feb 24, 2011 9:03 am

guanaco wrote:
guanaco wrote:
shaunw wrote:The fact that the HTML source is being cut off leads me to believe there is a PHP error happening somewhere that is halting execution of the script before the end. Have you checked your PHP error logs for any clues?

How did you install TimeTrex originally, with our automated installer or from the .ZIP file?

What operating system is TimeTrex running on?
I installed it with the .zip file, I am running it on Ubuntu Server 10.04. It was working fine until I upgrade to this version... All previous updates did not generate this behaivior.

In the PHP logs I am getting this error:
[Wed Feb 23 13:38:33 2011] [error] [client 10.10.3.20] PHP Fatal error: Call to a member function getById() on a non-object in /var/www/timetrex/classes/smarty/libs/plugins/function.embeddedauthorizationlist.php on line 23, referer: http://10.10.254.51/timetrex/interface/ ... geList.php
I have just modified the file /var/www/timetrex/classes/smarty/libs/plugins/function.embeddedauthorizationlist.php

Code: Select all

<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

function smarty_function_EmbeddedAuthorizationList($params, &$smarty)
{
    global $current_company, $current_user;

    $object_type_id = $params['object_type_id'];
    $object_id = $params['object_id'];

    $ulf = new UserListFactory();

    $hlf = new HierarchyListFactory();
    $hotlf = new HierarchyObjectTypeListFactory();

    $alf = new AuthorizationListFactory();
    $alf->setObjectType($object_type_id);
    //$authorizing_obj = $alf->getObjectHandler()->getById( $object_id )->getCurrent();
[b]//[/b]    $tmp_authorizing_obj = $alf->getObjectHandler()->getById( $object_id );
    if ( is_object($tmp_authorizing_obj) ) {
I added the "//" on the $tmp_authorizing_obj sentence (line 23) and the request window is now displayed completely.

Should this generate any other problem in other section? I will give it a try and let you know if something gets messed up.
if fact something got wrong... after I click on "Authorize" a page blank is displayed and nothing else happens... I checked again the errors and have a similar one [Thu Feb 24 09:35:33 2011] [error] [client 10.10.3.20] PHP Notice: Undefined index: object_type_id in /var/www/timetrex/classes/modules/core/AuthorizationFactory.class.php on line 208, referer: http://10.10.254.51/timetrex/interface/ ... php?id=182. If I perform the same thing the error gets somewhere else but basically is an error that starts from the first one.

Can yo give me a hand with this?

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Thu Feb 24, 2011 9:25 am

I don't recommend making changes to the code unless you are an experienced programmer and know exactly what you are doing.

The changes that you have already made will break things even more and possibly cause corruption problems that can be difficult or impossible to fix later.

I don't think the root cause of the problem is in that file. It almost appears that your database wasn't upgraded properly to begin with.

What database and version are you using?

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Thu Feb 24, 2011 9:29 am

shaunw wrote:I don't recommend making changes to the code unless you are an experienced programmer and know exactly what you are doing.

The changes that you have already made will break things even more and possibly cause corruption problems that can be difficult or impossible to fix later.

I don't think the root cause of the problem is in that file. It almost appears that your database wasn't upgraded properly to begin with.

What database and version are you using?
I removed all changes already. I am using MySQL version 5.1.41

shaunw
Posts: 7453
Joined: Tue Sep 19, 2006 2:22 pm

Re: Request window

Post by shaunw » Thu Feb 24, 2011 9:30 am

Checking your posts more closely, your ViewRequest.tpl file does not match the file included in the TimeTrex v3.4.0 .ZIP file. So it appears that when you upgraded TimeTrex you didn't do it properly and missed some files. Its possible that there are other files that were missed as well and it could cause you all sorts of problems.

I would recommend unzipping the TimeTrex v3.4.0 .ZIP file overtop of your existing TimeTrex directory and confirming that all files are overwritten properly. It may have been a permission problem, so it may be helpful to do this when logged in as root.

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Thu Feb 24, 2011 9:37 am

shaunw wrote:Checking your posts more closely, your ViewRequest.tpl file does not match the file included in the TimeTrex v3.4.0 .ZIP file. So it appears that when you upgraded TimeTrex you didn't do it properly and missed some files. Its possible that there are other files that were missed as well and it could cause you all sorts of problems.

I would recommend unzipping the TimeTrex v3.4.0 .ZIP file overtop of your existing TimeTrex directory and confirming that all files are overwritten properly. It may have been a permission problem, so it may be helpful to do this when logged in as root.
Performing this action. I will post the result in a moment

guanaco
Posts: 38
Joined: Wed Feb 23, 2011 12:42 pm

Re: Request window

Post by guanaco » Thu Feb 24, 2011 9:47 am

I really dont know what happened at the moment of upgrade since I have upgraded Timetrex several times already. I did what you asked and everything is working properly now.

I appreciate all your help team, you rock!

Locked