phpScheduleIt
May 22, 2013, 10:04:25 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: adding a default message in the Summary box  (Read 336 times)
runaway34
Newbie
*

Karma: 0
Posts: 36


« on: April 18, 2012, 07:17:58 PM »

I saw an old post about how to do this:

on May 11 2010, Nick wrote:

The easiest way to do this would be to add this after line 899 of templates/reserve.template.php:

if (empty($summary))
{
$summary = 'your standard text';
}


I can't get that to work.  Here is my code:

Line 898 <?php
   // adds a standard message in the Summary field
   if (empty($summary))
   {
   $summary = 'IMPORTANT ! clearly identify all people on the boat';
   }

   $is_owner = ($res->user->get_id() == Auth::getCurrentID());

   $type = $res->get_type();

am I missing something?   After the reservation has been saved, and I mouse over it, I notice that the reservers name is automatically added into this Summary box. Could that be causing the IF clause to fail?

Dave
« Last Edit: April 18, 2012, 07:23:20 PM by runaway34 » Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: April 23, 2012, 01:53:41 PM »

Here's the whole print_summary function:

Code:
function print_summary($summary, $type) {
if (empty($summary))
{
$summary = 'default stuff here';
}
?>
   <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr class="tableBorder">
     <td>
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
       <tr>
    <td class="cellColor"><h5 align="center"><?php echo translate('Summary')?></h5></td>
</tr>
<tr>
<td class="cellColor" style="text-align: left;">
<?php
if ($type == RES_TYPE_ADD || $type == RES_TYPE_MODIFY || $type == RES_TYPE_APPROVE) {
echo '<div style="text-align:center;" id="summary_div"><textarea class="textbox" name="summary" rows="3" cols="40">' $summary '</textarea></div>';
}
else {
echo (!empty($summary) ? CmnFns::html_activate_links($summary) : translate('N/A'));
}
?>

</td>
   </tr>
      </table>
     </td>
    </tr>
   </table>
<?php
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!