CORE POS - IS4C
The CORE POS front end
Static Public Member Functions | List of all members
DisplayLib Class Reference
Inheritance diagram for DisplayLib:
LibraryClass

Static Public Member Functions

static printfooter ($readOnly=False)
 
static plainmsg ($strmsg)
 
static msgbox ($strmsg, $icon, $noBeep=false, $buttons=array())
 
static xboxMsg ($strmsg, $buttons=array())
 
static boxMsg ($strmsg, $header="", $noBeep=false, $buttons=array())
 
static inputUnknown ()
 
static standardClearButton ()
 
static printheaderb ()
 
static printItem ($field2, $field3, $total, $field5, $trans_id=-1)
 
static printItemColor ($color, $description, $comments, $total, $suffix, $trans_id=-1)
 
static printItemColorHilite ($color, $description, $comments, $total, $suffix)
 
static scaledisplaymsg ($input="")
 
static termdisplaymsg ()
 
static drawNotifications ()
 
static listItems ($top_item, $highlight)
 
static printReceiptfooter ($readOnly=False)
 
static drawItems ($top_item, $rows, $highlight)
 
static lastpage ($readOnly=False)
 
static screenDisplay ($min, $max)
 
static touchScreenScrollButtons ($selector='#search')
 

Detailed Description

Functions for drawing display elements

Member Function Documentation

static DisplayLib::boxMsg (   $strmsg,
  $header = "",
  $noBeep = false,
  $buttons = array() 
)
static

Get a centered message box with "exclaimC" graphic

Parameters
$strmsgthe message
$headertitle for the box
$noBeepdon't beep scale
$buttonssee msgbox()
Returns
An HTML string

An alias for msgbox().

Examples:
HelloWorld.php, and HW_Parser.php.
static DisplayLib::drawItems (   $top_item,
  $rows,
  $highlight 
)
static

Get the currently displayed items

Parameters
$top_itemis the trans_id of the first item to display
$rowsis the number of items to display
$highlightis the trans_id of the selected item
Returns
An HTML string

This function probably shouldn't be used directly. Call listitems() or lastpage() instead.

30Oct2014 Andy Idea here is to look up the currently displayed items and perform any necessary transformations of the text in PHP instead of tucking that logic inside the screendisplay view. I'm leaving the query above for reference in case I screwed something up and the old method of drawing the screen needs to be quickly re-enabled.

14Nov2014 Andy Disabled for the sake of putting together a release. Will go into testing following the release and be included in the next one

03Dec2014 Andy Axing screen display isn't a super high priority right now With better unit testing in place, I want to write more tests to verify this method behaves the same as the screendisplay via. No ETA at this point.

11Mar14 Andy Ancient idea about displaying transaction line-items on credit card terminal screen. Current terminal does not even support this functionality.

I'm leaving the "get last relevant line" implementation for reference. if (is_object($td) && !empty($last_item)) { $due = sprintf('%.2f',CoreLocal::get("amtdue")); $dueline = 'Subtotal' .str_pad('',22-strlen($due),' ') .$due; $items = ""; $count = 0; for($i=count($last_item)-1;$i>=0;$i–) { $items = ":".$last_item[$i].$items; $count++; if ($count >= 3) break; } for($i=$count;$i<3;$i++) { $items = ": ".$items; } $td->WriteToScale("display:".$last_item.":".$dueline); }

static DisplayLib::drawNotifications ( )
static

Use the right side of the screen to show various notifications

static DisplayLib::inputUnknown ( )
static

Get a centered message box with input unknown message.

Returns
An HTML string

An alias for msgbox().

static DisplayLib::lastpage (   $readOnly = False)
static

Get the currently displayed items

Parameters
$readOnlydon't update session
Returns
An HTML string

This will always display the most recently scanned items. If you want a specific subset, use listitems().

static DisplayLib::listItems (   $top_item,
  $highlight 
)
static

Get the items currently on screen

Parameters
$top_itemis trans_id (localtemptrans) of the first item to display
$highlightis the trans_id (localtemptrans) of the currently selected item
Returns
An HTML string

If you just want to show the most recently scanned items, use lastpage().

static DisplayLib::msgbox (   $strmsg,
  $icon,
  $noBeep = false,
  $buttons = array() 
)
static

Get a centered message box

Parameters
$strmsgthe message
$icongraphic icon file
$noBeepdon't send a scale beep
$buttonskeyed array of touchable/clickable buttons
  • key is the text shown on the button
  • value is javascript executed onclick
Returns
An HTML string

This function will include the header printheaderb().

static DisplayLib::plainmsg (   $strmsg)
static

Wrap a message in a id="plainmsg" div

Parameters
$strmsgthe message
Returns
An HTML string
static DisplayLib::printfooter (   $readOnly = False)
static

Get the standard footer with total and amount(s) saved

Parameters
$readOnlydon't update any session info This would be set when rendering a separate, different customer display
Returns
A string of HTML
static DisplayLib::printheaderb ( )
static

Get the standard header row with CASHIER and MEMBER info

Returns
An HTML string
static DisplayLib::printItem (   $field2,
  $field3,
  $total,
  $field5,
  $trans_id = -1 
)
static

Get a transaction line item

Parameters
$field2typically description
$field3comment section. Used for things like "0.59@1.99" on weight items.
$totalthe right-hand number
$field5flags after the number
$trans_idvalue from localtemptrans. Including the trans_id makes the lines selectable via mouseclick (or touchscreen).
Returns
An HTML string
static DisplayLib::printItemColor (   $color,
  $description,
  $comments,
  $total,
  $suffix,
  $trans_id = -1 
)
static

Get a transaction line item in a specific color

Parameters
$coloris a hex color code (do not include a '#') (see CSS notes)
$descriptiontypically description
$commentscomment section. Used for things like "0.59@1.99" on weight items.
$totalthe right-hand number
$suffixflags after the number
$trans_idvalue from localtemptrans. Including the trans_id makes the lines selectable via mouseclick (or touchscreen).
Returns
An HTML string

CSS Notes: In an effort to replace hard-coded colors, some values are re-written as CSS classes rather than inline styles. Current mapping:

  • 004080 => coloredText
  • 408080 => lightColorText
  • 000000 => totalLine
  • 800080 => fsLine
static DisplayLib::printItemColorHilite (   $color,
  $description,
  $comments,
  $total,
  $suffix 
)
static

Get a transaction line item in a specific color

Parameters
$coloris a hex color code (do not include a '#') (see CSS notes)
$descriptiontypically description
$commentscomment section. Used for things like "0.59@1.99" on weight items.
$totalthe right-hand number
$suffixflags after the number
Returns
An HTML string

CSS Notes: In an effort to replace hard-coded colors, some values are re-written as CSS classes rather than inline styles. Current mapping:

  • 004080 => coloredArea
  • 408080 => lightColorArea
  • 000000 => totalArea
  • 800080 => fsArea
static DisplayLib::printReceiptfooter (   $readOnly = False)
static

Show some items and farewell message

Parameters
$readOnlydon't update totals
Returns
An HTML string

Show a few recent items and the "Thank you for shopping" messaging.

Yes, this function should be renamed. It has nothing to do with receipts.

static DisplayLib::scaledisplaymsg (   $input = "")
static

Get the scale display box

Parameters
$inputmessage from scale
Returns
An HTML string

If $input is specified, weight information in the session gets updated before returning the current value.

Known input values are:

  • S11WWWW where WWWW is weight in hundreths (i.e., 1lb = 0100)
  • S141 not settled on a weight yet
  • S143 zero weight
  • S145 an error condition
  • S142 an error condition
static DisplayLib::screenDisplay (   $min,
  $max 
)
static

Select items from the transaction with formatting for on screen display

Parameters
$min[int] minimum localtemptrans.trans_id
$max[int] maximum localtemtprans.trans_id
Returns
array of records

Each record contains the following keys:

  • description
  • comment
  • total
  • status
  • discounttype
  • trans_status
  • trans_type
  • voided
  • trans_id

Note: the outer array is indexed by localtemptrans.trans_id instead of zero through array.length.

static DisplayLib::termdisplaymsg ( )
static

Display CC terminal state

Returns
HTML string
static DisplayLib::xboxMsg (   $strmsg,
  $buttons = array() 
)
static

Get a centered message box with "crossD" graphic

Parameters
$strmsgthe message
$buttonssee msgbox()
Returns
An HTML string

An alias for msgbox().


The documentation for this class was generated from the following file: