@" checkbox = document.createElement('input');"
@" checkbox.setAttribute('type', 'checkbox');"
@" checkbox.setAttribute('checked', 'checked');"
- @" checkbox.setAttribute('value', '1');"
+ @" checkbox.setAttribute('value', email);"
@" checkbox.setAttribute('id', email);"
- @" checkbox.setAttribute('name', email);"
+ @" checkbox.setAttribute('name', tableId);"
@" td.appendChild(checkbox);"
@" tr.appendChild(td);"
@" td = document.createElement('td');"
return date;
}
+- (id)testAction {
+ WORequest *req;
+
+ NSLog(@"%s BEEN HERE!",
+ __PRETTY_FUNCTION__);
+
+ req = [[self context] request];
+ NSLog(@"%@", [req formValues]);
+ return self;
+}
+
- (id)saveAction {
SOGoAppointment *apt;
NSString *iCalString;
req = [[self context] request];
/* get iCalString from hidden input */
-
iCalString = [req formValueForKey:@"ical"];
if ([iCalString length] == 0) {
// TODO: improve user experience ... (eg error panel like Zope)
- return [NSException exceptionWithHTTPStatus:400 /* bad request */
- reason:@"missing iCalendar form data in request"];
+ /* return 400 == Bad Request */
+ return [NSException exceptionWithHTTPStatus:400
+ reason:@"missing iCalendar form data in request"];
}
apt = [[SOGoAppointment alloc] initWithICalString:iCalString];
[apt setLocation:location];
[apt removeAllAttendees]; /* clean up */
- ps = [[req formValueForKey:@"participants"]
- componentsSeparatedByString:@"\n"];
+ ps = [req formValuesForKey:@"participants"];
count = [ps count];
for (i = 0; i < count; i++) {
NSString *email;
<tr>
<td><input type="checkbox"
checked="checked"
- value="1"
+ var:value="user.login"
+ var:id="user.login"
+ name="participants"
/></td>
- <td>TODO: Owner</td>
+ <td>TODO: EMAIL(!) <var:string value="user.login" /></td>
</tr>
</table>
</span>
</tr>
<tr>
<td>
- <input type="submit" label:value="Save" />
+ <input type="submit" label:value="Save" name="save:method" />
<input type="hidden" name="ical" var:value="iCalString" />
+ <input type="submit" value="test" name="test:method" />
</td>
</tr>
</table>