def show(self, xfer): LucteriosEditor.show(self, xfer) obj_addr = xfer.get_components('address') xfer.tab = obj_addr.tab new_col = obj_addr.col xfer.move(obj_addr.tab, 1, 0) img_path = get_user_path( "contacts", "Image_%s.jpg" % self.item.abstractcontact_ptr_id) img = XferCompImage('logoimg') if exists(img_path): img.type = 'jpg' img.set_value(readimage_to_base64(img_path)) else: img.set_value( get_icon_path("lucterios.contacts/images/NoImage.png")) img.set_location(new_col, obj_addr.row, 1, 6) xfer.add_component(img) if WrapAction.is_permission(xfer.request, 'contacts.add_abstractcontact'): if (len(self.item.__class__.get_select_contact_type(False)) > 0): btn = XferCompButton('btn_promote') btn.set_location(new_col + 1, xfer.get_max_row() + 1, 4) btn.set_action(xfer.request, ObjectPromote.get_action( _('Promote'), "images/config.png"), modal=FORMTYPE_MODAL, close=CLOSE_YES, params={ 'modelname': xfer.model.get_long_name(), 'field_id': xfer.field_id }) xfer.add_component(btn) signal_and_lock.Signal.call_signal("show_contact", self.item, xfer)
def show(self, xfer): xfer.move_components('lbl_body', 0, 2) xfer.move_components('body', 0, 2) obj_recipients = xfer.get_components('recipients') new_recipients = XferCompGrid('recipient_list') new_recipients.set_location(obj_recipients.col, obj_recipients.row, obj_recipients.colspan) new_recipients.add_header("model", _('model')) new_recipients.add_header("filter", _('filter')) compid = 0 for model_title, filter_desc in self.item.recipients_description: new_recipients.set_value(compid, "model", model_title) new_recipients.set_value(compid, "filter", filter_desc) compid += 1 if compid > 0: nb_contact = len(self.item.get_contacts()) contact_nb = XferCompLabelForm('contact_nb') contact_nb.set_location(obj_recipients.col, obj_recipients.row + 1, obj_recipients.colspan) contact_nb.set_value(_("Message defined for %d contacts") % nb_contact) xfer.add_component(contact_nb) lbl = XferCompLabelForm('sep_body') lbl.set_location(obj_recipients.col - 1, obj_recipients.row + 2, 4) lbl.set_value("{[hr/]}") xfer.add_component(lbl) xfer.remove_component('recipients') new_recipients.add_action_notified(xfer, 'recipient_list') xfer.add_component(new_recipients) return LucteriosEditor.show(self, xfer)
def show(self, xfer): xfer.move_components('body', 0, 2) obj_recipients = xfer.get_components('recipients') new_recipients = XferCompGrid('recipient_list') new_recipients.tab = obj_recipients.tab new_recipients.set_location(obj_recipients.col, obj_recipients.row, obj_recipients.colspan) new_recipients.add_header("model", _('model')) new_recipients.add_header("filter", _('filter')) compid = 0 for model_title, filter_desc in self.item.recipients_description: new_recipients.set_value(compid, "model", model_title) new_recipients.set_value(compid, "filter", filter_desc) compid += 1 if compid == 0: xfer.remove_component('contact_nb') if not will_mail_send() or (len(self.item.get_contacts(False)) == 0): xfer.remove_component('contact_noemail') xfer.remove_component('recipients') new_recipients.add_action_notified(xfer, 'recipient_list') xfer.tab = new_recipients.tab xfer.add_component(new_recipients) old_documents = xfer.get_components('documents') xfer.remove_component('documents') new_documents = XferCompGrid('document') new_documents.tab = old_documents.tab new_documents.set_location(old_documents.col, old_documents.row, old_documents.colspan) new_documents.set_model(self.item.documents.all(), ["name", "description", "date_modification"], xfer) new_documents.add_action(xfer.request, DocumentShow.get_action( TITLE_EDIT, "images/show.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_SINGLE) if self.item.status == 0: new_documents.add_action(xfer.request, MessageRemoveDoc.get_action( _("Remove"), "images/delete.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_MULTI) new_documents.add_action(xfer.request, MessageInsertDoc.get_action( _("Insert"), "images/add.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_NONE) xfer.tab = new_documents.tab xfer.add_component(new_documents) return LucteriosEditor.show(self, xfer)
def show(self, xfer): obj_body = xfer.get_components('body') obj_body.value = "{[div style='border:1px solid black;background-color:#EEE;padding:5px;']}%s{[div]}" % obj_body.value xfer.move_components('body', 0, 2) obj_recipients = xfer.get_components('recipients') new_recipients = XferCompGrid('recipient_list') new_recipients.tab = obj_recipients.tab new_recipients.set_location(obj_recipients.col, obj_recipients.row, obj_recipients.colspan) new_recipients.add_header("model", _('model')) new_recipients.add_header("filter", _('filter')) compid = 0 for model_title, filter_desc in self.item.recipients_description: new_recipients.set_value(compid, "model", model_title) new_recipients.set_value(compid, "filter", filter_desc) compid += 1 if compid == 0: xfer.remove_component('contact_nb') if not will_mail_send() or (len(self.item.get_contacts(False)) == 0): xfer.remove_component('contact_noemail') xfer.remove_component('recipients') new_recipients.add_action_notified(xfer, 'recipient_list') xfer.tab = new_recipients.tab xfer.add_component(new_recipients) old_documents = xfer.get_components('attachments') xfer.remove_component('attachments') if xfer.item.is_dynamic: xfer.remove_component('__tab_3') xfer.remove_component('doc_in_link') xfer.remove_component('empty') else: new_documents = XferCompGrid('attachments') new_documents.tab = old_documents.tab new_documents.set_location(old_documents.col, old_documents.row, old_documents.colspan) new_documents.set_model(self.item.attachments.all(), ["name", "description", "date_modification"], xfer) new_documents.add_action(xfer.request, DocumentShow.get_action(TITLE_EDIT, "images/show.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_SINGLE) if self.item.status == 0: new_documents.add_action(xfer.request, MessageRemoveDoc.get_action(_("Remove"), "images/delete.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_MULTI) new_documents.add_action(xfer.request, MessageInsertDoc.get_action(_("Insert"), "images/add.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_NONE) xfer.tab = new_documents.tab xfer.add_component(new_documents) contact_nb = xfer.get_components('contact_nb') if (contact_nb is not None) and (self.item.nb_total > 0): xfer.tab = contact_nb.tab xfer.fill_from_model(contact_nb.col, contact_nb.row + 1, True, [((_('statistic'), 'statistic'),)]) return LucteriosEditor.show(self, xfer)
def show(self, xfer): LucteriosEditor.show(self, xfer) obj_addr = xfer.get_components('address') xfer.tab = obj_addr.tab new_col = obj_addr.col xfer.move(obj_addr.tab, 1, 0) img_path = get_user_path("contacts", "Image_%s.jpg" % self.item.abstractcontact_ptr_id) img = XferCompImage('logoimg') if exists(img_path): img.type = 'jpg' img.set_value(readimage_to_base64(img_path)) else: img.set_value(get_icon_path("lucterios.contacts/images/NoImage.png")) img.set_location(new_col, obj_addr.row, 1, 6) xfer.add_component(img) if WrapAction.is_permission(xfer.request, 'contacts.add_abstractcontact'): if (len(self.item.__class__.get_select_contact_type(False)) > 0): btn = XferCompButton('btn_promote') btn.set_location(new_col + 1, xfer.get_max_row() + 1, 4) btn.set_action(xfer.request, ObjectPromote.get_action(_('Promote'), "images/config.png"), modal=FORMTYPE_MODAL, close=CLOSE_YES, params={'modelname': xfer.model.get_long_name(), 'field_id': xfer.field_id}) xfer.add_component(btn) signal_and_lock.Signal.call_signal("show_contact", self.item, xfer)
def show(self, xfer): xfer.move_components('body', 0, 2) obj_recipients = xfer.get_components('recipients') new_recipients = XferCompGrid('recipient_list') new_recipients.tab = obj_recipients.tab new_recipients.set_location(obj_recipients.col, obj_recipients.row, obj_recipients.colspan) new_recipients.add_header("model", _('model')) new_recipients.add_header("filter", _('filter')) compid = 0 for model_title, filter_desc in self.item.recipients_description: new_recipients.set_value(compid, "model", model_title) new_recipients.set_value(compid, "filter", filter_desc) compid += 1 if compid == 0: xfer.remove_component('contact_nb') if not will_mail_send() or (len(self.item.get_contacts(False)) == 0): xfer.remove_component('contact_noemail') xfer.remove_component('recipients') new_recipients.add_action_notified(xfer, 'recipient_list') xfer.tab = new_recipients.tab xfer.add_component(new_recipients) old_documents = xfer.get_components('documents') xfer.remove_component('documents') new_documents = XferCompGrid('document') new_documents.tab = old_documents.tab new_documents.set_location(old_documents.col, old_documents.row, old_documents.colspan) new_documents.set_model(self.item.documents.all(), ["name", "description", "date_modification"], xfer) new_documents.add_action(xfer.request, DocumentShow.get_action(TITLE_EDIT, "images/show.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_SINGLE) if self.item.status == 0: new_documents.add_action(xfer.request, MessageRemoveDoc.get_action(_("Remove"), "images/delete.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_MULTI) new_documents.add_action(xfer.request, MessageInsertDoc.get_action(_("Insert"), "images/add.png"), modal=FORMTYPE_MODAL, close=CLOSE_NO, unique=SELECT_NONE) xfer.tab = new_documents.tab xfer.add_component(new_documents) return LucteriosEditor.show(self, xfer)