Assignment patch
Alex Leverington
admin@networkessence.net
Mon, 29 Oct 2001 02:12:20 -0600
---------------------- multipart/mixed attachment
Here is patch to enable assignment function.
Here is sql table to go with function:
CREATE TABLE user (
id varchar(32) DEFAULT '' NOT NULL,
name varchar(64),
email varchar(96),
PRIMARY KEY (id)
);
Here is example data:
INSERT INTO user VALUES ('1','user1','user1@example.com');
INSERT INTO user VALUES ('2','user2','user2@example.com');
This will allow assigning the tickets to user1 or user2 based on their username
or email address and adds a dropdown box to pick between username or email
format to the details.php form. This only allows user assigning using whups
users local to this table. Once user auth and user backend is completed for
whups, the assignment will be able to interact with those users as well, but
that will be in a later patch. This is so the assignment function can be used
now. This patch also changes the details.php page to show
'Owner <a href=mailto:user1@example.com>user1</a>'
instead of just showing a user's ID number (which I think was the authors
original intention because the owner was already to use getEmailType() for
display ;).
I will need to cleanup the user type a little so it's more inline with the rest
of the code, but hat will come later as well.
*Hopefully this can be review and applied to cvs so I don't have a weirded out
whups tree :-)
---------------------- multipart/mixed attachment
W3Jvb3QgaG9yZGVdIyBjdnMgLXozIGRpZmYgd2h1cHMNCj8gd2h1cHMvbGliL0JhY2tlbmQvc3Fs
LmJhY2t1cC5waHANCmN2cyBzZXJ2ZXI6IERpZmZpbmcgd2h1cHMNCkluZGV4OiB3aHVwcy9kZXRh
aWxzLnBocA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PQ0KUkNTIGZpbGU6IC9yZXBvc2l0b3J5L3dodXBzL2RldGFpbHMu
cGhwLHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS44DQpkaWZmIC11IC1yMS44IGRldGFpbHMucGhw
DQotLS0gd2h1cHMvZGV0YWlscy5waHAgICAyMDAxLzEwLzA2IDE5OjA3OjMwICAgICAxLjgNCisr
KyB3aHVwcy9kZXRhaWxzLnBocCAgIDIwMDEvMTAvMjkgMDg6MDc6MDcNCkBAIC03Nyw2ICs3Nyw3
IEBADQogICAgICAgICAgICAgJGFzc2lnbmZvcm0yLT5nZXRJbmZvKCR2YXJzLCAkaW5mbyk7DQog
ICAgICAgICAgICAgJGJhY2tlbmQtPmFzc2lnblRpY2tldCgkaW5mbyk7DQogICAgICAgICAgICAg
JHZhcnMtPnVuc2V0VmFyKCdhc3NpZ25lZScpOw0KKyAgICAgICAgICAgJHZhcnMtPnVuc2V0VmFy
KCd1c2VydHlwZScpOw0KICAgICAgICAgICAgICR2YXJzLT51bnNldFZhcignbmV3Y29tbWVudCcp
Ow0KICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAkZnJvbSA9ICdhc3NpZ250aWNrZXRz
dGVwMWZvcm0nOw0KY3ZzIHNlcnZlcjogRGlmZmluZyB3aHVwcy9jb25maWcNCmN2cyBzZXJ2ZXI6
IERpZmZpbmcgd2h1cHMvZG9jcw0KY3ZzIHNlcnZlcjogRGlmZmluZyB3aHVwcy9ncmFwaGljcw0K
Y3ZzIHNlcnZlcjogRGlmZmluZyB3aHVwcy9saWINCkluZGV4OiB3aHVwcy9saWIvQmFja2VuZC5w
aHANCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0NClJDUyBmaWxlOiAvcmVwb3NpdG9yeS93aHVwcy9saWIvQmFja2VuZC5w
aHAsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjcNCmRpZmYgLXUgLXIxLjcgQmFja2VuZC5waHAN
Ci0tLSB3aHVwcy9saWIvQmFja2VuZC5waHAgICAgICAgMjAwMS8xMC8xMCAxNDoxNjo1OCAgICAg
MS43DQorKysgd2h1cHMvbGliL0JhY2tlbmQucGhwICAgICAgIDIwMDEvMTAvMjkgMDg6MDc6MTAN
CkBAIC0xNCw3ICsxNCw3IEBADQogICogV2h1cHNfQmFja2VuZCBDbGFzcw0KICAqDQogICogQGF1
dGhvciBSb2JlcnQgRS4gQ295bGUgPHJvYmVydGVjb3lsZUBob3RtYWlsL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IA0KICAgICAgICAgJGNvbW1lbnQgPSAiQXNzaWduZWQg
dGlja2V0IHRvICRuYW1lIDwkZW1haWw+IjsNCiANCkBAIC0yMzQsOCArMjQwLDE0IEBADQogICAg
ICAgICB9DQogDQogICAgICAgICBpZiAoIWVtcHR5KCRyZXN1bHRbJ3VzZXJfaWRfb3duZXInXSkp
IHsNCi0gICAgICAgICAgICAkcmVzdWx0Wydfb3duZXJfbmFtZSddID0gJHJlc3VsdFsnb3duZXIn
XTsNCi0gICAgICAgICAgICAkcmVzdWx0Wydfb3duZXInXSA9ICRyZXN1bHRbJ293bmVyJ107DQor
ICAgICAgICAgICAgJHRpY2tldF9vd25lcl9kZXRhaWxzID0gJHRoaXMtPmdldFVzZXJEZXRhaWxz
KCRyZXN1bHRbJ3VzZXJfaWRfb3duZXInXSk7DQorICAgICAgICAgICAgJHRpY2tldF9vd25lcl9k
ZXRhaWxzID0gJHRpY2tldF9vd25lcl9kZXRhaWxzWzBdOw0KKw0KKyAgICAgICAgICAgICRyZXN1
bHRbJ19vd25lcl9uYW1lJ10gPSAkdGlja2V0X293bmVyX2RldGFpbHNbJ25hbWUnXTsNCisgICAg
ICAgICAgICAkcmVzdWx0Wydfb3duZXJfZW1haWwnXSA9ICR0aWNrZXRfb3duZXJfZGV0YWlsc1sn
ZW1haWwnXTsNCisNCisgICAgICAgICAgICAkcmVzdWx0Wydfb3duZXInXSA9ICRyZXN1bHRbJ19v
d25lcl9lbWFpbCddOw0KKw0KICAgICAgICAgfQ0KICAgICAgICAgDQogICAgICAgICByZXR1cm4g
JHJlc3VsdDsNCkBAIC0yNzEsNiArMjgzLDEyIEBADQogICAgICAgICByZXR1cm4gJHRoaXMtPl9n
ZXRBc3NvYygnU0VMRUNUIHR5cGVfaWQsIHR5cGVfbmFtZSBGUk9NIHdodXBzX3R5cGVzJyk7DQog
ICAgIH0NCiANCisgICAgZnVuY3Rpb24gZ2V0VXNlclR5cGVzKCkNCisgICAgew0KKyAgICAgICBy
ZXR1cm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