public CallsLogClientDS(String id) {
    setID(id);
    DataSourceIntegerField call_log_id = new DataSourceIntegerField("id");
    call_log_id.setHidden(true);
    call_log_id.setPrimaryKey(true);
    call_log_id.setRequired(true);

    DataSourceTextField op_user_name = new DataSourceTextField("op_user_name", "ოპერატორი");
    DataSourceTextField phone = new DataSourceTextField("phone", "ნომერი");
    DataSourceTextField abonent_name = new DataSourceTextField("abonent_name", "აბონენტი");
    DataSourceIntegerField call_duration =
        new DataSourceIntegerField("call_duration", "ხანგრძლივობა");
    DataSourceDateTimeField incomming_date =
        new DataSourceDateTimeField("incomming_date", "შემოსვლის დრო");
    DataSourceDateTimeField end_date = new DataSourceDateTimeField("end_date", "დასრულების დრო");
    DataSourceIntegerField status = new DataSourceIntegerField("status", "სტატუსი");

    setFields(
        call_log_id,
        op_user_name,
        phone,
        abonent_name,
        call_duration,
        incomming_date,
        end_date,
        status);
    setClientOnly(true);
  }
  public AbPhonesClientDS(String id) {
    // setID(id);

    DataSourceIntegerField pk = new DataSourceIntegerField("pk");
    pk.setPrimaryKey(true);
    pk.setRequired(true);
    pk.setHidden(true);

    // phone number descr
    DataSourceTextField phone = new DataSourceTextField("phone", "ტელეფონის ნომერი", 140);

    DataSourceTextField opCloseField =
        new DataSourceTextField("is_hide_descr", "ღია/დაფარული", 100);
    // is parallel or not field
    DataSourceTextField parallelUsualField =
        new DataSourceTextField("is_parallel_descr", "პარალელური", 120);
    // phone status field
    DataSourceTextField phoneStatusField = new DataSourceTextField("phone_status", "სტატუსი", 100);
    // phone state field
    DataSourceTextField phoneStateField =
        new DataSourceTextField("phone_state", "მდგომარეობა", 100);
    // phone type field
    DataSourceTextField phoneTypeField = new DataSourceTextField("phone_type", "ტიპი", 119);

    DataSourceIntegerField is_hide = new DataSourceIntegerField("is_hide");
    is_hide.setHidden(true);

    DataSourceIntegerField is_parallel = new DataSourceIntegerField("is_parallel");
    is_parallel.setHidden(true);

    DataSourceIntegerField phone_status_id = new DataSourceIntegerField("phone_status_id");
    phone_status_id.setHidden(true);

    DataSourceIntegerField phone_state_id = new DataSourceIntegerField("phone_state_id");
    phone_state_id.setHidden(true);

    DataSourceIntegerField phone_type_id = new DataSourceIntegerField("phone_type_id");
    phone_type_id.setHidden(true);

    setFields(
        pk,
        phone,
        opCloseField,
        parallelUsualField,
        phoneStatusField,
        phoneStateField,
        phoneTypeField,
        is_hide,
        is_parallel,
        phone_status_id,
        phone_state_id,
        phone_type_id);
    setClientOnly(true);
  }
예제 #3
0
  public PZoneChange() {
    restrictedEdits = DocFlow.user_obj.getZoneConfiguration().getRestricted_edits();
    CHARCOUNT = DocFlow.user_obj.getZoneConfiguration().getCharcount();
    tsMain = new ToolStrip();
    tsMain.setWidth100();
    HashMap<String, String> listSqls = new HashMap<String, String>();
    listSqls.put("" + ClSelection.T_REGION, "" + ClSelection.T_REGION);
    listSqls.put("" + ClSelection.T_CUST_TYPE, "" + ClSelection.T_CUST_TYPE);
    dsZoneDS = DocFlow.getDataSource("ZoneDS");
    dsCustomer = DocFlow.getDataSource("CustomerDS");
    miSearch = new ToolStripButton("Search");
    tiNewZone = new TextItem("newzone", "New Zone");
    biSaveData = new ButtonItem("saveData", "Change Zone");

    tiNewZone.addKeyPressHandler(
        new KeyPressHandler() {

          @Override
          public void onKeyPress(KeyPressEvent event) {
            newZoneKeyPressed(event);
          }
        });
    VLayout vl = new VLayout();

    dmCriteria = new DynamicForm();
    dmCriteria.setNumCols(4);
    dmCriteria.setHeight("8%");
    dmCriteria.setTitleOrientation(TitleOrientation.TOP);
    siCustomerType = new SelectItem("custypeid", "Customer Type");
    siZones = new SelectItem("zones", "Zones");
    siZones.setValueField("zone");
    siZones.setAutoFetchData(false);
    siZones.setDisplayField("zone");
    siZones.setOptionDataSource(dsZoneDS);

    tsMain.setHeight("15");
    vl.addMember(tsMain);
    tsMain.addButton(miSearch);
    vl.addMember(dmCriteria);
    lgCustomers = new ListGrid();
    lgCustomers.setDataSource(dsCustomer);
    lgCustomers.setAutoFetchData(false);
    lgCustomers.setShowResizeBar(false);
    lgCustomers.setCanDragRecordsOut(true);
    lgCustomers.setDragDataAction(DragDataAction.COPY);
    lgCustomers.setHeight100();
    lgCustomers.setHeight100();

    DataSource dsSelectedData = new DataSource();
    dsSelectedData.setClientOnly(true);

    DataSourceIntegerField dsfcusid = new DataSourceIntegerField("cusid", "Customer ID");
    dsfcusid.setPrimaryKey(true);

    DataSourceTextField dsZone = new DataSourceTextField("zone", "Zone");
    dsSelectedData.setFields(dsfcusid, dsZone);

    lgZoneCustomers = new ListGrid();
    lgZoneCustomers.setDataSource(dsSelectedData);
    lgZoneCustomers.setAutoFetchData(false);
    lgZoneCustomers.setCanAcceptDroppedRecords(true);
    lgZoneCustomers.setCanRemoveRecords(true);
    lgZoneCustomers.setAutoFetchData(false);
    lgZoneCustomers.setPreventDuplicates(true);
    lgZoneCustomers.setHeight100();
    lgZoneCustomers.setWidth100();

    HStack hStack = new HStack(10);
    hStack.setWidth100();
    hStack.setHeight100();
    hStack.setShowEdges(true);

    VStack vStack = new VStack();
    vStack.setHeight100();
    vStack.setWidth("60%");
    vStack.addMember(lgCustomers);
    hStack.addMember(vStack);
    TransferImgButton arrowImg = new TransferImgButton(TransferImgButton.RIGHT);
    arrowImg.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            lgZoneCustomers.transferSelectedData(lgCustomers);
          }
        });

    TransferImgButton arrowImgLeft = new TransferImgButton(TransferImgButton.LEFT);
    arrowImgLeft.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            lgZoneCustomers.removeSelectedData();
          }
        });
    hStack.addMember(arrowImg);
    hStack.addMember(arrowImgLeft);
    VStack vStack2 = new VStack();
    vStack2.setHeight100();
    vStack2.setWidth("40%");
    vStack2.addMember(lgZoneCustomers);
    hStack.addMember(vStack2);

    miSearch.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            search();
          }
        });

    lgCustomers.addClickHandler(
        new com.smartgwt.client.widgets.events.ClickHandler() {

          @Override
          public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {}
        });

    vl.addMember(hStack);

    this.addMember(vl);
    DocFlow.docFlowService.getListTypesForDocument(
        listSqls,
        -1,
        new AsyncCallback<HashMap<String, ArrayList<ClSelectionItem>>>() {

          @Override
          public void onFailure(Throwable caught) {
            setResults(null);
          }

          @Override
          public void onSuccess(HashMap<String, ArrayList<ClSelectionItem>> result) {

            setResults(result);
          }
        });
  }