Procedura-LANGUSERDEFINEDFORMS

Parametry:

NázevPopisDatový typ
langidChar(2)
objidChar(10)

Návratové hodnoty:

NázevPopisDatový typ
idChar(10)
objversionInteger
clsidChar(26)
systemChar(1)
nameVarChar(200)
dataBinaryBlob(0)
createdby_idChar(10)
correctedby_idChar(10)
owner_idChar(10)
definitionidChar(26)
preferredChar(1)
hash
HashSHA1
VisibleFrom$DATEFloat(0, 0)
VisibleTo$DATEFloat(0, 0)

Tělo:

begin
  /* Tato procedura slouží k načítání lokalizovaných UDForm */
  if ((:langid = '') or (:langid is null))  then begin
    /* Pokud  neni langid zadano tak pozaduji UDForm v lokalnim jazuku tudi z tabulky UDForm*/
    if ((:objid = '') or (:objid is null))  then begin
      /* pokud neni zadano ani objid tak pozaduji vsechny UDForm */
      for
        select A.id, A.objversion, A.clsid, A.system, A.name, A.data, A.createdby_id, A.correctedby_id, A.owner_id, A.definitionid, A.preferred, A.hash, A.VisibleFrom$DATE, A.VisibleTo$DATE
        from userdefinedforms A
      into
        :id, :objversion, :clsid, :system, :name, :data, :createdby_id, :correctedby_id, :owner_id, :definitionid, :preferred, :hash, :VisibleFrom$DATE, :VisibleTo$DATE
      do suspend;
    end else begin
      /* Pokud zadam objid tak vybiram primo to jedno ID */
      for
        select A.id, A.objversion, A.clsid, A.system, A.name, A.data, A.createdby_id, A.correctedby_id, A.owner_id, A.definitionid, A.preferred, A.hash, A.VisibleFrom$DATE, A.VisibleTo$DATE
        from userdefinedforms A
        where A.ID = :objid
      into
        :id, :objversion, :clsid, :system, :name, :data, :createdby_id, :correctedby_id, :owner_id, :definitionid, :preferred, :hash, :VisibleFrom$DATE, :VisibleTo$DATE
      do suspend;
    end
  end else begin
    /* Zadal jsem langid */
    if ((objid = '') or (objid is null))  then begin
      /* objid jsem neposlal takze vsechno pro dany jazyk*/
      for
        select A.id, A.objversion, A.clsid, A.system, Coalesce(B.name, A.name), Coalesce(B.data, A.data), A.createdby_id, A.correctedby_id, A.owner_id, A.definitionid, A.preferred, A.hash, A.VisibleFrom$DATE, A.VisibleTo$DATE
        from userdefinedforms A
        left join sys$languserdefinedforms B on B.id = A.id and B.langid = :langid
      into
        :id, :objversion, :clsid, :system, :name, :data, :createdby_id, :correctedby_id, :owner_id, :definitionid, :preferred, :hash, :VisibleFrom$DATE, :VisibleTo$DATE
      do
        suspend;
    end else begin
    /* Zadal jsem langid i objid - budu nejdrive hledat id mezi lokalizovanymi UDForm a kdyz se nenajde tak ho vezmu z UDForm */
      for
        select A.id, A.objversion, A.clsid, A.system, Coalesce(B.name, A.name), Coalesce(B.data, A.data), A.createdby_id, A.correctedby_id, A.owner_id, A.definitionid, A.preferred, A.hash, A.VisibleFrom$DATE, A.VisibleTo$DATE
        from userdefinedforms A
        left join sys$languserdefinedforms B on B.id = A.id and B.langid = :langid
        where A.ID=:objid
      into
        :id, :objversion, :clsid, :system, :name, :data, :createdby_id, :correctedby_id, :owner_id, :definitionid, :preferred, :hash, :VisibleFrom$DATE, :VisibleTo$DATE
      do
        suspend;
    end
  end
end

Generated by ABRA Software a.s. 27.10.2021 16:34:16