Board Logo

More installation problems
SFDonovan - 9/2/2008 at 02:56 PM

I am using the popular PHPNuke and trying to get this working in a custom module. I use the custom_header.php to house all my javascript calls.

The header function has the following:

Code:

if (file_exists("includes/custom_files/custom_header.php")) {
include_once("includes/custom_files/custom_header.php");
}


header() is called each time the page loads

In custom_header I have:

Code:

<script language="javascript" src="includes/calendar3.js"></script>


I am trying to do some popup timestamp to allow the start and end time of a student peer evaluation. We only give them 3 to 5 days to complete the evaluation on their teammates and I want to use the popup to define the two dates.

My form starts with this:

Code:

echo "<form name = 'editcourse' method='post' action='".$admin_file.".php'>n";

...


and then I have where I enable the evaluations and give them a timesptamp using the calendars.

Code:

echo "<tr><td bgcolor='$bgcolor2'>Enable Peer Evals: </td>n";
if ($PE_Enabled == 'Yes') {
echo "<td><input type="radio" name="PE_Enabled" value="Yes"checked>Yes";
echo "<input type="radio" name="PE_Enabled" value="No">No<br></td></tr>n";
} else {
echo "<td><input type="radio" name="PE_Enabled" value="Yes">Yes";
echo "<input type="radio" name="PE_Enabled" value="No" checked>No<br></td></tr>n";
}

echo "<tr><td bgcolor='$bgcolor2'>Peer Eval Date & Time: </td>n";
echo "<td> From: <input type="text" name="PE_start_time" id="PE_start_time" value="" size="16" maxlength="19" />";
echo "<a href="javascript:cal1.popup();"><img src="modules/$modname/images/icon_calendar.gif" width="16" height="16" border="0" alt="Select date"></a>&nbsp;";
echo"To: <input type="text" name="PE_stop_time" id="PE_stop_time" value="" size="16" maxlength="19" />";
echo"<a href="javascript:cal1.popup();"><img src="modules/$modname/images/icon_calendar.gif" width="16" height="16" border="0" alt="Select date"></a><br />";
echo"</td></tr>n";


I them close the form

Code:

echo "</form>n";
?>
<script language="JavaScript"><!-- Date only with year scrolling -->
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal1 = new calendar1(document.forms['editcourse'].elements['PE_start_time']);
cal1.year_scroll = false;
cal1.time_comp = true;
var cal2 = new calendar1(document.forms['editcourse'].elements['PE_stop_time']);
cal2.year_scroll = false;
cal2.time_comp = true;
//-->
</script>


Looks pretty but no popup. I have the calendar.html in the includes folder as well as the modules/Team_Learning/admin folder.

Any help is appreciated.


tigra - 9/2/2008 at 03:08 PM

Most likely the paths issue.
View source of the resulting page to see that the calendar code is there.
Enable and view the javascript errors reporting to get the idea of what's happening.


SFDonovan - 9/2/2008 at 03:39 PM

Yes I see this in the "view source"

I use another popup calendar "Xin's Popup" that works fine on another page, but I want one with the time as well.



Code:

<head>
<script language="javascript" src="includes/cal2.js">
/*
Xin's Popup calendar script- Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="includes/cal_conf2.js"></script>
<script language="javascript" src="includes/calendar3.js"></script>

<script type="text/javascript">
//<![CDATA[
function add_points() {
var selectBox = document.getElementsByTagName('select');
var total = 0;
for(i=0; i<selectBox.length; i++) {
total += Number(selectBox.options[selectBox.selectedIndex].value);
}
document.getElementById('sum_points').innerHTML = 'Total Points: ' + total;
}
function check_form() {
var tp = document.getElementById('check_points').value;
var tc = document.getElementById('comments').value;
var selectBox = document.getElementsByTagName('select');
var total = 0;
for(i=0; i<selectBox.length; i++) {
total += Number(selectBox.options[selectBox.selectedIndex].value);
}
var error = 0;
for(a=0; a<tc; a++) {
if (document.getElementById('comm_'+a).value == '') {
error = 1;
}
}
var message = '';
if (total != tp) {
message = 'Total Points must equal '+tp;
} else if (error == 1) {
message = 'Feedback is required for each team member';
}
if (message) {
alert(message);
return false;
} else {
return true;
}
return false;
}
//]]>
</script>


</head>


How do I "Enable and view the javascript errors reporting"?


tigra - 9/2/2008 at 04:27 PM

There is a slight chance of the namespace conflict with the other calendar.
Also I only see link to calendar3.js but not the calendar icon and initialization code (those should be in the body)


SFDonovan - 9/2/2008 at 04:36 PM

Here is the whole thing.

Code:


<html>
<head>
<script language="javascript" src="includes/cal2.js">
/*
Xin's Popup calendar script- Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="includes/cal_conf2.js"></script>
<script language="javascript" src="includes/calendar3.js"></script>

<script type="text/javascript">
//<![CDATA[
function add_points() {
var selectBox = document.getElementsByTagName('select');
var total = 0;
for(i=0; i<selectBox.length; i++) {
total += Number(selectBox.options[selectBox.selectedIndex].value);
}
document.getElementById('sum_points').innerHTML = 'Total Points: ' + total;
}
function check_form() {
var tp = document.getElementById('check_points').value;
var tc = document.getElementById('comments').value;
var selectBox = document.getElementsByTagName('select');
var total = 0;
for(i=0; i<selectBox.length; i++) {
total += Number(selectBox.options[selectBox.selectedIndex].value);
}
var error = 0;
for(a=0; a<tc; a++) {
if (document.getElementById('comm_'+a).value == '') {
error = 1;
}
}
var message = '';
if (total != tp) {
message = 'Total Points must equal '+tp;
} else if (error == 1) {
message = 'Feedback is required for each team member';
}
if (message) {
alert(message);
return false;
} else {
return true;
}
return false;
}
//]]>
</script>


</head>
</html><body bgcolor="#F6F6EB"><table border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#ffffff">
<tr>
<td align="center"><a href="index.php"><img src="themes/Sand_Journey/images/logo.gif" alt="Welcome to the Boonshoft School of Medicine Academic Team Learning Assessment System" title="Welcome to the Boonshoft School of Medicine Academic Team Learning Assessment System" border="0" /></a></td>
</tr>
</table><table border="0 cellpadding="4" cellspacing="0" width="100%" align="center">
<tr><td bgcolor="#D8D8C4" align="left" width="20%">&nbsp;</td><td bgcolor="#D8D8C4" align="right" width="20%"><b><script type="text/javascript">

<!-- // Array ofmonth Names
var monthNames = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
thisYear = now.getYear();
if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem
document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + thisYear);
// -->

</script></b>&nbsp;
</td></tr>
<tr><td valign="top" width="100%" colspan=3>
<br><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="150" bgcolor=#F6F6EB><table border="0" cellspacing="0" cellpadding="0" width="150" bgcolor="#B7B78B">
<tr><td>

<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr><td bgcolor=#D8D8C4><font class="boxtitle">Menu</font></td></tr><tr><td bgcolor="#F6F6EB"><font size="2"><strong><big>&middot;</big></strong>&nbsp;<a href="index.php">Home</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Your_Account">Student Login</a><br>
</font></td></tr></table></td></tr></table><br><table border="0" cellspacing="0" cellpadding="0" width="150" bgcolor="#B7B78B">
<tr><td>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr><td bgcolor=#D8D8C4><font class="boxtitle">Administration</font></td></tr><tr><td bgcolor="#F6F6EB"><font size="2"><strong><big>?</big></strong> <a href="admin.php">Administration</a><br>
<strong><big>?</big></strong> <a href="admin.php?op=logout">Logout</a></font></td></tr></table></td></tr></table><br><tab le border="0" cellspacing="0" cellpadding="0" width="150" bgcolor="#B7B78B">

<tr><td>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr><td bgcolor=#D8D8C4><font class="boxtitle">Administration Login</font></td></tr><tr><td bgcolor="#F6F6EB"><font size="2"><form action="admin.php" method="post"><table border="0"><tr><td><input type="hidden" NAME="op" value="login"><input type="submit" VALUE="Login"></td></tr></table></form></font></td></tr></table></td></tr></table& gt;<br><img src="images/pix.gif" border="0" width="150" height="1"></td><td>&nbsp;&nbsp;</td><td width="100%" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D8D8C4"><tr><td>
<table width="100%" border="0" cellspacing="1" cellpadding="8" bgcolor="#F6F6EB"><tr><td>
<tr><td align='center' valign='top' width='100%' class='title'><b>TL Administration</b></center></td></tr><br />
<table border='1' align='center' width='100%' cellpadding='2' cellspacing='0'>
<tr bgcolor='#D8D8C4'>
<td align='center' valign='top' width='15%'>&nbsp;<b><u>General</u></b>&nbsp;</td>
<td align='center' valign='top' width='15%'>&nbsp;<b><u>Students</u></b>&nbsp;</td>
<td align='center' valign='top' width='15%'>&nbsp;<b><u>Courses/Directors</u></b>&nbsp;</td>
<td align='center' valign='top' width='15%'>&nbsp;<b><u>Groups</u></b>&nbsp;</td>

<td align='center' valign='top' width='15%'>&nbsp;<b><u>Grades</u></b>&nbsp;</td>
<td align='center' valign='top' width='15%'>&nbsp;<b><u>Y2 Peer Evaluations</u></b>&nbsp;</td>
</tr>
<tr>
<td align='center' valign='top' width='15%' rowspan='3'>
&nbsp;<a href='admin.php?op=TLConfigure'>Settings</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLAppliedWeights'>Weighted Values</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLReports'>Reports</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLAuditList'>Audit</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLAnnounce'>Announcement</a>&nbsp;<br />

</td>
<td align='center' valign='top' width='15%' rowspan='3'>
&nbsp;<a href='admin.php?op=TLStudentList'>Student List</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLImportStudents'>Import Students</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLStudentAdd'>Add Student</a>&nbsp;<br />
</td>
<td align='center' valign='top' width='15%' rowspan='3'>
&nbsp;<a href='admin.php?op=TLCourseList'>Course List</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLDirectorList'>Course Directors List</a>&nbsp;<br />
</td>
<td align='center' valign='top' width='15%' rowspan='3'>
&nbsp;<a href='admin.php?op=TLGroupList'>List Groups</a>&nbsp;<br />

&nbsp;<a href='admin.php?op=TLGroupAdd'>Add Groups</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLGroupArchive'>Archive Groups</a>&nbsp;<br />
</td>
<td align='center' valign='top' width='15%'>&nbsp;<a href='admin.php?op=TLPendingGrades'>Pending Grades</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLGrades'>Grades</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLCourseGrades'>Course Grades</a>&nbsp;<br />
&nbsp;&nbsp;<br />
</td>
<td align='center' valign='top' width='15%'>&nbsp;<a href='admin.php?op=TLM2EvalSettings'>Settings</a>&nbsp;<br />
&nbsp;<a href='admin.php?op=TLM2PendingEvals'>Pending</a>&nbsp;<br />

&nbsp;<a href='admin.php?op=TLM2EvalList'>Received</a>&nbsp;<br />
&nbsp;&nbsp;<br />
</td>
</tr>
</table>
</td></tr></table></td></tr></table>
<br />
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D8D8C4"><tr><td>
<table width="100%" border="0" cellspacing="1" cellpadding="8" bgcolor="#F6F6EB"><tr><td>
<table align='center' border='0' cellpadding='2' cellspacing='2'>
<form name = 'editcourse' method='post' action='admin.php'>
<input type='hidden' name='op' value='TLCourseUpdate'>
<tr><td bgcolor='#D8D8C4'>Course Name:</td>
<td><input type='text' name='Course_Name' size='30' value="Human Structure"></td></tr>
<tr><td bgcolor='#D8D8C4'>Course Number:</td>

<td><input type='text' name='Course_Number' size='30' value="510"></td></tr>
<tr><td bgcolor='#D8D8C4'>Course Year:</td>
<td><input type='text' name='Course_Year' size='30' value="1"></td></tr>
<tr><td bgcolor='#D8D8C4'>Use Peer Evals:</td>
<td><input type="radio" name="Peer_Eval" value="Yes"checked>Yes<input type="radio" name="Peer_Eval" value="No">No<br></td></tr>
<tr><td bgcolor='#D8D8C4'>Enable Peer Evals: </td>
<td><input type="radio" name="PE_Enabled" value="Yes"checked>Yes<input type="radio" name="PE_Enabled" value="No">No<br></td></tr>
<tr><td bgcolor='#D8D8C4'>Peer Eval Date & Time: </td>

<td> From: <input type="text" name="PE_start_time" id="PE_start_time" value="" size="16" maxlength="19" /><a href="javascript:cal1.popup();"><img src="modules/Team_Learning/images/icon_calendar.gif" width="16" height="16" border="0" alt="Select date"></a>&nbsp;To: <input type="text" name="PE_stop_time" id="PE_stop_time" value="" size="16" maxlength="19" /><a href="javascript:cal1.popup();"><img src="modules/Team_Learning/images/icon_calendar.gif" width="16" height="16" border="0" alt="Select date"></a><br /></td></tr>
<tr><td bgcolor='#D8D8C4'>Term:</td>
<td><input type="radio" name="Term" value="1"checked>1<input type="radio" name="Term" value="2">2<input type="radio" name="Term" value="both">Both<br></td></tr><tr><td bgcolor='#D8D8C4'>Department:</td>
<td><input type='text' name='Department' size='30' value="SMD"></td></tr>
<tr><td bgcolor='#D8D8C4'>Course Director(s):</td>
<td><select name="Director[]" size="4" multiple"><option value="6" >Nancy Bigley</option><option value="2" >Bruce Binder</option><option value="10" >Laurel Elder</option><option value="8" >Timothy Janz</option><option value="3" >Gary Nieder</option><option value="4" >Daniel Organisciak</option><option value="7" >John Paietta</option><option value="5" >John Pearson</option><option value="9" >Larry Ream</option><option value="1" >Brenda Roman</option></select> (Control+Click) for multiple selections</td></tr><tr><td colspan='2' align='center'><input type='submit' value='Update Course'></td></tr>

</form>
<script language="JavaScript"><!-- Date only with year scrolling -->
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal1 = new calendar1(document.forms['editcourse'].elements['PE_start_time']);
cal1.year_scroll = false;
cal1.time_comp = true;
var cal2 = new calendar1(document.forms['editcourse'].elements['PE_stop_time']);
cal2.year_scroll = false;
cal2.time_comp = true;
//-->
</script>
</table>
</td></tr></table></td></tr></table>
</td></tr></table></td></tr></table><center><font class="footmsg">
<br>Page Generation: 0.03 Seconds<br>
</font>
</center></body>
</html>


tigra - 9/2/2008 at 05:11 PM

You link to calendar3.js (which has calendar3 defined) but initialize using calendar1.
There may be more problems with your setup, but they should all be reported by the browser's javascript console.
Make sure you have errors reporting enabled and include the text of the error message in your next posting.


SFDonovan - 9/2/2008 at 05:40 PM

I changed my initialization after my closing <form> to this

Code:

<script language="JavaScript"><!-- Date only with year scrolling -->
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal1 = new calendar3(document.forms['editcourse'].elements['PE_start_time']);
cal1.year_scroll = false;
cal1.time_comp = true;
var cal2 = new calendar3(document.forms['editcourse'].elements['PE_stop_time']);
cal2.year_scroll = false;
cal2.time_comp = true;
//-->
</script>


and now get a popup however it says:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author.....

It is probably this

Code:

var obj_calwindow = window.open(
'calendar.html?id='



if calendar.html must stay in the folder where it is called from and calendar3.js is in my includes how could I edit this to point it to the correct path?


The page TLCourseEdit.php resides in

$PATH = $_SERVER['DOCUMENT_ROOT'];

'$PATH/modules/Team_Learning/admin/calendar.html'

calendar3.js is a javascript file and I have very little experience editing those files.


tigra - 9/2/2008 at 05:50 PM

replace
'calendar.html
with whatever the correct web path to that file i.e.
'http://www.softcomplex.com/products/tigra_calendar/calendar.html

you may need to adjust the path to images too.


SFDonovan - 9/12/2008 at 01:09 PM

Changed it to this but still not working.

window.open(
'https://medudev.wright.edu/atlas/modules/Team_Learning/admin/calendar.html?id=' + this.id + '&s=' + this.dt_selected.valueOf


tigra - 9/12/2008 at 04:19 PM

Any error messages? That URL doesn't seem to be working.


SFDonovan - 9/12/2008 at 06:02 PM

It is fire-walled behind the university campus. No error message.


tigra - 9/12/2008 at 07:02 PM

I'll need to see the live code to help you with the issue.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/