Skip to Content.
Sympa Menu

comanage-dev - Re: [comanage-dev] Re: CO-229 and deleting COUs

Subject: COmanage Developers List

List archive

Re: [comanage-dev] Re: CO-229 and deleting COUs


Chronological Thread 
  • From: Scott Koranda <>
  • To: comanage-dev <>
  • Subject: Re: [comanage-dev] Re: CO-229 and deleting COUs
  • Date: Wed, 14 Mar 2012 09:43:30 -0500

> [1]https://spaces.internet2.edu/display/COmanage/cm_cous
> The data model doesn't include references to children. �I didn't see that
> being available when looking at the dump of $this when I wrote that, but
> it may be included now thanks to the automagic Cake tree structure.

Yep', that's it.

I edited the page above with the data model to add a note
about the tree behavior with a link to the documentation.

Thanks,

Scott

> �I
> don't see any problem with changing it to use that instead so long as it
> continues to be available.
> Marie
>
> On Tue, Mar 13, 2012 at 2:51 PM, Scott Koranda
> <[2]>
> wrote:
>
> On Tue, Mar 13, 2012 at 4:23 PM, Scott Koranda
> <[3]>
> wrote:
> > Hi,
> >
> > CouController.php contains this code in the checkDeleteDependencies()
> > method when it is trying to determine if the Cou has any
> > children:
> >
> > � � �foreach($this->cur_co['Cou'] as $k => $v)
> > � � �{
> > � � � �if($v['parent_id'] == $curdata['Cou']['id'])
> > � � � �{
> > � � � � �if($this->restful)
> > � � � � � �$this->restResultHeader(403, "Child COU Exists");
> > � � � � �else
> > � � � � � �$this->Session->setFlash(_txt('er.cou.child',
> array(Sanitize::html($curdata['Cou']['name']))), '', array(), 'error');
> >
> > � � � � �return(false);
> > � � � �}
> > � � �}
> >
> >
> > Is there any reason that cannot be replaced by
> >
> > � �$childCOUs = $curdata['Cou']['ChildCou'];
>
> Should be
>
> $childCOUs = $curdata['ChildCou'];
>
> Question is the same...
> > � �if (!empty($childCOUs)){
> > � � � �if($this->restful)
> > � � � � � �$this->restResultHeader(403, "Child COU Exists");
> > � � � �else
> > � � � � � �$this->Session->setFlash(_txt('er.cou.child',
> array(Sanitize::html($curdata['Cou']['name']))), '', array(), 'error');
> >
> > � �}
> >
> > Put another way, since the Cou model has a field where it
> > keeps track of its children, why not just check for children?
> >
> > Thanks,
> >
> > Scott
>
> References
>
> Visible links
> 1. https://spaces.internet2.edu/display/COmanage/cm_cous
> 2.
> mailto:
> 3.
> mailto:



Archive powered by MHonArc 2.6.16.

Top of Page