Skip to Content.
Sympa Menu

comanage-dev - Re: [comanage-dev] Fwd: [JIRA] Work started: (CO-87) Affiliation model cleanup

Subject: COmanage Developers List

List archive

Re: [comanage-dev] Fwd: [JIRA] Work started: (CO-87) Affiliation model cleanup


Chronological Thread 
  • From: Marie Huynh <>
  • To: Benn Oshrin <>, comanage-dev <>
  • Subject: Re: [comanage-dev] Fwd: [JIRA] Work started: (CO-87) Affiliation model cleanup
  • Date: Wed, 23 Nov 2011 15:43:57 -0800

Hi Benn,

I'm looking at this in cmp_enrollment_configurations_controller.php:

if(!defined_attribute($attrs, 'affiliation'))
{
$newattrs[]['CmpEnrollmentAttribute'] = array(
'cmp_enrollment_configuration_id' => $fid,
'attribute' => 'edu_person_affiliation',
'required' => RequiredEnum::Optional,
'ldap_name' => 'edu_person_affiliation',
'saml_name' => 'edu_person_affiliation'
);
}

Are all instances supposed to change to just "affiliation" too, or
does that string have other meanings in the code?


On Tue, Nov 22, 2011 at 10:39 AM, Scott Koranda
<>
wrote:
> Hi,
>
>> I don't think we need to store the full strings since they will be
>> defined in the system and not by users.
>
> Agreed.
>
>>
>> I looked for a recommended or standard way of doing the multiple
>> checkboxes but all I found was for tweaking the front end.
>
> I am not finding anything particularly astounding either.
>
> It looks like one has to "do this by hand" no matter what.
>
>> After some
>> thought, it seemed better if it could be configured in the enum.php
>> file along with the other things there and we shouldn't need more than
>> an int(4 bytes in mysql) to store the values.  I gave each checkbox a
>> value, going up as powers of 2.  When a form is submitted, the values
>> are summed before being passed down, and on read, subtracted out
>> before going to a form for edit.  That seems to be working fine,
>> though I need to finish the views.
>>
>> Does this solution seem ok, or would it be easier for admins to assign
>> letters to the items in enum?
>
> I think the enum is fine.
>
> Can you send me what code you have for now with the
> demographics stuff?
>
> Thanks,
>
> Scott
>
>>
>>
>>
>> On Tue, Nov 22, 2011 at 9:03 AM, Scott Koranda
>> <>
>> wrote:
>> >> On Tue, Nov 15, 2011 at 7:00 PM, Benn Oshrin
>> >> <>
>> >> wrote:
>> >> > On 11/15/11 8:53 PM, Marie Huynh wrote:
>> >> >>>
>> >> >>> - edu_person_affiliation can be multi-valued, but data model doesn't
>> >> >>> allow this.
>> >> >>> - org_people:edu_person_affiliation and co_people:e_p_a should
>> >> >>> probably
>> >> >>> become org_people:affiliation co_people:affiliation
>> >> >>
>> >> >> edu_person_affiliation is in cm_co_person_roles and
>> >> >> cm_org_identities,
>> >> >> both as varchar(32).  According to the link in the definition, the
>> >> >> permissible values are:
>> >> >>
>> >> >> faculty, student, staff, alum, member, affiliate, employee,
>> >> >> library-walk-in
>> >> >>
>> >> >> I propose we treat this in the same way as the multiple checkboxes
>> >> >> for
>> >> >> demographics(CO-94).
>> >> >
>> >> > I forget, what did we say on that? Make the field VARCHAR(n)?
>> >>
>> >> Scott was looking into how CakePHP would render a multiple checkbox
>> >> field.
>> >> https://bugs.internet2.edu/jira/browse/CO-94?focusedCommentId=15986&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15986
>> >
>> > Hi,
>> >
>> > On this question of multiple check boxes.
>> >
>> > Is there a preference or strong feeling on how the underlying
>> > data should be handled?
>> >
>> > For the sake of discussion, suppose we want to add 'race'
>> > with possible values of 'purple', 'green', and 'blue' or any
>> > combination of them to the OrgIdentity class.
>> >
>> > A user wants to select 'purple' and 'green'.
>> >
>> > Do we want
>> >
>> > a) to store 'green purple' as a string in a 'race' row for
>> > OrgIdentity
>> >
>> > or
>> >
>> > b) do we want a separate model/table with a many-to-many
>> > relationship between the OrgIdentity and the values 'purple'
>> > and 'green'.
>> >
>> > I think in the past I argued for (a) but I think there is
>> > more CakePHP magic available for (b).
>> >
>> > Before I dig deeper and code up test code for both I wanted
>> > to know if we had a preference or already ruled something
>> > out, or if I am missing another good possibility?
>> >
>> > I had hoped we could use a database column of type SET and
>> > get CakePHP automagic, but I do not see that available so
>> > far.
>> >
>> > Thanks,
>> >
>> > Scott
>> >
>> >
>> >>
>> >> >
>> >> >>> - affiliation field should be customizable
>> >> >>
>> >> >> How so?  During setup via enum?  As part of the enrollment config so
>> >> >> it can be done via the UI?
>> >> >
>> >> > Open for discussion. It could just become an Extended Attribute that
>> >> > gets
>> >> > tied to an Enum (not currently supported).
>> >>
>> >> Not currently supported by us or cake?
>> >>
>> >> >
>> >> > -Benn-
>> >> >
>> >
>



Archive powered by MHonArc 2.6.16.

Top of Page