How to implement comments in cakephp 2.0.3

2013-04-15 Thread raj kumar Pustela
Hi all,
  If any one konw how to implement comments in cakephp 2.0.3, 
please replay me.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




changing table fields value for all found in the list

2013-04-15 Thread Chris
hi guys,... can anyone help please,... 
I have a photos table where I want to change privacy settings for all 
photos with one click,... however it only change value for the first photo 
on the list ( where I have 9 photos). here is my links and function for 
private,... what am I doing wrong,...? 

?php echo $html-link(ucfirst(__('set Public', true)), 
'/photos/set_public/' . $user_obj['User']['id'], array('style' = 
'font-weight: bold;')) ? 
?php echo $html-link(ucfirst(__('set Friend', true)), 
'/photos/set_friend/' . $user_obj['User']['id'], array('style' = 
'font-weight: bold;')) ? 
?php echo $html-link(ucfirst(__('set Private', true)), 
'/photos/set_private/' . $user_obj['User']['id'], array('style' = 
'font-weight: bold;')) ? 


  function set_private($id = null)
  {
$this-authorize();

if(!($user = $this-User-findById($id)))
{
  $this-flash('error', ucfirst(i18n::translate('usermmm not found')));
  $this-redirect('/not_found');
}
elseif(!($user['User']['token'] == NULL))
{
  $this-flash('error', ucfirst(i18n::translate('userddd not found')));
  $this-redirect('/not_found');
}

else
{

  $this-authorize($user['User']['id']);

$photos = $this-Photo-find('all', array('conditions' = 
array('Photo.user_id' = $user['User']['id'])));

  $this-set('photos', $photos);

 foreach ($photos as $photo)
{
 $this-Photo-query('UPDATE fociki_photos SET privacy = 2 WHERE id = ' . 
$photo['Photo']['id']);
   $this-flash('valid', ucfirst('your photos privacy set to 
private.'));
  $this-redirect($_SERVER['HTTP_REFERER']);
}


  $this-set('user_obj', $user);

}

  }
  
thanks in advance 
chris 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Filling in a drop down box - comments on code please

2013-04-15 Thread raj kumar Pustela


On Monday, March 12, 2012 5:32:14 PM UTC+5:30, Graham wrote:

 Dear All. I would like some advice please. I am new to CakePHP and so far 
 I am loving it. I am keen to do things the “right way” so I am interested 
 in any comments.

  

 What I describe in the following I have working. I am interested in 
 knowing if I have gone about it the right or wrong way.

  

 I have a table with a varchar field that I want to complete with data from 
 another table – my choices table. There is no connection between the two 
 tables.

  

 In my controller I have the following:

  

   App::import('Model', 'Choice');

   $tmpChoice = new Choice();

  

   $titles = $tmpChoice-find('list', array(

   'fields' = array('item', 'item'),

   'conditions' = array('cat' = 'title'),

   'recursive' = 0

   ));

   $this-set(compact('titles'));

  

 I have this in my view:

  

  echo $this-Form-input('title', 
 array('type'='select','options'=$titles));

  

 Above, I needed to instantiate the Choice model class to make it available 
 to my code. When I used:

  

 $titles = $this-MainTable-Choice-find('list',…

  

 I received an error saying that I was trying to execute a function of an 
 object that isn’t a class. I resorted to my above code to resolve the error.

  

 The “fields” array specifies “('item', 'item')”. This I did so that I 
 could have the value and the option the same – I didn’t want to insert the 
 id key into the database, I wanted the text. The “conditions” statement is 
 present so that I can select the appropriate category of choices.

  

 Thanks for looking at this and making any comments about the code.

  

 With regards

  

 Graham Jones


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CKEditor and model validation

2013-04-15 Thread Chris
hi frederik,... thank you for your reply,... 
however 'required' = false did not help me,... I have a validation rule 
set in a controller function: 

  if(empty($this-data))
  {
echo 'div class=clr/div';
echo 'div  style=font-size: 1.2em; font-weight: bold; margin: 
10px; auto 0 auto; text-align: center; color: red;';
 echo 'unexpected';
echo '/div';
echo 'div class=clr/div';
 $response = $this-requestAction('/photo_comments/ajax_show' .'/'. 
$photo['Photo']['id'], array('return'));
echo $response; 
die();
  }
  elseif(empty($this-data['PhotoComment']['content']))
  {
echo 'div class=clr/div';
echo 'div  style=font-size: 1.2em; font-weight: bold; margin: 
10px; auto 0 auto; text-align: center; color: red;';
 echo 'please fill in your comments';
echo '/div';
echo 'div class=clr/div';
 $response = $this-requestAction('/photo_comments/ajax_show' .'/'. 
$photo['Photo']['id'], array('return'));
echo $response; 
die();
  }

submitting data not getting thru,... getting response from echo 'please 
fill in your comments'; what that means is my data can't get thru,... 

thanks 
chris 


On Sunday, April 14, 2013 12:54:42 PM UTC-7, frederikjacques wrote:

 Hi Chris,

 I've written a blog post about this issue with sample code.
 You can read it here 
 http://blog.the-nerd.be/2013/04/add-ckeditor-to-cakephp-with-model-validation/

 Cheers,
 Frederik

 On Saturday, April 13, 2013 8:35:42 PM UTC+2, Chris wrote:

 hi frederik,... 
 I have a problem submitting with ckeditor,... this is my form,... but its 
 not passing content to controller,... 

 ?php echo $this-Html-script('ckeditor/ckeditor'); ?

 p style=display: block; font-size: 1.2em; text-align: left;
 ?php  echo $this-Form-textarea('content', array('rows' = '3', 'cols' 
 = '5', 'class' = 'ckeditor')); ?
 /p

 can you share with us please,... 
 thanks in advance 
 chris

 On Saturday, April 13, 2013 9:11:15 AM UTC-7, frederikjacques wrote:

 Hi all,

 I was wondering how you can use CKEditor and the model validation array.
 I got my textareas changed to CKEditors, but now my validation fails. 
 If I remove a rule like non-empty everything works again, but I would 
 rather keep my validation rules :-)

 Cheers,
 Frederik



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Records search using CakeDC/search

2013-04-15 Thread euromark
I would use string array keys:

public $filterArgs = array(
'name' = array('type' = 'query', 'method' = 'filterName'),
);

but both ways should work

PS: echo $this-Form-create('Patient') is enough, as it automatically 
posts to itself



Am Montag, 15. April 2013 07:44:40 UTC+2 schrieb Muhammad Asyraf:

 Actually i already Google several search plugin for CakePHP but most of 
 CakePHP user recommended search plugin from CakeDC. So, i download the 
 plugin from https://github.com/dereuromark/search and load the plugin 
 with code: CakePlugin::load('Search'); in bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] = 
 $this-Patient-parseCriteria($this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' = 
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are 
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name 
 from table patients. However, this code seems not working but in the URL, 
 once i do searching for example i John as the search term, the URL bar 
 show as patients/find/name:john but the list of record are not showing john 
 record only but still show all records instead of john only. 

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with 
 the codes or any depreciate attributes in the coding? Sorry if this 
 question repeated in this group but i still unable to find any solution. 
 Most of the user claimed that it is easy to use this plugin but i'm still 
 new in CakePHP. Hope someone can help me. 

 Thanks :)



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to implement comments in cakephp 2.0.3

2013-04-15 Thread Soumavo Chatterjee
Comment Means are u talking about blog? then keep the whole blog in
app/webroot directory and modify the htacess on it.


On Mon, Apr 15, 2013 at 2:04 PM, raj kumar Pustela pustela...@gmail.comwrote:

 Hi all,
   If any one konw how to implement comments in cakephp 2.0.3,
 please replay me.

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
*Regards

-- 
Soumavo Chattaraj

Sr. Application Programmer | Web Spiders

Mobile No: +91 9933561534 / +91 9330662099 /

EmailID: soumavo.chatta...@webspiders.com/soumavo...@gmail.com

Web Spiders India Pvt. Ltd.
Matrix Tower,
8th and 9th Floor,
Plot No DN-24, Sector - V,
Salt Lake City,
Kolkata-700091,
India.

Phone: +91.33.4011.0900 / 53 | Fax: +91.33.4011.0939
URL: www.webspiders.com |
Twitter: twitter.com/Web_Spiders | Facebook: facebook.com/webspidersgroup |
LinkedIn: linkedin.com/company/web-spiders
| The Leading Rich Mobile  Web Engineering Company***

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Download file

2013-04-15 Thread Rodrigo Mourão
Hi Muhammad,

It is more simple than in cakephp 1.3.

After 2.3, you only need to put the command bellow on action of your
controller.

$this-response-file('/full_path/to/yourfile.jpg');
return $this-response;





** **

*Rodrigo Mourão*

*Webjump internet  social media*

rodr...@webjump.com.br • www.webjump.com.br

Rua Prof. Artur Ramos, 241 • conj. 52 • SP

Fone (11) 2338.6889



2013/4/14 Muhammad Asyraf asyraf1...@gmail.com

 Actually, im on CakePHP 2.3...i read the documentation but confused on how
 to implement it. Sorry, im totally new with CakePHP..

 On Monday, April 8, 2013 11:41:10 PM UTC+8, Muhammad Asyraf wrote:

 Based from tutorial at http://www.tuxradar.com/**
 content/cakephp-tutorial-**build-file-sharing-applicationhttp://www.tuxradar.com/content/cakephp-tutorial-build-file-sharing-application
 ** , i manage to upload file and it capture the filename, filesize and
 filemime without any error but when download the file, it will produce
 wrong file mime for example, the file mime should be .jpg but in Google
 chrome it will be .htm and in IE it only download file with the name but no
 extension for that file. it seem something wrong with the controller codes.

 function download($id = null) {
 if (!$id) {
 $this-Session-setFlash(__('**Invalid id for upload', true));
  $this-redirect(array('action' = 'index'));
 }
 $this-Upload-bindModel(**array('hasOne' = array('UploadsUser')));
  $upload = $this-Upload-find('first', array(
 'conditions' = array(
 'Upload.id' = $id,
  'OR' = array(
 'UploadsUser.user_id' = $this-Auth-user('id'),
 'Upload.user_id' = $this-Auth-user('id'),
  ),
 )
 ));
 if (!$upload) {
  $this-Session-setFlash(__('**Invalid id for upload', true));
 $this-redirect(array('action' = 'index'));
  }
 $this-viewClass = 'Media';
 $filename = $upload['Upload']['filename'];
  $this-set(array(
 'id' = $upload['Upload']['id'],
 'name' = substr($filename, 0, strrpos($filename,'.')),
  *'extension' = substr(strrchr($filename,'.'), 1),*
 'path' = APP.'uploads'.DS,
  'download' = true,
 ));
 }


 Based on the codes, maybe the extension have problem. Anyone can help?
 thanks...

  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/cake-php/qv_ARaVAU4Q/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to
 cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


image001.gif

Re: Records search using CakeDC/search

2013-04-15 Thread Muhammad Asyraf
I've made the amendment to the code but still the result are same. no 
search result produced and i notice there is warning on top of the page say:

 Notice (8): Indirect modification of overloaded property 
PatientsController::$paginate has no effect 
[APP\Controller\PatientsController.php, line 14] 

where the code that caused the notice to appear is:

 $this-paginate['conditions'] = 
$this-Patient-parseCriteria($this-passedArgs);

is there any other codes that i've missed? Thanks a lot :)
 
On Monday, 15 April 2013 18:07:18 UTC+8, euromark wrote:

 I would use string array keys:

 public $filterArgs = array(
 'name' = array('type' = 'query', 'method' = 'filterName'),
 );

 but both ways should work

 PS: echo $this-Form-create('Patient') is enough, as it automatically 
 posts to itself



 Am Montag, 15. April 2013 07:44:40 UTC+2 schrieb Muhammad Asyraf:

 Actually i already Google several search plugin for CakePHP but most of 
 CakePHP user recommended search plugin from CakeDC. So, i download the 
 plugin from https://github.com/dereuromark/search and load the plugin 
 with code: CakePlugin::load('Search'); in bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] = 
 $this-Patient-parseCriteria($this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' = 
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are 
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name 
 from table patients. However, this code seems not working but in the URL, 
 once i do searching for example i John as the search term, the URL bar 
 show as patients/find/name:john but the list of record are not showing john 
 record only but still show all records instead of john only. 

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with 
 the codes or any depreciate attributes in the coding? Sorry if this 
 question repeated in this group but i still unable to find any solution. 
 Most of the user claimed that it is easy to use this plugin but i'm still 
 new in CakePHP. Hope someone can help me. 

 Thanks :)



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Simple Search Engine

2013-04-15 Thread Reza Talamkhani
hi,

I need my website search all content about user query...
contents that be searched is news table, articles table, etc.

I do'nt know how to implement this that easiest  local search...

please help me.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




DebugKit.Toolbar

2013-04-15 Thread Dr. Drijk
cakePHP 2.3.2
DebugKit 2.2

Since i upgraded cake from 2.0 to 2.3.2 and the DebugKit tot 2.2 the 
DebugKit.Toolbar won't work properly.
I want the plugin to be available for each application, so I copied the 
content of the plugin in 
\cakePHP\Plugins\  in stead off \app\plugin\
I didn(t change appcontroller.

when opening localhost/cakephp/ all works well, but when i open 
localhost/myApp/ there is no toolbar at the top of the page, but visible as 
continuous text.
Fine all I need to know is in there, but it far away from usefull.

any suggestions?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




find all users from another table

2013-04-15 Thread Chris
hi guys,... can anyone help please,... 

I have a PhotoLike table where I have user_id field . I'll like to find all 
users from User table in PhotoLike (list) 

I got 2 users like photo,... I got a list array from PhotoLike which is 
fine: 

Array
(
[59] = 59
[48] = 48
)

next I want to find ALL users in User.id from PhotoLike.user_id 
I'm getting this error finding users: 
Undefined index:  PhotoLike [APP/controllers/photos_controller.php, line 
1161] 

this is my photos_controller.php 

  function likes($id = null)
  {
  if(!($photo = $this-Photo-findById($id)))
  {
$this-flash('error', ucfirst(i18n::translate('photo not found')));
$this-redirect('/not_found');
  }

  $this-set('photo_likes', $photo_likes = 
$this-PhotoLike-find('list', array('conditions' = 
array('PhotoLike.photo_id' = $photo['Photo']['id']), 'order' = 
array('PhotoLike.created' = 'DESC';
   debug($photo_likes);

  $this-set('photo_like_users', $photo_like_users = 
$this-User-find('all', array('conditions' = array('User.id' = 
$photo_likes['PhotoLike']['user_id']) )));
   debug($photo_like_users);
  }

thanks in advance 
chris 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cakephp with jquery datatable

2013-04-15 Thread Josh
Hi.. how did you use jquery datatables in cakephp?


On Wednesday, October 31, 2012 7:33:49 PM UTC-6, Panda Taruma wrote:

 iI am using jquery datatable. successfully .. 
 but the data show a maximum of 100 rows.. anybody can share to me??


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Records search using CakeDC/search

2013-04-15 Thread lowpass
You can get rid of that notice by declaring the $paginate array as a class
var:

public $paginate = array();
public $components = ...


On Mon, Apr 15, 2013 at 8:22 AM, Muhammad Asyraf asyraf1...@gmail.comwrote:

 I've made the amendment to the code but still the result are same. no
 search result produced and i notice there is warning on top of the page say:

  Notice (8): Indirect modification of overloaded property
 PatientsController::$paginate has no effect
 [APP\Controller\PatientsController.php, line 14]

 where the code that caused the notice to appear is:

  $this-paginate['conditions'] =
 $this-Patient-parseCriteria($this-passedArgs);

 is there any other codes that i've missed? Thanks a lot :)


 On Monday, 15 April 2013 18:07:18 UTC+8, euromark wrote:

 I would use string array keys:

 public $filterArgs = array(
 'name' = array('type' = 'query', 'method' = 'filterName'),
 );

 but both ways should work

 PS: echo $this-Form-create('Patient') is enough, as it automatically
 posts to itself



 Am Montag, 15. April 2013 07:44:40 UTC+2 schrieb Muhammad Asyraf:

 Actually i already Google several search plugin for CakePHP but most of
 CakePHP user recommended search plugin from CakeDC. So, i download the
 plugin from 
 https://github.com/**dereuromark/searchhttps://github.com/dereuromark/search
  and
 load the plugin with code: CakePlugin::load('**Search'); in
 bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] = $this-Patient-parseCriteria(**
 $this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' =
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('**Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name
 from table patients. However, this code seems not working but in the URL,
 once i do searching for example i John as the search term, the URL bar
 show as patients/find/name:john but the list of record are not showing john
 record only but still show all records instead of john only.

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with
 the codes or any depreciate attributes in the coding? Sorry if this
 question repeated in this group but i still unable to find any solution.
 Most of the user claimed that it is easy to use this plugin but i'm still
 new in CakePHP. Hope someone can help me.

 Thanks :)

  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Records search using CakeDC/search

2013-04-15 Thread lowpass
What does the resulting query look like? Does it include the condition with
the submitted name?


On Mon, Apr 15, 2013 at 1:44 AM, Muhammad Asyraf asyraf1...@gmail.comwrote:

 Actually i already Google several search plugin for CakePHP but most of
 CakePHP user recommended search plugin from CakeDC. So, i download the
 plugin from https://github.com/dereuromark/search and load the plugin
 with code: CakePlugin::load('Search'); in bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] =
 $this-Patient-parseCriteria($this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' =
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name
 from table patients. However, this code seems not working but in the URL,
 once i do searching for example i John as the search term, the URL bar
 show as patients/find/name:john but the list of record are not showing john
 record only but still show all records instead of john only.

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with
 the codes or any depreciate attributes in the coding? Sorry if this
 question repeated in this group but i still unable to find any solution.
 Most of the user claimed that it is easy to use this plugin but i'm still
 new in CakePHP. Hope someone can help me.

 Thanks :)

  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Records search using CakeDC/search

2013-04-15 Thread Muhammad Asyraf
It works now! thank you so much euromark and cricket!!! really appreciate 
your help man! Just a single line of code can solve the problem. nice! 

On Tuesday, 16 April 2013 07:09:01 UTC+8, cricket wrote:

 You can get rid of that notice by declaring the $paginate array as a class 
 var:

 public $paginate = array();
 public $components = ...


 On Mon, Apr 15, 2013 at 8:22 AM, Muhammad Asyraf 
 asyra...@gmail.comjavascript:
  wrote:

 I've made the amendment to the code but still the result are same. no 
 search result produced and i notice there is warning on top of the page say:

  Notice (8): Indirect modification of overloaded property 
 PatientsController::$paginate has no effect 
 [APP\Controller\PatientsController.php, line 14] 

 where the code that caused the notice to appear is:

  $this-paginate['conditions'] = 
 $this-Patient-parseCriteria($this-passedArgs);

 is there any other codes that i've missed? Thanks a lot :)

  
 On Monday, 15 April 2013 18:07:18 UTC+8, euromark wrote:

 I would use string array keys:

 public $filterArgs = array(
 'name' = array('type' = 'query', 'method' = 'filterName'),
 );

 but both ways should work

 PS: echo $this-Form-create('Patient') is enough, as it automatically 
 posts to itself



 Am Montag, 15. April 2013 07:44:40 UTC+2 schrieb Muhammad Asyraf:

 Actually i already Google several search plugin for CakePHP but most of 
 CakePHP user recommended search plugin from CakeDC. So, i download the 
 plugin from 
 https://github.com/**dereuromark/searchhttps://github.com/dereuromark/search
  and 
 load the plugin with code: CakePlugin::load('**Search'); in 
 bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] = $this-Patient-parseCriteria(*
 *$this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' = 
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are 
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('**Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name 
 from table patients. However, this code seems not working but in the URL, 
 once i do searching for example i John as the search term, the URL bar 
 show as patients/find/name:john but the list of record are not showing 
 john 
 record only but still show all records instead of john only. 

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with 
 the codes or any depreciate attributes in the coding? Sorry if this 
 question repeated in this group but i still unable to find any solution. 
 Most of the user claimed that it is easy to use this plugin but i'm still 
 new in CakePHP. Hope someone can help me. 

 Thanks :)

  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Records search using CakeDC/search

2013-04-15 Thread Muhammad Asyraf
currently the searching only for searching for name field. the result only 
select the name that equivalent to the search query. now i try to create 
condition for example like search based on name and gender. need to figure 
out how to do that.hmmm 

On Tuesday, 16 April 2013 07:14:46 UTC+8, cricket wrote:

 What does the resulting query look like? Does it include the condition 
 with the submitted name?


 On Mon, Apr 15, 2013 at 1:44 AM, Muhammad Asyraf 
 asyra...@gmail.comjavascript:
  wrote:

 Actually i already Google several search plugin for CakePHP but most of 
 CakePHP user recommended search plugin from CakeDC. So, i download the 
 plugin from https://github.com/dereuromark/search and load the plugin 
 with code: CakePlugin::load('Search'); in bootstrap.php

 Then i implement the code for my file controller:

 public $components = array('Search.Prg');
 public $presetVars = true; // using the model configuration
 public function find() {
 $this-Prg-commonProcess();
 $this-paginate['conditions'] = 
 $this-Patient-parseCriteria($this-passedArgs);
 $this-set('patients', $this-paginate());
 }
 *
 *
 *
 *
 For the model, i put this code:

 public $actsAs = array('Search.Searchable');
 public $filterArgs = array(
 array('name' = 'name', 'type' = 'query', 'method' = 
 'filterName'),
 );

 public function filterName($data, $field = null) {
 if (empty($data['name'])) {
 return array();
 }
 $nameField = '%' . $data['name'] . '%';
 return array(
 'OR' = array(
 $this-alias . '.name LIKE' = $nameField,
 ));
 }

 For the view (find.ctp), i put this code for the form: (others code are 
 exactly same as view/index.ctp)

 div?php
 echo $this-Form-create('Patient', array(
 'url' = array_merge(array('action' = 'find'), $this-params['pass'])
 ));
 echo $this-Form-input('name', array('div' = false));
 echo $this-Form-submit(__('Search'), array('div' = false));
 echo $this-Form-end();
 ?/div


 What i try to achieve is the search plugin will do searching for name 
 from table patients. However, this code seems not working but in the URL, 
 once i do searching for example i John as the search term, the URL bar 
 show as patients/find/name:john but the list of record are not showing john 
 record only but still show all records instead of john only. 

 As for the information i use CakePHP ver: 2.3.1. Is it any problem with 
 the codes or any depreciate attributes in the coding? Sorry if this 
 question repeated in this group but i still unable to find any solution. 
 Most of the user claimed that it is easy to use this plugin but i'm still 
 new in CakePHP. Hope someone can help me. 

 Thanks :)

  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




A more advanced use of ACL?

2013-04-15 Thread Henry Turk
You could query the AroAco model to get a list of the ACOs that specific ARO 
has access to and thus is able to grant access to. 

You said you have a few ways of implementing this that don't need to implement 
ACL.. Why not go that route? No need to over complicat etchings IMO. 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.