Patch title: Release 85 bulk changes
Abstract:
File: /pliant/fullpliant/component.page
Key:
    Removed line
    Added line
module "/pliant/language/stream.pli"
module "computer.pli"

requires "browse_configuration"


title "Computer components"

para
  input "Search pattern: " (var Str pattern) noeol
  page button "Search"
    title "Search components database for '"+pattern+"'"
    if pattern:len>0
      each c computer_database:data:component
        part component
          each v c:variable
            if (v:category search pattern -1)<>(-1) or (v:instance search pattern -1)<>(-1) or (v:id search pattern -1)<>(-1) or (v:value search pattern -1)<>(-1)
              fixed (text keyof:c) ; eol
              leave component
          each inc c:include
            if (inc search pattern -1)<>(-1)
              fixed (text keyof:c) ; eol
              leave component
    else
      [You must fill the pattern field !]

table columns 3
  cell header
    [Component name]
  cell
    void
  cell
    void
  each c computer_database:data:component
    cell
      fixed (text keyof:c)
    cell
      page button "Edit"
        if not allowed:"administrator"
          read_only_mode := true
        read_only not allowed:"administrator"
        title "Component '"+keyof:c+"'"

        header "Description"
          input "Title: " c:title length 60
          text_input "Abstract: " c:abstract columns 60 rows 10

        header "Variables"
          table columns 8
            cell header [Line ID]
            cell header [Category]
            cell header [Instance]
            cell header [ID]
            cell header [Value]
            cell header [Label]
            cell header [Type]
            cell header [Length]
            each v c:variable
              cell
                fixed (text keyof:v)
              cell
                input "" v:category length 10
              cell
                input "" v:instance length 8
              cell
                input "" v:id length 16
              cell
                input "" v:value length 8
              cell
                input "" v:label
              cell
                input "" v:type length 12
              cell
                input "" v:length length 2
          if allowed:"administrator"
            input "Line ID: " (var Str vid) noeol
            button "Add a variable" noeol
              c:variable create vid
              reload_page
            button "Remove a variable"
              c:variable delete vid
              reload_page

        header "Include sub components"
          table columns 3
            cell header
              [Line ID]
            cell header
              [Component]
            cell void
            each i c:include
              cell
                fixed (text keyof:i)
              cell
                input "" i
              cell
                if (exists computer_database:data:component:i)
                  small (text  computer_database:data:component:i:abstract)
                else
                  highlight "not defined"
          if allowed:"administrator"
            input "Line ID: " (var Str iid) noeol
            button "Add an include" noeol
              c:include create iid
              reload_page
            button "Remove an include"
              c:include delete iid
              reload_page

        if allowed:"administrator"
          header "Action"
            button "Update"
              goto_backward

    cell
      text c:abstract

if allowed:"administrator"
  input "Component name: " (var Str cid) noeol
  button "Create the new component" noeol
    computer_database:data:component create cid
    reload_page
  button "Delete the component"
    computer_database:data:component delete cid
    reload_page