<<

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 =over 4 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. =return

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.

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>

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 263:

You forgot a '=back' before '=head2'

Around line 570:

'=item' outside of any '=over'

Around line 803:

Unknown directive: =head

Around line 805:

=over should be: '=over' or '=over positive_number'

You can't have =items (as at line 1281) unless the first thing after the =over is an =item

Around line 862:

Unknown directive: =head

Around line 1651:

You forgot a '=back' before '=head1'

<<