Page 1 of 1

Request window

Posted: Wed Feb 23, 2011 12:47 pm
by guanaco
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

Re: Request window

Posted: Wed Feb 23, 2011 1:43 pm
by shaunw
No such version (v4.2.0) of TimeTrex exists, what version are you really using? Also what version did you upgrade from?

Re: Request window

Posted: Wed Feb 23, 2011 1:47 pm
by guanaco
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

Re: Request window

Posted: Wed Feb 23, 2011 1:50 pm
by shaunw
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?

Re: Request window

Posted: Wed Feb 23, 2011 2:40 pm
by guanaco
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.

Re: Request window

Posted: Wed Feb 23, 2011 3:11 pm
by noamparn
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?

Re: Request window

Posted: Wed Feb 23, 2011 3:16 pm
by guanaco
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.

Re: Request window

Posted: Wed Feb 23, 2011 3:27 pm
by shaunw
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?

Re: Request window

Posted: Wed Feb 23, 2011 3:33 pm
by guanaco
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

Re: Request window

Posted: Wed Feb 23, 2011 3:44 pm
by shaunw
Is this happening for all requests, even requests submitted after the upgrade to v3.4.0?

Re: Request window

Posted: Wed Feb 23, 2011 3:47 pm
by guanaco
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

Re: Request window

Posted: Wed Feb 23, 2011 3:48 pm
by shaunw
When viewing the request, can you please view the HTML source and attach the entire source here.

Re: Request window

Posted: Wed Feb 23, 2011 3:54 pm
by guanaco
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"} *}

Re: Request window

Posted: Wed Feb 23, 2011 5:15 pm
by noamparn
Have you tried clearing your TimeTrex cache, as well as your browser cache?

Re: Request window

Posted: Wed Feb 23, 2011 5:19 pm
by guanaco
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.

Re: Request window

Posted: Wed Feb 23, 2011 6:00 pm
by shaunw
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?

Re: Request window

Posted: Wed Feb 23, 2011 6:06 pm
by guanaco
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

Re: Request window

Posted: Thu Feb 24, 2011 8:31 am
by guanaco
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.

Re: Request window

Posted: Thu Feb 24, 2011 9:03 am
by guanaco
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?

Re: Request window

Posted: Thu Feb 24, 2011 9:25 am
by shaunw
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?

Re: Request window

Posted: Thu Feb 24, 2011 9:29 am
by guanaco
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

Re: Request window

Posted: Thu Feb 24, 2011 9:30 am
by shaunw
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.

Re: Request window

Posted: Thu Feb 24, 2011 9:37 am
by guanaco
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

Re: Request window

Posted: Thu Feb 24, 2011 9:47 am
by guanaco
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!