<< | Index | >>
Task
Update
def article_codes ...if(pdose = pac.dose)
cds.store(:article_dose, pdose.to_s)
end
Reboot
Run
ch.oddb> Exporter.new(self).export_fachinfo_yaml
Result
... article_codes: - :article_pcode: "880231" :article_size: 11 ml :article_ean13: "7680426940109" :article_dose: 396 mg/ml ...
Update
def self.decorate model ... #size_ean13s = codes.collect do |hash| [hash[:article_size], hash[:article_ean13]] end.compactsize_ean13s = codes.collect do |hash| [hash[:article_size], hash[:article_dose], hash[:article_ean13]] end.compact
unless size_ean13s.empty? chapter = Text::Chapter.new chapter.heading << 'Preisvergleich' size_ean13s.each do |size, dose, ean13| #chapter.add_paragraph Text::LinkedParagraph.new(href, model.title + " " + size.to_s + " " + ean13.to_s)chapter.add_paragraph Text::LinkedParagraph.new(href, model.title + " " + size.to_s + " " + dose.to_s)
Run
$ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml"
Result
Task
Update
def atc_class
if model = @session.app.atc_class(@session.user_input(:atc_code))
if @session.allowed?('edit', 'org.oddb.model.!atc_class.*')
State::Admin::AtcClass.new(@session, model)
else
State::Admin::TransparentLogin.new(@session, model)
end
end
end
EVENTS = [
...
:atc_class,
Access (twice, first login is required, second jump directly)
Result
Note
Updates
def edit(model, session=@session)
link = View::PointerLink.new(:code, model, session, self)
...
link.href = @lookandfeel._event_url(:atc_class, {:atc_code => model.code})
link
end
def edit(model, session=@session)
link = View::PointerLink.new(:code, model, session, self)
...
link.href = @lookandfeel._event_url(:atc_class, {:atc_code => model.code})
link
end
Commit
Task
For example
Update
def fachinfo if (iksnr = @session.user_input(:reg) || @session.user_input(:swissmedicnr)) && (reg = @session.app.registration(iksnr)) && fachinfo = reg.fachinfoif @session.allowed?('edit', fachinfo)
State::Drugs::RootFachinfo.new(@session, fachinfo)
else
State::Drugs::Fachinfo.new(@session, fachinfo)end
else Http404.new(@session, nil) end end
Access
Result
Updates
class FiChapterChooserLink < HtmlGrid::Link def init args = [:reg, @model.registrations.first.iksnr,
:chapter, @name, #:pointer, @model.pointer, ] unless(@session.user_input(:chapter) == @name.to_s) if(@model.pointer.skeleton == [:create]) self.href = @lookandfeel.event_url(:self, {:chapter => @name}) elseself.href = @lookandfeel._event_url(:fachinfo, args)
#self.href = @lookandfeel._event_url(:resolve, args) end end ...
Result
Note
Update
def add_change_log_item(email, chapter, language)
...
self.odba_store
end
Result
Commit
Replace Drunken pointer link
Update
def print if pointer = @session.user_input(:pointer) if((model = pointer.resolve(@session.app)) && (klass = resolve_state(pointer, :print))) klass.new(@session, model) endelsif iksnr = @session.user_input(:fachinfo) and reg = @session.app.registration(iksnr) and fi = reg.fachinfo
State::Drugs::FachinfoPrint.new(@session, fi)
end
end
STRINGS = [
:fachinfo,
class FiChapterChooser < HtmlGrid::Composite ...def print(model, session=@session, key=:print)
link = HtmlGrid::Link.new(key, model, session, self)
link.set_attribute('title', @lookandfeel.lookup(:print_title))
args = {
:fachinfo => model.registrations.first.iksnr,
}
link.href = @lookandfeel._event_url(:print, args)
link
end
Commit
Hypothesis
Update
def _migrate_to_utf8 queue, table, iconv, opts={} ... #_migrate_obj_to_utf8 obj, queue, table, iconv, optsobj = _migrate_obj_to_utf8 obj, queue, table, iconv, opts
... #obj.odba_store unless obj.odba_unsaved?obj.odba_store
def search_terms @name.force_encoding('utf-8')
Setup
Run
ruby193 -I ../oddb/lib bin/oddbd > log.dat 2>&1
ch.oddb> migrate_to_utf8
Result