function printFieldValue($name, $value = NULL) { if (is_null($value)) { $value = $this->values[$name]; } if (in_array($name, array('assignee', 'action_date'))) { if ($value == 'no_action') { echo 'N/A'; return; } } if ($name == 'subject') { echo '<strong>' . $value . '</strong>'; return; } return parent::printFieldValue($name, $value); }
function printFieldValue($name, $value = null) { if (is_null($value)) { $value = $this->getValue($name); } switch ($name) { case 'name': echo ents($this->getValue('first_name')) . ' ' . ents($this->getValue('last_name')); return; case 'mobile_tel': if (!strlen($value)) { return; } echo ents($this->getFormattedValue($name, $value)); $smsLink = ''; if (SizeDetector::isNarrow()) { // Probably a phone - use a plain sms: link $smsLink = 'href="sms:' . ents($value) . '"'; } else { if (defined('SMS_HTTP_URL') && constant('SMS_HTTP_URL') && $GLOBALS['user_system']->havePerm(PERM_SENDSMS) && $_REQUEST['view'] == 'persons') { // Provide a link to send SMS through the SMS gateway ?> <div id="send-sms-modal" class="modal hide fade" role="dialog" aria-hidden="true"> <form method="post" action="?view=_send_sms_http"> <input type="hidden" name="personid" value="<?php echo $this->id; ?> " /> <div class="modal-header"> <h4>Send SMS to <?php $this->printFieldValue('name'); ?> </h4> </div> <div class="modal-body"> Message:<br /> <textarea autofocus="autofocus" name="message" class="span4" rows="5" cols="30" maxlength="<?php echo SMS_MAX_LENGTH; ?> "></textarea> </div> <div class="modal-footer"> <input type="submit" class="btn" value="Send" accesskey="s" onclick="if (!$('[name=message]').val()) { alert('Enter a message first'); return false; }" /> <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> </div> </form> </div> <?php $smsLink = 'href="#send-sms-modal" data-toggle="modal"'; } } ?> <span class="nowrap"> <a href="tel:<?php echo ents($value); ?> " class="btn btn-mini"><i class="icon-phone"></i></a> <?php if ($smsLink) { ?> <a <?php echo $smsLink; ?> class="btn btn-mini"><i class="icon-envelope"></i></a> <?php } ?> </span> <?php return; } parent::printFieldValue($name, $value); }