119
_mode == TaskEditorModeCreate);
switchCell.accessorySwitch.on = (param.value.integerValue == 1);
cell = switchCell;
break;
}
case ExtParamTypeSelect: {
TextInputTableViewCell *selectInputCell = [tableView
dequeueReusableCellWithIdentifier:ExtParamsEditorTextInputCellIdentifier
forIndexPath:indexPath];
selectInputCell.tableView = tableView;
selectInputCell.textView.userInteractionEnabled = NO;
if ([param.epValue isKindOfClass: [NSDictionary class]]) {
NSString *text = param.epValue[@"value"];
if (text.length > 0) {
selectInputCell.text = text;
selectInputCell.placeholder = nil;
}
else {
selectInputCell.text = nil;
selectInputCell.placeholder = @"Не выбрано";
}
}
selectInputCell.accessoryType = UITableViewCellAccessoryNone;
cell = selectInputCell;
break;
}
case ExtParamTypeDate:
case ExtParamTypeDateTime:
{
TextInputTableViewCell *dateInputCell = [tableView
dequeueReusableCellWithIdentifier:ExtParamsEditorTextInputCellIdentifier
forIndexPath:indexPath];
dateInputCell.tableView = tableView;
dateInputCell.textView.userInteractionEnabled = NO;
dateInputCell.placeholder = nil;
dateInputCell.accessoryType = UITableViewCellAccessoryNone;
dateInputCell.text = (param.type == ExtParamTypeDate) ? [dateFormatter
stringFromDate:param.epValue] : [dateTimeFormatter stringFromDate:param.epValue];
cell = dateInputCell;
break;
}
case ExtParamTypeSelectUsers:
case ExtParamTypeAddressees: {
if (indexPath.row == param.items.count) {
UITableViewCell *defaultCell = [tableView
dequeueReusableCellWithIdentifier:ExtParamsEditorDefaultCellIdentifier
forIndexPath:indexPath];
defaultCell.textLabel.textAlignment = NSTextAlignmentCenter;
defaultCell.textLabel.textColor = AZURE_COLOR;
defaultCell.textLabel.text = @"Добавить пользователя";
defaultCell.accessoryType = UITableViewCellAccessoryNone;
cell = defaultCell;
}
else {
ContactTableViewCell *contactCell = [tableView
dequeueReusableCellWithIdentifier:ExtParamsEditorContactCellIdentifier
forIndexPath:indexPath];
Contact *contact = param.items[indexPath.row];
contactCell.showAccessoryButton = YES;
contactCell.contact = contact;
contactCell.delegate = self;
contactCell.accessoryType = UITableViewCellAccessoryNone;
cell = contactCell;