Пример #1
0
 def map(self, params):
     self._caption = params.get("caption", "")
     self._mandatory = params.has_key("mandatory")
     self._billable = params.has_key("billable")
     self._price = params.get("price", "")
     if params.get("addradioitem", "").strip() != "":
         ri = RadioItem(self._input)
         cap = params.get("newradioitem")
         if cap.strip() != "":
             ri.setCaption(params.get("newradioitem"))
             ri.setBillable(params.get("newbillable"))
             ri.setPrice(params.get("newprice"))
             self._input.addItem(ri)
     elif params.get("removeradioitem", "").strip() != "":
         rs = params.get("radioitems", [])
         if type(rs) != list:
             rs = [rs]
         for id in rs:
             self._input.removeItemById(id)
     elif params.get("disableradioitem", "").strip() != "":
         rs = params.get("radioitems", [])
         if type(rs) != list:
             rs = [rs]
         for id in rs:
             self._input.disableItemById(id)
     elif params.get("defaultradioitem", "").strip() != "":
         rs = params.get("radioitems", [])
         if type(rs) != list:
             rs = [rs]
         for id in rs:
             self._input.setDefaultItemById(id)
     elif not params.has_key("save") or self._input is None:
         self._input = FieldInputs.getAvailableInputKlassById(
             params.get("input", "text"))(self)
Пример #2
0
 def map(self, params):
     self._caption=params.get("caption","")
     self._mandatory=params.has_key("mandatory")
     self._billable=params.has_key("billable")
     self._price=params.get("price","")                
     if params.get("addradioitem","").strip()!="":
         ri=RadioItem(self._input)
         cap=params.get("newradioitem")
         if cap.strip()!="":
             ri.setCaption(params.get("newradioitem"))
             ri.setBillable(params.get("newbillable"))
             ri.setPrice(params.get("newprice"))
             self._input.addItem(ri)
     elif params.get("removeradioitem","").strip()!="":
         rs=params.get("radioitems",[])
         if type(rs)!=list:
             rs=[rs]
         for id in rs:
             self._input.removeItemById(id)
     elif params.get("disableradioitem","").strip()!="":
         rs=params.get("radioitems",[])
         if type(rs)!=list:
             rs=[rs]
         for id in rs:
             self._input.disableItemById(id)
     elif params.get("defaultradioitem","").strip()!="":
         rs=params.get("radioitems",[])
         if type(rs)!=list:
             rs=[rs]
         for id in rs:
             self._input.setDefaultItemById(id)
     elif not params.has_key("save") or self._input is None:
         self._input=FieldInputs.getAvailableInputKlassById(params.get("input","text"))(self)
Пример #3
0
    def map(self, params):
        self._caption = params.get("caption", "")
        self._description = params.get("description", "")
        self._mandatory = params.has_key("mandatory")
        self._billable = params.has_key("billable")
        self._price = params.get("price", "")
        self._placesLimit = params.get("placesLimit", "")

        if params.get("inputtype"):
            self._input.setInputType(params.get("inputtype"))
        if params.get("dateFormat"):
            self._input.dateFormat = params.get("dateFormat")
        if params.has_key('length'):
            self._input.setLength(params.get('length'))
        if params.has_key('minValue'):
            self._input.setMinValue(params.get('minValue'))
        if params.has_key('numberOfRows'):
            self._input.setNumberOfRows(params.get('numberOfRows'))
        if params.has_key('numberOfColumns'):
            self._input.setNumberOfColumns(params.get('numberOfColumns'))
        if params.get("addradioitem", "").strip() != "":
            ri = RadioItem(self._input)
            cap = params.get("newradioitem")
            if cap.strip() != "":
                ri.setCaption(params.get("newradioitem"))
                ri.setBillable(params.get("newbillable"))
                ri.setPrice(params.get("newprice"))
                ri.setPlacesLimit(params.get("newplaces"))
                self._input.addItem(ri)
        elif params.get("removeradioitem", "").strip() != "":
            rs = params.get("radioitems", [])
            if type(rs) != list:
                rs = [rs]
            for id in rs:
                self._input.removeItemById(id)
        elif params.get("disableradioitem", "").strip() != "":
            rs = params.get("radioitems", [])
            if type(rs) != list:
                rs = [rs]
            for id in rs:
                self._input.disableItemById(id)
        elif params.get("defaultradioitem", "").strip() != "":
            rs = params.get("radioitems", [])
            if type(rs) != list:
                rs = [rs]
            for id in rs:
                self._input.setDefaultItemById(id)
        elif params.get("changeradioitem", "").strip() != "":
            rs = params.get("radioitems", [])
            if type(rs) != list:
                rs = [rs]
            for id in rs:
                caption = params.get("newradioitem")
                billable = params.get("newbillable")
                price = params.get("newprice")
                places = params.get("newplaces")
                self._input.changeItemById(id,
                                           caption=caption,
                                           billable=billable,
                                           price=price,
                                           places=places)
        elif params.get("removeradioitemprice", "").strip() != "":
            rs = params.get("radioitems", [])
            if type(rs) != list:
                rs = [rs]
            for id in rs:
                self._input.removePriceById(id)
        elif not params.has_key("save") or self._input is None:
            self._input = FieldInputs.getAvailableInputKlassById(
                params.get("input", "text"))(self)
Пример #4
0
    def map(self, params):
        self._caption=params.get("caption","")
        self._description = params.get("description","")
        self._mandatory=params.has_key("mandatory")
        self._billable=params.has_key("billable")
        self._price=params.get("price","")
        self._placesLimit=params.get("placesLimit","")

        if params.get("inputtype"):
            self._input.setInputType(params.get("inputtype"))
        if params.get("dateFormat"):
            self._input.dateFormat = params.get("dateFormat")
        if params.has_key('length'):
            self._input.setLength(params.get('length'))
        if params.has_key('minValue'):
            self._input.setMinValue(params.get('minValue'))
        if params.has_key('numberOfRows'):
            self._input.setNumberOfRows(params.get('numberOfRows'))
        if params.has_key('numberOfColumns'):
            self._input.setNumberOfColumns(params.get('numberOfColumns'))
        if params.get("addradioitem","").strip()!="":
            ri=RadioItem(self._input)
            cap=params.get("newradioitem")
            if cap.strip()!="":
                ri.setCaption(params.get("newradioitem"))
                ri.setBillable(params.get("newbillable"))
                ri.setPrice(params.get("newprice"))
                ri.setPlacesLimit(params.get("newplaces"))
                self._input.addItem(ri)
        elif params.get("removeradioitem","").strip()!="":
            rs=params.get("radioitems",[])
            if type(rs)!=list:
                rs=[rs]
            for id in rs:
                self._input.removeItemById(id)
        elif params.get("disableradioitem","").strip()!="":
            rs=params.get("radioitems",[])
            if type(rs)!=list:
                rs=[rs]
            for id in rs:
                self._input.disableItemById(id)
        elif params.get("defaultradioitem","").strip()!="":
            rs=params.get("radioitems",[])
            if type(rs)!=list:
                rs=[rs]
            for id in rs:
                self._input.setDefaultItemById(id)
        elif params.get("changeradioitem","").strip()!="":
            rs=params.get("radioitems",[])
            if type(rs)!=list:
                rs=[rs]
            for id in rs:
                caption = params.get("newradioitem")
                billable = params.get("newbillable")
                price = params.get("newprice")
                places = params.get("newplaces")
                self._input.changeItemById(id, caption=caption, billable=billable, price=price, places=places)
        elif params.get("removeradioitemprice","").strip()!="":
            rs=params.get("radioitems",[])
            if type(rs)!=list:
                rs=[rs]
            for id in rs:
                self._input.removePriceById(id)
        elif not params.has_key("save") or self._input is None:
            self._input=FieldInputs.getAvailableInputKlassById(params.get("input","text"))(self)