Skip to content

Commit d60d60c

Browse files
author
cap60552
committed
Updated more comments to include more data from the spec.
git-svn-id: http://php-sip2.googlecode.com/svn/trunk@9 ce44ba49-5d48-0410-be41-89220e6c249e
1 parent 250bd7b commit d60d60c

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

sip2.class.php

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
*
4747
* // connect to SIP server
4848
* $result = $mysip->connect();
49+
*
50+
* // selfcheck status mesage goes here...
51+
*
4952
*
5053
* // Get Charged Items Raw response
5154
* $in = $mysip->msgPatronInformation('charged');
@@ -98,6 +101,13 @@ class sip2 {
98101
private $retry = 0;
99102

100103
function msgSCStatus($status, $width, $version=2) {
104+
/* selfcheck status message, this should be sent immediatly after login */
105+
/* status codes, from the spec:
106+
* 0 SC unit is OK
107+
* 1 SC printer is out of paper
108+
* 2 SC is about to shut down
109+
*/
110+
101111
if ($version > 3) {
102112
$version = 2;
103113
}
@@ -188,7 +198,12 @@ function msgPatronInformation($type, $start="1", $end="5") {
188198
}
189199

190200
function msgHold($mode, $expDate='', $holdtype, $item, $title, $fee='N') {
191-
/* mode validity check */
201+
/* mode validity check */
202+
/*
203+
* - remove hold
204+
* + place hold
205+
* * modify hold
206+
*/
192207
if (strpos('-+*',$mode) === false) {
193208
/* not a valid mode - exit */
194209
$this->_debugmsg( "SIP2: Invalid hold mode: {$mode}");
@@ -197,12 +212,12 @@ function msgHold($mode, $expDate='', $holdtype, $item, $title, $fee='N') {
197212

198213
if ($holdtype < 1 || $holdtype > 9) {
199214
/*
200-
* Valid hold types range from 1 - 9
201-
* 1 other
202-
* 2 any copy of title
203-
* 3 specific copy
204-
* 4 any copy at a single branch or location
205-
*/
215+
* Valid hold types range from 1 - 9
216+
* 1 other
217+
* 2 any copy of title
218+
* 3 specific copy
219+
* 4 any copy at a single branch or location
220+
*/
206221
$this->_debugmsg( "SIP2: Invalid hold type code: {$holdtype}");
207222
return false;
208223
}
@@ -356,14 +371,14 @@ function parseEndSessionResponse ($response) {
356371
function _datestamp() {
357372
/* generate a SIP2 compatable datestamp */
358373
/* From the spec:
359-
* YYYYMMDDZZZZHHMMSS.
360-
* All dates and times are expressed according to the ANSI standard X3.30 for date and X3.43 for time.
361-
* The ZZZZ field should contain blanks (code $20) to represent local time. To represent universal time,
362-
* a Z character(code $5A) should be put in the last (right hand) position of the ZZZZ field.
363-
* To represent other time zones the appropriate character should be used; a Q character (code $51)
364-
* should be put in the last (right hand) position of the ZZZZ field to represent Atlantic Standard Time.
365-
* When possible local time is the preferred format.
366-
*/
374+
* YYYYMMDDZZZZHHMMSS.
375+
* All dates and times are expressed according to the ANSI standard X3.30 for date and X3.43 for time.
376+
* The ZZZZ field should contain blanks (code $20) to represent local time. To represent universal time,
377+
* a Z character(code $5A) should be put in the last (right hand) position of the ZZZZ field.
378+
* To represent other time zones the appropriate character should be used; a Q character (code $51)
379+
* should be put in the last (right hand) position of the ZZZZ field to represent Atlantic Standard Time.
380+
* When possible local time is the preferred format.
381+
*/
367382
return date('Ymd His');
368383
}
369384

@@ -375,8 +390,8 @@ function _parsevariabledata($response, $start) {
375390
$field = substr($item,0,2);
376391
$value = substr($item,2);
377392
/* SD returns some odd values on ocassion, Unable to locate the purpose in spec, so I strip from
378-
* the parsed array. Orig values will remain in ['raw'] element
379-
*/
393+
* the parsed array. Orig values will remain in ['raw'] element
394+
*/
380395
$clean = trim($value, "\x00..\x1F");
381396
if (trim($clean) <> '') {
382397
$result[$field][] = $clean;

0 commit comments

Comments
 (0)