| @@ -91,14 +91,25 @@ | ||
| 91 | 91 | <strong>to</strong> (__To Date__, YYYYMMDD / __To Date Time__, YYYYMMDDHHMM)<br> |
| 92 | 92 | <strong>status_id</strong> (publish, draft)<br> |
| 93 | 93 | </p> |
| 94 | 94 | |
| 95 | -<?php if( class_exists('SH4_CFields_Model') ) : ?> | |
| 96 | 95 | <?php |
| 97 | -$f = ShiftController4::$instance->root(); | |
| 98 | -$cfieldsQuery = $f->make('SH4_CFields_Query'); | |
| 99 | -$cfields = $cfieldsQuery->read(); | |
| 96 | +$cfields = array(); | |
| 100 | 97 | ?> |
| 98 | +<?php if( class_exists('SH4_CFields_Model') or class_exists('SH4_CFields2_Model') ) : ?> | |
| 99 | +<?php | |
| 100 | +$cfields = array(); | |
| 101 | +$f = null; | |
| 102 | +if (class_exists('ShiftController4Legacy_Pro')) { | |
| 103 | + $f = ShiftController4Legacy_Pro::$instance->root(); | |
| 104 | +} elseif (class_exists('ShiftController4')) { | |
| 105 | + $f = ShiftController4::$instance->root(); | |
| 106 | +} | |
| 107 | +if (null !== $f) { | |
| 108 | + $cfieldsQuery = $f->make('SH4_CFields_Query'); | |
| 109 | + $cfields = $cfieldsQuery->read(); | |
| 110 | +} | |
| 111 | +?> | |
| 101 | 112 | <?php if( $cfields ) : ?> |
| 102 | 113 | <p> |
| 103 | 114 | <strong>__Optional Arguments__</strong> |
| 104 | 115 | </p> |
| @@ -223,8 +234,11 @@ | ||
| 223 | 234 | <strong>start</strong> (__Start Date Time__, YYYYMMDDHHMM)<br> |
| 224 | 235 | <strong>end</strong> (__End Date Time__, YYYYMMDDHHMM)<br> |
| 225 | 236 | <strong>status_id</strong> (publish, draft)<br> |
| 226 | 237 | <strong>conflict</strong> (__Set to 1 to allow creation of shifts with conflicts__) <em>__optional__</em><br> |
| 238 | +<?php foreach( $cfields as $cfield ) : ?> | |
| 239 | +<strong><?php echo $cfield->getName(); ?></strong> (<?php echo $cfield->getLabel(); ?>)<br> | |
| 240 | +<?php endforeach; ?> | |
| 227 | 241 | </p> |
| 228 | 242 | |
| 229 | 243 | <p> |
| 230 | 244 | <strong>__Examples__</strong> |
| @@ -280,8 +294,11 @@ | ||
| 280 | 294 | <strong>start</strong> (__Start Date Time__, YYYYMMDDHHMM) <em>__optional__</em><br> |
| 281 | 295 | <strong>end</strong> (__End Date Time__, YYYYMMDDHHMM) <em>__optional__</em><br> |
| 282 | 296 | <strong>status_id</strong> (publish, draft) <em>__optional__</em><br> |
| 283 | 297 | <strong>conflict</strong> (__Set to 1 to allow creation of shifts with conflicts__) <em>__optional__</em><br> |
| 298 | +<?php foreach( $cfields as $cfield ) : ?> | |
| 299 | +<strong><?php echo $cfield->getName(); ?></strong> (<?php echo $cfield->getLabel(); ?>)<br> | |
| 300 | +<?php endforeach; ?> | |
| 284 | 301 | </p> |
| 285 | 302 | |
| 286 | 303 | <p> |
| 287 | 304 | <strong>__Examples__</strong> |