pax_global_header 0000666 0000000 0000000 00000000064 12011157173 0014510 g ustar 00root root 0000000 0000000 52 comment=0280f02ae684f9dad3cf665c5ac00cc7489b8738
erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/ 0000775 0000000 0000000 00000000000 12011157173 0022415 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/ 0000775 0000000 0000000 00000000000 12011157173 0023107 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ 0000775 0000000 0000000 00000000000 12011157173 0025441 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/ 0000775 0000000 0000000 00000000000 12011157173 0031171 5 ustar 00root root 0000000 0000000 portal_types/ 0000775 0000000 0000000 00000000000 12011157173 0033637 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem Barcode%20Module/ 0000775 0000000 0000000 00000000000 12011157173 0036553 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/portal_types view.xml 0000664 0000000 0000000 00000004446 12011157173 0040257 0 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/portal_types/Barcode%20Module
-
action
AAAAAAAAAAI=
-
categories
action_type/object_view
-
category
object_view
-
condition
-
description
-
icon
-
id
view
-
permissions
View
-
priority
1.0
-
title
View
-
visible
1
-
text
string:${object_url}BarcodeModule_viewBarcodeList
Barcode/ 0000775 0000000 0000000 00000000000 12011157173 0035176 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/portal_types print_sheet.xml 0000664 0000000 0000000 00000004505 12011157173 0040250 0 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/portal_types/Barcode
-
action
AAAAAAAAAAI=
-
categories
action_type/object_print
-
category
object_print
-
condition
-
description
-
icon
-
id
print_sheet
-
permissions
View
-
priority
1.0
-
title
Print Barcode Spreadsheets
-
visible
1
-
text
string:${object_url}/Barcode_viewPrintSheetDialog
view.xml 0000664 0000000 0000000 00000004426 12011157173 0036700 0 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ActionTemplateItem/portal_types/Barcode
-
action
AAAAAAAAAAI=
-
categories
action_type/object_view
-
category
object_view
-
condition
-
description
-
icon
-
id
view
-
permissions
View
-
priority
1.0
-
title
View
-
visible
1
-
text
string:${object_url}/Barcode_view
ExtensionTemplateItem/ 0000775 0000000 0000000 00000000000 12011157173 0031651 5 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode Barcode.py 0000664 0000000 0000000 00000013436 12011157173 0033571 0 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ExtensionTemplateItem ##############################################################################
#
# Copyright (c) 2002-2008 Nexedi SA and Contributors. All Rights Reserved.
# Nicolas Delaby
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from string import zfill
from urllib import urlencode
import tempfile
from DateTime import DateTime
from zLOG import LOG
barcode = 'barcode'
ps2pdf = 'ps2pdf -sPAPERSIZE=a4'
lp = 'lp'
def escapeString(string):
#Barcode can accept only ASCII
string = str(unicode(str(string), 'utf-8'))
#Escape
string = string.replace('"', '\\"')
return string
def printBarcodeSheet(self, sheet_number=1, input_list=[], test=False):
unit = 'mm'
code = self.getCodingType() or 'code128'
row_number = self.getRowNumber() or 0
column_number = self.getColumnNumber() or 0
page_left_margin = self.getPageLeftMargin() or 10
page_bottom_margin = self.getPageBottomMargin() or 10
page_right_margin = self.getPageRightMargin() or 10
page_top_margin = self.getPageTopMargin() or 10
page_height = self.getPageHeight() or 210
page_width = self.getPageWidth() or 297
horizontal_padding = self.getHorizontalPadding() or 0
vertical_padding = self.getVerticalPadding() or 0
def getPdfOutput(self, ps_file_path, file_name='ReferenceSheet_%s' % DateTime().strftime('%d-%m-%Y_%Hh%M.pdf')):
#Return PS as PDF
suffix= '.pdf'
tempdir = tempfile.tempdir
tempfile.tempdir = '/tmp'
new_pdf_file_path = tempfile.mktemp(suffix)
tempfile.tempdir = tempdir
ps2pdf_command = '%s %s %s' % (ps2pdf, ps_file_path, new_pdf_file_path)
ret = os.system(ps2pdf_command)
if ret != 0:
raise RuntimeError, 'PS Conversion Failed'
file = open(new_pdf_file_path, 'rb')
result = file.read()
file_size = len(result)
file.close()
self.REQUEST.RESPONSE.setHeader('Content-Type', 'application/pdf')
self.REQUEST.RESPONSE.setHeader('Content-Length', file_size)
self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'inline; filename="%s"' % (file_name))
return result
suffix= '.txt'
tempdir = tempfile.tempdir
tempfile.tempdir = '/tmp'
new_txt_file_path = tempfile.mktemp(suffix)
tempfile.tempdir = tempdir
if test:
#Fake list
input_list = os.linesep.join(['TEST%s' % zfill(b, 8) for b in range(1111111, 1111111 + ( row_number * column_number * sheet_number ))])
elif input_list not in ('', None):
if not isinstance(input_list, list):
input_list = os.linesep.join(map(escapeString, input_list.split(os.linesep)))
else:
input_list = os.linesep.join(input_list)
else:
input_list = os.linesep.join(['%s' % zfill(self.portal_ids.generateNewId(id_group='barcode'), 12) for b in range( row_number * column_number * sheet_number )])
text_command = 'echo "%s" > %s' % (input_list, new_txt_file_path)
ret = os.system(text_command)
if ret != 0:
raise RuntimeError, 'File Creation Failed'
if horizontal_padding not in ('', None) and vertical_padding not in ('', None):
margin = '%sx%s' % (horizontal_padding, vertical_padding)
else:
margin = ''
if page_height not in ('', None) and page_width not in ('', None):
pagesize = '%sx%smm' % (page_width, page_height)
table_margin = []
if page_left_margin not in ('', None):
table_margin.append('+%s' % (page_left_margin))
if page_bottom_margin not in ('', None):
table_margin.append('+%s' % (page_bottom_margin))
else:
table_margin.append('+%s' % (page_left_margin))
if page_right_margin not in ('', None):
table_margin.append('-%s' % (page_right_margin))
if page_top_margin not in ('', None):
table_margin.append('-%s' % (page_top_margin))
argument_list = []
encoding = '-e %s' % (code)
argument_list.append(encoding)
for option, argument in (('-m', margin),
('-p', pagesize),
('-u', unit)):
if argument not in ('', None):
argument_list.append('%s %s'% (option, argument))
if row_number not in (0, None) and column_number not in (0, None):
argument_list.append('-t %sx%s%s' % (column_number, row_number,
''.join(table_margin)))
argument_list.append('-i %s' % (new_txt_file_path))
barcode_command = '%s %s' % (barcode, ' '.join(argument_list))
#Creation of ps file
suffix= '.ps'
tempdir = tempfile.tempdir
tempfile.tempdir = '/tmp'
new_ps_file_path = tempfile.mktemp(suffix)
tempfile.tempdir = tempdir
barcode_command += ' -o %s ' %(new_ps_file_path)
ret = os.system(barcode_command)
if ret != 0:
raise RuntimeError, 'Barcode PS File Creation Failed'
if test:
return getPdfOutput(self, new_ps_file_path, file_name='TestReferenceSheet.pdf')
return getPdfOutput(self, new_ps_file_path)
erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ModuleTemplateItem/ 0000775 0000000 0000000 00000000000 12011157173 0031201 5 ustar 00root root 0000000 0000000 barcode_module.xml 0000664 0000000 0000000 00000004522 12011157173 0034613 0 ustar 00root root 0000000 0000000 erp5-0280f02ae684f9dad3cf665c5ac00cc7489b8738-bt5-erp5_barcode/bt5/erp5_barcode/ModuleTemplateItem
barcode_module
Access Transient Objects
Assignee
Assignor
Associate
Auditor
Author
Manager
Access contents information
Assignee
Assignor
Associate
Auditor
Author
Manager
Access session data
Assignee
Assignor
Associate
Auditor
Author
Manager
Add portal content
Assignor
Author
Manager
Add portal folders
Assignor
Author
Manager
Change local roles
Assignor
Manager
Copy or Move
Assignee
Assignor
Associate
Auditor
Author
Manager
Delete objects
Assignor
Manager
List folder contents
Assignee
Assignor
Associate
Auditor
Author
Manager
Modify portal content
Assignor
Manager
View
Assignee
Assignor
Associate
Auditor
Manager
View History
Assignee
Assignor
Associate
Auditor
Author
Manager
Barcode Module
Barcodes