DeleteQuery in HABTM is like 'dependent'= true in hasMany associations?

2009-08-12 Thread Josoroma
Im using the following structure: User hasMany Listing Listing hasMany Contacts Listings hasAndBelongsToMany Articles Articles hasMany Tags When i delete a User or a Listing all their associated Listings and Articles are successfully deleted. But not their Tags. Listings and Articles are

Re: DeleteQuery in HABTM is like 'dependent'= true in hasMany associations?

2009-08-12 Thread Josoroma
Sorry, typo error, is: Articles hasandBelognsToMany Tags --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group,

cake media plugin imagemagick adapter

2009-08-11 Thread Josoroma
Hi! Im using the media plugin adapter: http://wiki.github.com/davidpersson/media/configuration By default this plugin is working with the GD adapter (we have both GD and ImageMagick). For us everything works fine, but some uploaded images display a warning: ... gd-jpeg, libjpeg: recoverable

/* enhancement */ - AD7six Upload Behaviour

2008-09-08 Thread Josoroma
Now everything is working like i expected. To keep the file in {IMAGE}... and delete the file in {APP}... im using the afterSave callback in my model: function afterSave() { if (!empty($this-data[$this-name]['logo'])) { $baseDir= ROOT .

Re: AD7six Upload Behaviour

2008-09-07 Thread Josoroma
Hi AD7six, I was wondering how to auto-delete int add action the file uploaded to {APP} after the file is converted in {IMAGES}? Just only to keep the converted file and not the original uploaded file. Now i can save my image in a single field. Based in modifications to allow using a single

Re: AD7six Upload Behaviour - Getting close

2008-09-05 Thread Josoroma
Im using cakephp 1.2 and the behaviors: http://trac.assembla.com/cake-base/browser/branches/sample_app/app/models/behaviors/upload.php http://trac.assembla.com/cake-base/browser/branches/sample_app/app/models/behaviors/image_upload.php And im trying to upload and save the image without using the

[SOLVED] - AD7six Upload Behaviour

2008-09-05 Thread Josoroma
After almost 7 days of debuggin is done! The problem was the fullpath of the convert command, i just modified by hand the file image_upload.php, in the line 508 i added the path to convert: $command = /usr/local/bin/convert $input $params $output; My model is: ?php class Test extends AppModel

Re: AD7six Upload Behaviour

2008-09-04 Thread Josoroma
ok im still trying and i think im close: Im my add action i have: ... $this-Test-create(); $this-data['Test']['foreign_id'] = ''; $this-data['Test']['dir'] = 'listings'; $this-data['Test']['class']= '/listings'; $this-data['Test']['filename'] =

$this-Auth-authorize = 'actions' and $this-Acl-check();

2008-09-01 Thread Josoroma
Im using ACL and Auth with: $this-Auth-authorize = 'actions'; My roles are: Guests --Contributors Managers --Administrators Is possible to ask for $this-Acl-check in a view? In a allowed index view Im displaying 3 buttons, how do i display only 1 view to Contributors, Two to Managers

Re: AD7six Upload Behaviour

2008-08-31 Thread Josoroma
Hi, Somebody knows how to use and configure at model level the upload behavior of AD7Six, but without using the attachments table? http://groups.google.com/group/cake-php/browse_thread/thread/8ac41ad9dfd4bb7d/a1b2160874e5da48 Any help is welcome. Thanks in advance.

Re: AD7six Upload Behaviour

2008-08-27 Thread Josoroma
Hi AD7Six, I was seeing your behaviors, they looks very cool and useful. I was wondering how to use the upload and image_upload behaviors without using the attachments table. ...can just be a file field in your products table, or a dedicated 'attachments' table... My field is logo, im using the

HABTM - Listings = Listingcategories - Listings of a given Category ID and Country name

2008-08-26 Thread Josoroma
I have a habtm association: Listings = Listingcategories The join table is listingcategories_listing. From the Listingcategories controller I get the listings of a given category id without problem, using the following code: http://bin.cakephp.org/saved/36634 Now i also need to get the

Complex HABTM paginate

2008-08-23 Thread Josoroma
Thanks to this article: http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/ Form categories controller Im displaying all the Listings name and description from a given category($current_id) class CategoriesController extends AppController { function

find list vs find all - Manipulating the format of a javascript object

2008-08-19 Thread Josoroma
With the following piece of code: function getJsonStates() { //Configure::write(debug,0); $params = array( 'conditions'= null, 'fields'=

ACL - Magic - Deleting a user

2008-07-04 Thread Josoroma
Thanks to the kitchen example from: http://aranworld.com/article/170/cakephp-acl-and-auth-sample-website Now im having Roles instead of Groups working. Now we can add user to ARO groups without problems. Few minutes ago i noticed when i delete a user, it is automatically removed from aros table,

ACL - Inherit permissions from groups and vrious about non default CRUD actions

2008-06-27 Thread Josoroma
This is my situation, i need to create 6 types or groups of users: # -- Administrators # Managers # -- Moderators # Publishers # -- Contributors # Guests Where Administrators inherit all manager permissions, managers inherit all moderators permissions,

Conventions - Process - More than one object to tag

2008-06-13 Thread Josoroma
Cool, your tutorial is very helpful. I was wondering how to name tables, for example if i have the following problem, i need to tag posts and to tag user profiles in different tables, then im confuse how to name tables: posts posts_tags tags profiles profiles_??? ??? Or can i use something

Nested Tree - Managing differente category tables re-using code

2008-03-07 Thread Josoroma
I have the model, controller and views necessary to manage a nested set model using the tree behavior: http://bin.cakephp.org/view/1041355028 My table is categories. Now, i need to manage categories of products, services and events. Because of that i created the tables: productcategories

Indented Select(parent_id)

2008-02-09 Thread Josoroma
If i have the next groups table: DROP TABLE IF EXISTS `bm_groups`; CREATE TABLE `bm_groups` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(60) DEFAULT NULL, `parent_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) AUTO_INCREMENT=8; INSERT INTO `bm_groups` (`id`, `name`,

find(all) and preppend a third value using Combine

2008-02-07 Thread Josoroma
Im trying to generate a select list, but before the value Citiy.name i need to add Country.name like: Costa Rica - Heredia EEUU - New York $cities = $this-City-find('all', array('fields' = array('City.id', 'City.name', 'Country.name'), 'order'='City.country_id ASC')); My question is, how can i

Re: find(all) and preppend a third value using Combine

2008-02-07 Thread Josoroma
Thank you. $cities = $this-City-find('all', array('fields' = array('City.id', 'City.name', 'Country.iso2', 'Country.name'), 'order'='City.country_id ASC')); $citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s', '{n}.Country.iso2', '{n}.City.name'), '{n}.Country.name');

Re: TIP :: checkUnique on Update solution

2008-01-28 Thread Josoroma
Well, im using cake 1.2.x.x_01.01.2008, im using the checkunique function from tempdocs in the app_model.php and when i edit the data the unique fields doesn´t let me save the form. Any help is welcome. --~--~-~--~~~---~--~~ You received this message because you

TIP :: checkUnique on Update solution

2008-01-25 Thread Josoroma
I started to have problems when i was trying to checkDuplicate entries of fields in my models validations. I used on = create to check the unique value only in the creation but i need to check it in the update too. The problem with update is that the value already exist then your validation

Re: TIP :: checkUnique on Update solution

2008-01-25 Thread Josoroma
~GreyCells On Jan 25, 7:17 pm, Josoroma [EMAIL PROTECTED] wrote: I started to have problems when i was trying to checkDuplicate entries of fields in my models validations. I used on = create to check the unique value only in the creation but i need to check it in the update too

cakephp 1.2 :: Database prefix and tips about sanitize

2008-01-19 Thread Josoroma
I have an afterSave function inside a model, my two questions are: #1 How do i use the database prefix? #2 Do i need to sanitize $data['User']['username'] and $data['User'] ['id']? Thanks in advance. function afterSave(){ $data = $this-read(); $this-query('UPDATE `bm_aros` SET `alias` = \''

Events

2007-12-17 Thread Josoroma
I know how to create a very simple calendar app that let user to post events: title description category start_date end_date start_hour end_hour repetition(dayly-weekly-monthly-yearly) location_address email telephone fax Now i need some cool advice from you about which

actsAs Tree and actsAs Upload - Cakephp 1.2

2007-12-14 Thread Josoroma
I was playing with Tree behavior, now i can list, add, edit, delete and view categories an sub-categories without any problem. My new challenge is to upload a picture for each categeory in the Tree. Is possible taht my Category Model can actsAs tree and actsAs upload, if it is possible how do i

Edit action - Sanitize ID and Queries inside array(not strings)

2007-12-08 Thread Josoroma
Code example: Inside a edit action like: function edit($id = null) { Im calling generatetreelist like: $this-set('categoriesSelect', $this-Category-

Re: Tree Behavior :: Basic Usage :: Using cakephp 1.2.x.x_06.12.2007

2007-12-08 Thread Josoroma
Sorry! To avoid the forbidden message, you need to copy and paste each link directly in the browser. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Tree Behavior :: Basic Usage :: Using cakephp 1.2.x.x_06.12.2007

2007-12-08 Thread Josoroma
Im very motivated, now im starting to understand the cool Tree Behabior in Cake. Im going to share some of my code with you (i hope you contribute and fix what you think needs to be fixed). I can add and delete categories without problems, im still a newbee, any advice or comment is welcome.

Re: Dbdesigner :: hasAndBelongsToMany ER example

2007-12-07 Thread Josoroma
You must to copy and paste the url in the browser: http://www.sukialogic.com/cakephp/screen_capture/dbdesigner_habtm.png Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group,

Dbdesigner :: hasAndBelongsToMany ER example

2007-12-07 Thread Josoroma
Hi! Im stuck trying to undersatnd how to represent hasAndBelongsToMany using DbDesginer. -- hasOne 1:1 belongsTo 1:1 hasMany 1:n HasAndBelongsToMany ¿ ?

Re: Please review my way of saving a Associaton Model

2007-12-03 Thread Josoroma
Thanks Nate, Maritn, Just a few questions more: 1. How do i send or use $this-data inside the afterSave function in Model? 2. Do i have to use: $this-data['Report']['id'] = $this-Benchlink-getLastInsertId(); Before to save the second model or cakephp can automatically handle that? Thanks

Re: Search box

2007-11-27 Thread Josoroma
Using 1.2 In my index view: ?php echo $form-create('formFind', array('url' = 'index')); echo $form-input('find', array('value' = $findUrlNotCleaned, 'label' = 'Buscar',

Re: Search box

2007-11-27 Thread Josoroma
I clean a little bit the code :) This works for me, but my question is: Where do i have toi clean the data for this search, here in the controller or inside the model? function index() { $this-Benchlink-recursive = 0; uses('sanitize');

Please review my way of saving a Associaton Model

2007-11-24 Thread josoroma
In my benchlink_controller.php im saving the benchlink model data and the report model data associated. function add() { if (!empty($this-data)) { $this-cleanUpFields(); $this-Benchlink-create();

Baking Hierarchical Data

2007-03-15 Thread josoroma
Hi, I almost know how to manage a Hierarchical Data using Joomla. But now i want to start a Listing Directory project using cakePHP. I was wondering based on: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html AND http://cakeforge.org/snippet/detail.php?type=snippetid=26 if

Re: ACL one user in multiple groups

2007-02-27 Thread josoroma
Now reading: http://www.xaprb.com/blog/2006/08/16/how-to-build-role-based-access-control-in-sql/ http://www.xaprb.com/blog/2006/08/18/role-based-access-control-in-sql-part-2/ Will be great to create together the models, controllers and views to create an admin part first to create groups,

Re: Access control lists :: Creating groups using acl.php script

2007-02-25 Thread josoroma
Thanks scragz. - My ARO model change a little bit: - [1]Frontend [6]Members [2]Backend [3]Moderators [4]Managers [5]Administrators

Access control lists :: Creating groups using acl.php script

2007-02-23 Thread josoroma
I was wondering how to create parent groups or child groups using acl.php script, for example, i just used php acl.php initdb and every table was created well. Then i used: php acl.php create aro 0 null Users php acl.php create aro 0 null Members and those groups were created without

How to select a country in user table

2007-02-22 Thread josoroma
I was learning cake with the IBM tutorials, and everything is working nice, is a piece of art, a piece of cake. My question, what can i have to add an use in: model, controller and view to add a select of Country in a user table? Cuz, a user can edit the information later, how to show the