Ejemplo n.º 1
0
 function printFieldValue($name, $value = NULL)
 {
     if (is_null($value)) {
         $value = $this->values[$name];
     }
     if ($name == 'address_street' && MAP_LOOKUP_URL) {
         parent::printFieldValue($name, $value);
         if (!empty($value) && $value == $this->values['address_street']) {
             $url = MAP_LOOKUP_URL;
             foreach ($this->values as $k => $v) {
                 if (is_string($v)) {
                     $url = str_replace('__' . strtoupper($k) . '__', urlencode($v), $url);
                 }
             }
             print ' <a class="smallprint no-print map" href="' . $url . '">map</a>';
         }
     } else {
         parent::printFieldValue($name, $value);
     }
 }
Ejemplo n.º 2
0
 function printFieldValue($name, $value = NULL)
 {
     if ($name == 'members') {
         $this->printMemberList(array_get($this->_tmp, 'abbreviate_member_list', FALSE));
         return;
     }
     if (is_null($value)) {
         $value = $this->values[$name];
     }
     if ($name == 'address_street' && MAP_LOOKUP_URL) {
         parent::printFieldValue($name, $value);
         if (!empty($value) && $value == $this->values['address_street']) {
             $url = MAP_LOOKUP_URL;
             foreach ($this->values as $k => $v) {
                 if (is_string($v)) {
                     $url = str_replace('__' . strtoupper($k) . '__', urlencode($v), $url);
                 }
             }
             print ' <a class="smallprint no-print map" href="' . $url . '">map</a>';
         }
     } else {
         parent::printFieldValue($name, $value);
     }
 }
Ejemplo n.º 3
0
 function printFieldValue($fieldname, $value = NULL)
 {
     if (is_null($value)) {
         $value = $this->values[$fieldname];
     }
     switch ($fieldname) {
         case 'categoryid':
             if ($value == 0) {
                 echo '<i>(Uncategorised)</i>';
                 return;
             }
             // deliberate fall through
         // deliberate fall through
         default:
             return parent::printFieldValue($fieldname, $value);
     }
 }
Ejemplo n.º 4
0
 function printFieldValue($fieldname, $value = NULL)
 {
     if (is_null($value)) {
         $value = $this->values[$fieldname];
     }
     switch ($fieldname) {
         case 'attendance_recording_days':
             if ($value == 0) {
                 echo 'No';
                 return;
             }
             if ($value == 127) {
                 echo 'Yes, any day';
                 return;
             }
             return parent::printFieldValue($fieldname, $value);
             break;
         case 'categoryid':
             if ($value == 0) {
                 echo '<i>(Uncategorised)</i>';
                 return;
             }
             // deliberate fall through
         // deliberate fall through
         default:
             return parent::printFieldValue($fieldname, $value);
     }
 }
Ejemplo n.º 5
0
 public function printFieldValue($name)
 {
     switch ($name) {
         case 'congregationids':
             $congs = $GLOBALS['system']->getDBObjectData('congregation_service_component', array('componentid' => $this->id));
             $names = array();
             foreach ($congs as $cong) {
                 $names[] = $cong['name'];
             }
             echo ents(implode(', ', $names));
             break;
         case 'tags':
             $tags = $GLOBALS['system']->getDBObjectData('service_component_tagging', array('componentid' => $this->id));
             $names = array();
             foreach ($tags as $tag) {
                 echo '<span class="label">' . ents($tag['tag']) . '</span> ';
             }
             break;
         case 'ccli_number':
             if (defined('CCLI_DETAIL_URL')) {
                 // Can't just use class=med-popup because it's loaded in an AJAX frame so the window.onload has already run
                 echo '<a href="' . str_replace('__NUMBER__', $this->getValue($name), CCLI_DETAIL_URL) . '" onclick="return TBLib.handleMedPopupLinkClick(this)">';
             }
             echo $this->getValue($name);
             if (defined('CCLI_DETAIL_URL')) {
                 echo '</a>';
             }
             break;
         default:
             return parent::printFieldValue($name);
     }
 }