def print_forms(): # anything to do ? files2print = [] form_names = [] for form in forms: files2print.extend(form.final_output_filenames) form_names.append('%s (%s)' % (form.template['name_long'], form.template['external_version'])) if len(files2print) == 0: return True # print printed = gmPrinting.print_files(filenames=files2print, jobtype=jobtype) if not printed: gmGuiHelpers.gm_show_error(aMessage=_('Error printing documents.'), aTitle=_('Printing [%s]') % jobtype) return False soap_lines.append(_('Printed: %s') % ', '.join(form_names)) return True
def print_forms(): # anything to do ? files2print = [] form_names = [] for form in forms: files2print.extend(form.final_output_filenames) form_names.append(u'%s (%s)' % (form.template['name_long'], form.template['external_version'])) if len(files2print) == 0: return True # print printed = gmPrinting.print_files(filenames = files2print, jobtype = jobtype) if not printed: gmGuiHelpers.gm_show_error ( aMessage = _('Error printing documents.'), aTitle = _('Printing [%s]') % jobtype ) return False soap_lines.append(_('Printed: %s') % u', '.join(form_names)) return True
def _on_print_button_pressed(self, event): event.Skip() printouts = self._LCTRL_printouts.get_selected_item_data(only_one = False) if len(printouts) == 0: return files2print = [] for printout in printouts: files2print.append(printout.save_to_file()) if len(files2print) == 0: return jobtype = 'print_manager' printed = gmPrinting.print_files(filenames = files2print, jobtype = jobtype, verbose = _cfg.get(option = 'debug')) if not printed: gmGuiHelpers.gm_show_error ( aMessage = _('Error printing documents.'), aTitle = _('Printing [%s]') % jobtype ) return False return True
def _on_print_items_button_pressed(self, event): event.Skip() items = self._LCTRL_items.get_selected_item_data(only_one = False) if len(items) == 0: return files2print = [] for item in items: files2print.append(item.save_to_file()) if len(files2print) == 0: return jobtype = 'export_area' printed = gmPrinting.print_files(filenames = files2print, jobtype = jobtype, verbose = _cfg.get(option = 'debug')) if not printed: gmGuiHelpers.gm_show_error ( aMessage = _('Error printing documents.'), aTitle = _('Printing [%s]') % jobtype ) return False self.__save_soap_note(soap = _('Printed:\n - %s') % '\n - '.join([ i['description'] for i in items ])) return True