<<

NAME

C4::Labels - Functions for printing spine labels and barcodes in Koha

FUNCTIONS

get_label_options;

        $options = get_label_options()

Return a pointer on a hash list containing info from labels_conf table in Koha DB.

sub add_batch

 add_batch($batch_type,\@batch_list);
 if $batch_list is supplied,
   create a new batch with those items.
 else, return the next available batch_id.

GetAllPrinterProfiles;

    @profiles = GetAllPrinterProfiles()

Returns an array of references-to-hash, whos keys are .....

GetSinglePrinterProfile;

    $profile = GetSinglePrinterProfile()

Returns a hashref whos keys are...

SaveProfile;

    SaveProfile('parameters')

When passed a set of parameters, this function updates the given profile with the new parameters.

CreateProfile;

    CreateProfile('parameters')

When passed a set of parameters, this function creates a new profile containing those parameters and returns any errors.

DeleteProfile;

    DeleteProfile(prof_id)

When passed a profile id, this function deletes that profile from the database and returns any errors.

GetAssociatedProfile;

    $assoc_prof = GetAssociatedProfile(tmpl_id)

When passed a template id, this function returns the parameters from the currently associated printer profile in a hashref where key=fieldname and value=fieldvalue.

SetAssociatedProfile;

    SetAssociatedProfile($prof_id, $tmpl_id)

When passed both a profile id and template id, this function establishes an association between the two. No more than one profile may be associated with any given template at the same time.

GetLabelItems;

        $options = GetLabelItems()

Returns an array of references-to-hash, whos keys are the fields from the biblio, biblioitems, items and labels tables in the Koha database.

GetBarcodeData

Parse labels_conf.formatstring value (one value of the csv, which has already been split) and return string from koha tables or MARC record.

descKohaTables

Return a hashref of an array of hashes, with name,type keys.

build_circ_barcode;

  build_circ_barcode( $x_pos, $y_pos, $barcode,
                $barcodetype, \$item);

$item is the result of a previous call to GetLabelItems();

draw_boundaries

 sub draw_boundaries ($x_pos_spine, $x_pos_circ1, $x_pos_circ2,
                $y_pos, $spine_width, $label_height, $circ_width)  

This sub draws boundary lines where the label outlines are, to aid in printer testing, and debugging.

drawbox

        sub drawbox {   $lower_left_x, $lower_left_y, 
                        $upper_right_x, $upper_right_y )

this is a low level sub, that draws a pdf box, it is called by draw_boxes

FYI: the $upper_right_x and $upper_right_y values are RELATIVE to $lower_left_x and $lower_left_y

and $lower_left_x, $lower_left_y are ABSOLUTE, this caught me out!

AUTHOR

Mason James <mason@katipo.co.nz>

<<