_internal_row++; $slot = array(); foreach ((preg_split('/,\s*/',$line,-1)) as $slotkey => $val) if (preg_match('/^element number\s+/',$val)) $slot['element'] = preg_replace('/^element number\s+/','',$val); elseif (preg_match('/^Slot\s+/',$val)) $slot['slot'] = preg_replace('/^Slot\s+/','',$val); elseif (preg_match('/^status\s+/',$val)) $slot['status'] = preg_replace('/^status\s+/','',$val); elseif (preg_match('/^barcode value /',"$1",$val); elseif (preg_match('/^barcode\s+/',$val)) $slot['barcode'] = preg_replace('/^barcode /','',$val); $slot['library'] = $library; $this->_rows[$this->_internal_row] = new Slot($slot); $start = TRUE; if (! $barcodewarn AND $slot['status'] == 'Allocated' AND $slot['barcode'] == 'not present') { SystemMessage::add(array( 'title'=>_('Missing Bar Code Labels'), 'type'=>'warning', 'body'=>sprintf(_('Some allocated slots do not have a bar code label, you may need to run "AUDIT LIBRARY %s CHECKLABEL=BARCODE"'),$library), )); $barcodewarn = TRUE; } } elseif (preg_match('/busy.$/',$line)) { SystemMessage::add(array( 'title'=>_('Library is Busy'), 'type'=>'info', 'body'=>_('The library appears busy at the moment.'), )); return; } elseif (preg_match('/:/',$line)) { $line = str_replace(' ','',$line); list($k,$v) = explode(':',$line,2); $this->data[$k] = $v; } else { } } } $this->_total_rows = $this->_internal_row; $this->_internal_row = 0; } public function __get($key) { if (isset($this->data[$key])) return $this->data[$key]; else return NULL; } } ?>