Re: How to output UTF-8 sign?

2010-05-02 Thread sebb86
John

Thanks a lot for all your help and that you spending time on this.
If anyone else need the source code:
(additions: column number in every column header, renamed column
headers)
[code]
 'sort_none', 'hardware_unit_id' =>
'sort_none', 'description' => 'sort_none'); ?>


params['named']['direction'])
{
  $sortable[$this->params['named']['sort']] = 'sort_'.$this-
>params['named']['direction'];
}  ?>



  
[Optionen]
 $sortCssClass): ?>
  sort($viewName[$colNumb-1], $sortFieldName, array('class' =>
$sortCssClass)); ?>
  

  
...
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-30 Thread sebb86
Well, I don't know at which position in the source code, i have to
reset it.
I would reset with this source code: $sortCssClass = 'sort_none';
I think, i need to know, which column header is clicked and then i
have to reset all others.
Could you give me a last hint please?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-26 Thread sebb86
Hmm, should it be easy to reset the sort direction?
I don't know at which position in the source code, i have to reset it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-26 Thread sebb86
Thank you for making an example!
But in my case, i have more than one column to make sortable. In your
example, when i click on one table header to sort, all table headers
show the same arrow, what is wrong :/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-22 Thread sebb86
Hello again and thanks.
I got an arrow in my column header. But its every time (asc or desc)
the same arrow, so i think, the paginate source code is still wrong.
My problem is still, that i dont know how to combine two classes in
one paginate function.

[code dont works]
sort('id', 'id', array('class' => 'asc'),
array('class' => 'desc'));  ?>
[/code]

[code also dont works]
sort(array('id', 'id'), 'id', array('class' =>
'asc', 'class' => 'desc'));  ?>
[/code]

Do you have a last hint for me?
Regards.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks.
I got an arrow in my column header. But its every time (asc or desc)
the same arrow, so i think, the paginate source code is still wrong.
My problem is still, that i dont know how to combine two classes in
one paginate function.

[code dont works]
sort('id', 'id', array('class' => 'asc'),
array('class' => 'desc'));  ?>
[/code]

[code also dont works]
sort(array('id', 'id'), 'id', array('class' =>
'asc', 'class' => 'desc'));  ?>
[/code]

Do you have a last hint for me?
Regards.

//addition:
when i move the mouse over the table cell with paginate, the arrow
disappears. But he should stay visible.
I checked out CSS "display" and "visibility" but that dont helps :/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks.
I got an arrow in my column header. But its every time (asc or desc)
the same arrow, so i think, the paginate source code is still wrong.
My problem is still, that i dont know how to combine two classes in
one paginate function.

[code dont works]
sort('id', 'id', array('class' => 'asc'),
array('class' => 'desc'));  ?>
[/code]

[code also dont works]
sort(array('id', 'id'), 'id', array('class' =>
'asc', 'class' => 'desc'));  ?>
[/code]

Do you have a last hint for me?
Regards.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-21 Thread sebb86
Okay, thats the reason. I have to much standard definitions in the
cake.generic.css. It would take me to much time to change all this.
But inspite of this, i used some of your definitions! :-)
I'm new to CSS (and also to CakePHP), so some source code was very
usefull for me.

Thanks a lot for all this help and your patiance ;-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello and sry that i have to ask again.
But i dont know, what the correct syntax for the pagination is.
At the moment i have:
[code]
sort(array('asc' =>'id v', 'desc' =>'id ^'),
'id'); ?>
[/code]

How do i get class definitions inside?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-20 Thread sebb86
John

Thanks a lot for all your help.
In your example, is the cake.generic.css file the original?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-20 Thread sebb86
Addition:
[code]
↑
[/code]

also works. But also _not_ inside the paginate source code.
Any ideas?

Thanks if someone can help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-20 Thread sebb86
Okay, its done.

Firefox solution:
[code]
.input
{
  width:45em;
  float:none;
}

.input label
{
  width:25%;
  float:left;
}

.input input
{
  width:50%;
}
[/code]


Internet Explorer 8 solution:
[code]
.input
{
  width:45em;
  float:none;
}

.input label
{
  width:25%;
  float:none;
}

.input input
{
  width:50%;
}
[/code]

Addition: maybe i've changed some source code in the cake.generic.css
file.
Unfortunately i cant find a solution for both, but its okay...

Thanks a lot John!!!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-19 Thread sebb86
> Do I understand you correctly, that you don't want the other fields
> (name, index, status, etc.) to have the label aligned horizontally
> with the input field?

I want, that fields like "Name" or "Duplex" look equal to fields like
"VLAN" or "Uplink".
That means, the i want the label on the left and next to it ( _not_
below the label) the input field.

When i change the value you mentioned, only the length of the input
field decreases.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-19 Thread sebb86
Hello John,

thank you very much!

With this code, it looks like in the following screenshot:
[code]
.input
{
  width:45em;
  float:left;
}

.input label
{
  width:25%;
  float:left;
}

.input input
{
  width:75%;
  float:left;
}

.input input[type=checkbox]
{
float: none;
width: 0em;
}
[/code]

Screenshot: http://www.zshare.net/image/751380505863bb50/

So my last question is, how can i make a word-wrap for "common" input
fields?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-19 Thread sebb86
Thanks. It works when i write:
[code]

[/code]

But _NOT_ with paginate:
[code]
sort(array('asc' =>'id v', 'desc' =>'id
↑'), 'id');
[/code]

What's wrong there?

Regards.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-18 Thread sebb86
Hello again John,

this outputs a strange sign: ࢏
Seems like its the arrows hex code.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form->input) - Disable word wrap?

2010-04-18 Thread sebb86
John

Hello,
thank you. I had a similar idea. But how do i code this?

[my css code]
#input
{
  float:left;
}
[/code]

[view code]
echo $form->input('db_field', array('label' => 'Label', 'maxLength' =>
'20%', 'div' => array('id' => 'input')));
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to output UTF-8 sign?

2010-04-18 Thread sebb86
Hello,
my charset is set to UTF-8.
But how do i output a UTF-8 sign inside PHP?

For example an arrow (U+2191) in a table cell:
[code]
sort(array('asc' =>'id U+2193', 'desc'
=>'id U+2191'), 'id');  ?>
[/code]

regards and thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


View (form->input) - Disable word wrap?

2010-04-18 Thread sebb86
Hello,

when i create my automagic form elements, they look like:

label // ---> new line
empty text field

Can i disable this word wrap?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-16 Thread sebb86
The solution was an empty array

[dynamic code]
link($html->image("delete.png", array("alt" =>
"Löschen")), array("controller" => $contr, "action" => "delete",
$row[$class]['id']), array(), sprintf(__($deleteQuestion, true),
$row[$class]['id']), null, false); ?>
[/code]

Really thanks a lot to all helpers!! thanks thanks
thanks :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-16 Thread sebb86
cricket

Also thanks to you. It dont works in both browsers. Dont know why.
Anyway... i decided that i dont use CSS for this. I got it working so
far but i still have one problem.

[this code works (without the CSS class, but its okay]
image("edit.png", array("alt" => "Editieren", 'url'
=> array('controller' =>  'dns_names', 'action' => 'edit',
$dns_name['DnsName']['id']))); ?>
[/code]

The last problem: I want to use the same source code for me delete
button. But how can i include my confirm message in the following
code:
[delete code]
image("delete.png", array("alt" => "Delete", 'url'
=> array('controller' => 'dns_names', 'action' => 'delete',
$dns_name['DnsName']['id']))); ?>
[/code]

[code confirm message]
sprintf(__($deleteQuestion, true), $dns_name['DnsName']['id']
[/code]

Thanks a lot to all
helpers!!! :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-16 Thread sebb86
Addition:
I'm really sorry but i forgot my self defined css... :(
So this works for Firefox:
[code]
link('Edit', array("controller" => 'dns_names',
"action" => "edit", $dns_name['Dnsname']['id']), array('class' =>
'edit', "title" => "Editieren"), null, false); ?>
[/code]

And when i remove: " array('class' => 'edit', "title" => "Editieren")
" it works also for the internet explorer, but without image. So i
think this is the problem. Is there maybe a syntax error?
[this code works, but without the image]
link('Edit', array("controller" => 'dns_names',
"action" => "edit", $dns_name['Dnsname']['id']), null, false); ?>
[/code]

[my css code]
a.edit
{
  text-indent:-5000px;
  display:inline-block;
  width:24px;
  height:29px;
  background:transparent url(/img/edit.png) no-repeat 0 0;
}

a.edit:hover
{
  background-position:0px 5px;
}
[/code]

It would be very very very brilliant if someone could solve this.
I spend so much hours on this :(

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-16 Thread sebb86
Another addition:
When i only insert the image, without the $html->link, it works in
internet explorer 8.

[code works but without link]
image("edit.png", array("alt" => "Editieren")); ?>
[\code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
Hello again and really thank you cricket and John!

< OK. Copy the HTML source and paste it directly into the view and see
< if the image & link are accessible inside the table.

Same as before. When i substitute the variables it works fine in
Firefox but _not_ in Internet Explorer :/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
Yes, i see it.
When i copy the element outside the table, it works fine.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
cricket

Do  you mean the code should be:
[code]
link($html->image("edit.png", array("alt" =>
"Editieren")), array("controller" => $contr, "action" => "edit",
$row[$class]['id']), array('class' => 'edit', "title" => "Editieren"),
null, false); ?>
[/code]

Then it creates the following
[html source code:]
 
[/code]

This looks better than before but it still dont works.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
sure :-)

[HTML Code for the table cell:]
Editieren 
[/code]

Addition: When i copy the element outside the table, it works fine.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
Hello,
thanks for the suggestion.
I just compared it. The source code is the same.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Internet Explorer error! (Want to show element in a table cell) :-(

2010-04-15 Thread sebb86
Hello,
i want to show an element in a table cell.

[element code]
link($html->image("edit.png", array("alt" =>
"Editieren")), array("controller" => $contr, "action" => "edit",
$row[$class]['id']), array('class' => 'edit', "title" => "Editieren"),
false); ?>
[/code]

[code in view]
element('options', array( "contr" =>
'dns_names', "class" => 'DnsName', "row" => $dns_name)); ?>
[/code]

This works in Firefox 3.6 but not in my Internet Explorer 8. Do
somebody know why it dont works?
Mybe it needs some CSS attributes like "position" or something else?

Thanks a lot! I spend lots of hours but cant get it working :(

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: How to pass a variable from a view to the associated controller?

2010-04-09 Thread sebb86
Ok. I made it working.

[controller code]
function view($temp, $value)
{
$this->set('persons', $this->paginate('Person', array('Person.'.
$temp => $value)));
}
[/code]

[view code for one table cell (in this example the table cell for
column "forename")]

link($row['Person']['forename'],
array('controller' => 'persons', 'action' => 'view', $temp, $value)); ?
>
[/code]

It there a better / nicer way to do this?
Thanks :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


How to pass a variable from a view to the associated controller?

2010-04-09 Thread sebb86
Hello,
how can i pass a variable from a view to the associated controller? I
need this because i want to reload the view with other values for
paginate.
I'd like to do this inside "html->link". The two variables are named
"value" and "temp".
"temp" should contain the database field in the suitable form, that i
can insert it correct. "value" cotains the value for paginate.

[some controller code]
$this->paginate('Person', array('Person."$temp"' => $value))
[/code]

[view code]
link($row['Person']['forename'],
array('controller' => 'persons', 'action' => 'view', "forename" =>
$temp, $row['Person']['forename'] => $value)); ?>
[/code]

I don't get it working. :(
Thanks if someone can help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: UTF-8 website problem (database encoding works)

2010-04-07 Thread sebb86
Martin, cricket

Thanks for your help. The problem is solved. I made failures with the
editor.
I opened every file and choose "UTF-8 without BOM" and thought, that
at this point, the file is UTF-8 converted. This is wrong.
I have to open every file and use "Convert to UTF-8 without BOM".
Sorry for such a mistake... :-(

Well, anyway thanks a lot!
Maybe others will help it.

Regards.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: UTF-8 website problem (database encoding works)

2010-04-07 Thread sebb86
Martin, cricket

Hello,

> > Assume you are using mysql --> yes
> > 1) Make sure you have add this to database.php default array 
> > config:'encoding' => 'utf8' --> done
> > 2) Make sure the table collation is utf (could be uft8_general_ci) --> 
> > done
> > 3) Make sure the table is empty --> everything is ok with the data i 
> > save or retrieve

> > SET NAMES 'utf8'; --> yes, i use this option in when i insert data via 
> > mysql, it works.

So, everything is alright with my database. UFT-8 works with my MySQL
database since i've added "encoding => utf8" to my database.php.
The problem appears on the other parts of the website. To exactly see
the problem, please look at my screenshot: 
http://www.zshare.net/image/747107826f2db2a2/
On the screenshot, "green" is okay, "red" is a failure. The language
is german.

Thanks a lot for helping me!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: UTF-8 website problem (database encoding works)

2010-04-07 Thread sebb86
Martin

Thank you for helping me!

When i do what you suggest, i see the special chars. ("echo 'áéíóúñ£
€';")
But, in your message, i dont see this characters. i only see it in the
e-mail, which i get when someone put a message here.

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


UTF-8 website problem (database encoding works)

2010-04-06 Thread sebb86
Hello,
instead of umlauts, i see only signs on my website. I think the
problem occurs because i developed with Windows 7 with a tool which is
not UTF-8 compatible and later, i moved the needed files to Ubuntu. To
solve this, i downloaded the Notepad++ Editor. Then i opened all files
and checked "Encode in UTF-8 without BOM" respectively "Convert to
UTF-8 without BOM". But the problem is still present.

My database encoding works with uft-8 (encoding option in database.php
made it possible).

What i've tryed:

- inside my default.ctp layout file:
[code]

[/code]
and inside of :
[code]
charset(utf-8); ?>
[/code]

- inside my core.php file:
[code]
Configure::write('App.encoding', 'UTF-8');
[/code]

Apache2 is also set to UTF-8.

I spend about 2 days and cant solve this :(
I'm so frustrated. :/

Can someone help me out of this?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: check if foreign key is used in other tables before delete data row

2010-04-04 Thread sebb86
Great! Thanks again! :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: check if foreign key is used in other tables before delete data row

2010-04-04 Thread sebb86
John

Thank you very much.
It works when i change the first code line to:
[code]
$rowCount = $this->Location->Room->find(
[/code]

Also thanks for the possibility of using Counter-Cache.
Is counter-cache also working (counting) when i insert my data the
first time via MySQL (with INSERT)?

Greetings and happy easter! (-> 
http://i.flowgo.com/greetings/rapeasterbunny/rapeasterbunny.swf
)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: check if foreign key is used in other tables before delete data row

2010-04-02 Thread sebb86
Hello,

In an example, i want to delete a location if no rooms are associated
to this location.
I tryed the following:

[code]
function delete($id)
{
if(empty($this->Room->find('all', 'fields' =>
array('Room.location_id'
{
  $this->Location->del($id);
  $this->Session->setFlash('Löschvorgang (id: '.$id.')
erfolgreich!');
  $this->redirect(array ('action' => 'index'));
}
else
{
  $this->Session->setFlash('Löschvorgang (id: '.$id.')
fehlgeschlagen, da noch Räume für dieses Gebäude existieren!');
  $this->redirect(array ('action' => 'index'));
}
}
[/code]

Well, this dont works. I dont know how to correctly create the
"find" :/
Could someone help me please? Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Possible to blank (hide) columns and show those again in a complete rendered view?

2010-03-31 Thread sebb86
Hello,

With this code, my problem is solved.

[CODE]

function toggleColumn(table, column) {
for (var i = 0; i < table.rows.length; i++){
if (table.rows[i].cells.length > column){
var cell = table.rows[i].cells[column];
cell.style.display = (cell.style.display == "none")? 
"": "none";
}
}
}

[/CODE]


[View CODE]

  
  1
  2
  3
  4
  5
  6
  


  

  

  [Optionen]
  ...
   ...
[/CODE]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: retrieve related model data

2010-03-28 Thread sebb86
Thanks cricket.

Another addition, i someone else has a similar problem.
It also works without CONTAINABLE. Just keep the associations in the
model and the view code to retrieve and use the following in the
controller:

[code]
var $paginate = array(
'limit' => 50,
'order' => array('Port.hardware_unit_id' => 'asc'),
'recursive' => 2
  );
[/code]

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-26 Thread sebb86
in addition: in my view i retrieve this data in a foreach loop with
this code:
[view code]
  port id "; echo $port['Port']['uplink_id'];
echo " (-> number: "; echo $port['ParentPort']['HardwareUnit']
['schenker_number']; echo ")"; } ?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-26 Thread sebb86
Jeremy

It works with a little modification :) great!!!

The modification is to change "ChildPort" to "ParentPort" in the
following code:
[code]
var $paginate = array(
'fields' => array('*'),
'recursive' => 2,
'limit' => 50,
'order' => array('Port.hardware_unit_id' => 'asc'),
'contain' => array(
'ChildPort' =>
 array('HardwareUnit'),'HardwareUnit','Vlan','PortEmploymentGroup')
  );
[/code]


If you can see from the debug-output, the strange "0 array" isn't
there anymore and everything is right. :)
[debug output]
Array
(
[Port] => Array
(
[id] => 3
[hardware_unit_id] => 3
[vlan_id] => 2
[port_employment_group_id] => 3
[uplink_id] => 1
[active] => 0
[port_name] => 28
[port_index] => 0x26
[status] => 1
[duplex] => 10
[speed] => 100
[last_update] => 2009-03-12 11:30:21
[full_name] => 3 (28)
)

[HardwareUnit] => Array
(
[id] => 3
[staff_id] => 3
[room_id] => 3
[hardware_group_id] => 9
[hardware_type_id] => 2
[schenker_number] => 522
[active] => 1
[receptacle_port] =>
[serial_number] => 4gsd153-dg1253-6g351
[ip] =>
[user_login] =>
[purchase_date] => 2010-03-24
[support_end] =>
[leasing_end] =>
[additional_info] => das ist der zusatztext monitor
)

[Vlan] => Array
(
[id] => 2
[vlan_number] => 2
[description] => VLAN 43-FG
)

[PortEmploymentGroup] => Array
(
[id] => 3
[description] => PC
)

[ParentPort] => Array
(
[id] => 1
[hardware_unit_id] => 1
[vlan_id] => 1
[port_employment_group_id] => 3
[uplink_id] =>
[active] => 1
[port_name] => 24
[port_index] => 0x22
[status] => 1
[duplex] => 10
[speed] => 100
[last_update] => 2009-03-12 11:30:21
[HardwareUnit] => Array
(
[id] => 1
[staff_id] => 1
[room_id] => 1
[hardware_group_id] => 3
[hardware_type_id] => 4
[schenker_number] => 1000
[active] => 0
[receptacle_port] => 8a01
[serial_number] => 4153-1253-6351
[ip] => 192.168.178.55
[user_login] => admin
[purchase_date] => 2010-03-24
[support_end] => 2011-10-28
[leasing_end] =>
[additional_info] => das ist der zusatztext
)

)

)
[/debug output]

---
CRICKET and JEREMY -> thanks so much!
thanks! thanks! thanks! :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-25 Thread sebb86
sure! :-)

[code of model port]
public $belongsTo = array(
'HardwareUnit' => array(
'className'  => 'HardwareUnit'
 ),
'Vlan' => array(
'className'  => 'Vlan'
 ),
'PortEmploymentGroup' => array(
'className'  => 'PortEmploymentGroup'
 )
   );

   public $hasAndBelongsToMany = array(
   'MacAddress' => array(
   'className' => 'MacAddress',
   'joinTable' => 'mac_addresses_ports',
   'foreignKey' => 'port_id',
   'associationForeignKey' => 'mac_address_id',
   'unique' => true
   )
   );

   public $hasMany = array(
'Port' => array(
'className' => 'Port',
'foreignKey' => 'uplink_id'
)
);
[/code]


Is that, what you want, when you ask to see the find statement? ->
[controller code]
var $paginate = array(
'fields' => array('*'),
'recursive' => 2,
'limit' => 50,
'order' => array('Port.hardware_unit_id' => 'asc'),
'contain' => array(
'Port' =>
array('HardwareUnit'),'HardwareUnit','Vlan','PortEmploymentGroup')
  );



function view()
  {
$this->set('ports', $this->paginate('Port'));
  }
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-25 Thread sebb86
Jeremy Burns

Hello again :)
Code in the model of my port-table:

(the $hasOne association from my origionally question was updated to
the association below:)
[code]
public $hasMany = array(
'Port' => array(
'className' => 'Port',
'foreignKey' => 'uplink_id'
)
);
[/code]

I chose the alias "Port" because, when i try to call it different, for
example "PortUplink", the following error occurs:
Model "PortUplink" is not associated with model "Port" [CORE\cake\libs
\model\behaviors\containable.php, line 340]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-25 Thread sebb86
I use this in my controller:
[controller code]
var $paginate = array(
'fields' => array('*'),
'recursive' => 2,
'limit' => 50,
'order' => array('Port.hardware_unit_id' => 'asc'),
'contain' => array(
'Port' =>
array('HardwareUnit'),'HardwareUnit','Vlan','PortEmploymentGroup')
  );



function view()
  {
$this->set('ports', $this->paginate('Port'));
  }

I try to explain it again:
The table "ports" (class: Port) contains the field "uplink_id". This
is a self join from "uplink_id" as foreign-key to the primary key "id"
from table "ports".
Let's assume, a port has "id"=2 and the value from his "uplink_id" is
4. Then i need the HardwareUnit, which is associated with the port
with primary key "id" = 4.
If something is not understandable, simply ask again. My english is
not very well. :/

... and -cricket-, really thanks a lot for your help and patience.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


check if foreign key is used in other tables before delete data row

2010-03-24 Thread sebb86
On 2 Mrz. 2009, 19:25, mscdex  wrote:
> On Mar 2, 7:20 am, krishan  wrote:
>
> I usually do this sort of checking in the model validation or in the
> delete controller action before the deletion is attempted. Something
> like a find('count') or similar method to tocheckif the ID of the
> record to be deleted exists in a FK in some other table or record. You
> might also try the model's 'del' method which has a 'cascade' option
> (http://book.cakephp.org/view/690/del).

Hello in addition to the topic above,
i have the same problem and this suggestion sounds nice for me!
I'd like to check if the ID of the record to be deleted exists in a
foreign key in some other table (i have to check all associated
tables) or record.
Could someone help me to build an example for this?

[code of my updated delete fuction in appController]
function delete($id)
{
# check (with find('count') or something else) if the
ID of the record to be deleted exists in a foreign key in some other
table #
if ( # the record is "not used" # )
{
   $this->{$this->modelClass}->del($id);
   $this->Session->setFlash('delete (id: '.$id.') works!');
}
else
{
   $this->Session->setFlash('Could not be deleted
because of ...');
}

$this->redirect(array ('action' => 'index'));
}
[/code]

Could someone help me please? Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-24 Thread sebb86
Jeremy

Thanks! :) That works.

But now, i thought i was ready i noticed another problem.
The debug output above is for a port, which has no value in the field
"uplink_id". But the port with "id" -> 3 has value 1 in "uplink_id".
So port with id 3 points to port with id 1.
Now, the problem is, that i need the "hardware_unit" in the table cell
with the "uplink_id" (in my example port with id 3), not in the cell
to which points this "uplink_id" (in my example port with id 1).

Any ideas?

[view retrieve code]
 
  
[/code]

i despair of this problem :(

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-24 Thread sebb86
cricket

Again... thanks a lot for your help.

It seems to work. When i debug, i get this:

==
Array
(
[Port] => Array
(
[id] => 1
[hardware_unit_id] => 1
[vlan_id] => 1
[port_employment_group_id] => 3
[uplink_id] =>
[active] => 1
[port_name] => 24
[port_index] => 0x22
[status] => 1
[duplex] => 10
[speed] => 100
[last_update] => 2009-03-12 11:30:21
[0] => Array
(
[id] => 3
[hardware_unit_id] => 3
[vlan_id] => 2
[port_employment_group_id] => 3
[uplink_id] => 1
[active] => 0
[port_name] => 28
[port_index] => 0x26
[status] => 1
[duplex] => 10
[speed] => 100
[last_update] => 2009-03-12 11:30:21
[HardwareUnit] => Array
(
[id] => 3
[staff_id] => 3
[room_id] => 3
[hardware_group_id] => 9
[hardware_type_id] => 2
[schenker_number] => 522
[active] => 1
[receptacle_port] =>
[serial_number] => 4gsd153-dg1253-6g351
[ip] =>
[user_login] =>
[purchase_date] => 2010-03-24
[support_end] =>
[leasing_end] =>
[additional_info] => das ist der
zusatztext monitor
)
===

Could you help me to find out the code to retrieve "schenker_number"
in the last part?
Currently i retrieve this way (in my view):
[code inside a foreach loop]

[/code]

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-23 Thread sebb86
Thanks for your help but i still dont get it working. sorry for my bad
knowledge.

In my addModel, i added this line: [code]var $actsAs =
array('Containable');[/code]

In my controller i tryed this to use contain with paginate:
[code]
$this->set('ports', $this->paginate('Port', array('fields' =>
array('*'), 'contain' => array('PortUplink' =>
array('HardwareUnit');
[/code]
But i get lots of errors...for example, 'fields' is unknown.
Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: retrieve related model data

2010-03-22 Thread sebb86
cricket

Thanks for your answer.

Can i use "recursive" with pagination too?
I need the pagination because of a sort auomatic in my view.

And despite of "debug", i really dont know how to retrive.
I have to go the following way: uplink_id (table ports) -> id (table
ports) -> hardware_unit_id (table ports) -> schenker_number (table
hardware_units)

Thanks again.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


retrieve related model data

2010-03-22 Thread sebb86
Hello,
I'd like to show the following things in my view (respectively in the
field uplink_id in the view): attribute "uplink_id" from table "ports"
with attribute "schenker_number" from table "hardware_units".
My problem are the associations, respectively i don't know the source
code to retrieve the information i want.

Fields:
- "id" (table "ports" = primary-key)
- "hardware_unit_id" (table "ports", = foreign-key associated with
"id" from table "hardware_units")
- "id" (table "hardware_units" = primary-key)
- "uplink_id" (table "ports" = foreign-key associated with "id" from
table "ports")

Example with values:
- "id" (table "ports") has value 4
- "hardware_unit_id" has value 2 ---> "id" (table "hardware_units")
has also value 2
- "uplink_id" has value 1 (points to the "id" (table "ports" with
value 1)

So when i do this:
{{{
echo $port['HardwareUnit']['schenker_number'];
}}}

, i get the "schenker_number" from the hardware_unit, which is
associated with the port ("id" = 4) BUT i need the "schenker_number"
which matches with the "hardware_unit_id" from the port with "id"
value 1 because of the "uplink_id" (value 1).

**Model:**
{{{
class Port extends AppModel
{
  var $name= 'Port';

  public $belongsTo = array(
'HardwareUnit' => array(
'className'  => 'HardwareUnit'
 )
   );

   var $hasOne = array(
'PortUplink' => array(
'className' => 'Port',
'foreignKey' => 'uplink_id'
)
   );

}}}

**Controller:**
{{{
class PortsController extends AppController
{
var $name = 'Ports';
function index()
{
$this->set('ports', $this->Port->find('all'));
}

}}}

**View:**
{{{



}}}

Please don't hesitate to ask if i expressed myself unclearly.
Thanks if someone can help.
Greetings. :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Insert JavaScript with PHP included in $html->link, possible?

2010-03-22 Thread sebb86
logout

Thanks very much for your help! (Also thanks to Miles J.)

All of your recently created code works! :)
I've diceded to take the last one.

The purpose is to toggle (show and dont show) a data row. So i dont
want to follow the link.

Thanks again :)

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Insert JavaScript with PHP included in $html->link, possible?

2010-03-19 Thread sebb86
logout

Hello,
when i try this, an error occurs: Parse error: syntax error,
unexpected ')', expecting ',' or ';'

Greetings

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: (view) possible to select only one group of data inside the table?

2010-03-19 Thread sebb86
John

thanks, your idea sounds good.
So i think, i'd like to make the cell content a link and when i click
on it, it should load a view. This view should only show datarows,
with a equal cell (compared with the cell i clicked) inside.
Is that understandable?

[conroller action]
function view()
{
$this->set('staffs', $this->paginate('Staff', array(??? equal
$fieldname ???)));
}
[/]

[example link from one column (forename) in the view]
link($staff['Staff']['forename'],
array('controller' => 'staffs', 'action' => 'view', "fieldname" =>
$staff['Staff']['forename'])); ?>
[/]

The problem is, that the function has to be dynamical. it should work
for all cells.
And how do i write a comparison in paginate?

Thanks very much!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Insert JavaScript with PHP included in $html->link, possible?

2010-03-18 Thread sebb86
Thanks but its not working.
the address bar shows only ->javascript:;

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Insert JavaScript with PHP included in $html->link, possible?

2010-03-18 Thread sebb86
Hello,
i want to isert a mixed Code (javascript and php) into my $html->link,
but i don't know how to do this.

[javascript with php code]
"javascript:void(0)" onclick="toggleId('');"
[end code]

[$html->link code]
link($html->image("edit.png", array("alt" =>
"edit")), ---think i have to insert here--- , $row[$class]['id']),
array('class' => 'edit', "title" => "edit"), false); ?>
[code]


Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: (View) How to check a fields value in a foreach loop?

2010-03-12 Thread sebb86
Chris

I want to do it in my view.
Thanks a lot, it works great! :)

Thanks thanks thanks! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


(View) How to check a fields value in a foreach loop?

2010-03-12 Thread sebb86
Hello,
in a foreach-loop to retrieve my data, i want to check a value from a
field. So i can retrieve only the data, i want.

I tryed:
[code]
foreach ($rows as $row => 'Model.field' => 0):
[/code]
In this example, i only want to retrieve all data-rows from model
"Model", which has value 0 in the database field "field".

This don't works.
Can someone help me?

(I want to to it that way. It's for an Excel output..., so i can't do
that in my controller)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-03-01 Thread sebb86
John

Thanks again!!!
You solved it. :)

Here is the code from one of my add-functions, which has a drop-down
field with foreign-key elements.

[code]
function add()
{
parent::add();
$this->set('staffs', $this->HardwareUnit->Staff->find('list'));
$this->set('rooms', $this->HardwareUnit->Room->find('list'));
$this->set('hardwareGroups', $this->HardwareUnit->HardwareGroup-
>find('list'));
$this->set('hardwareTypes', $this->HardwareUnit->HardwareType-
>find('list'));
}
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-03-01 Thread sebb86
Well, i forgot a problem.

Now, i have my global add-function in my appController.
But some add-views have drop-down fields to show the available
foreign-
keys. They additional use this code:

[code]
$this->set('foreignKey', $this->Model1->Model2->find('list'));
[/code]

So, can i extend the concerning controllers with this code or must i
copy the complete add function (with additional code) to this
controllers?
Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: simple question about CakePHP syntax

2010-03-01 Thread sebb86
WebbedIT, Cristian, majna

Thanks a lot! :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


(view) possible to select only one group of data inside the table?

2010-03-01 Thread sebb86
Hello,
in my view, i have a table with data inside. For example, one column
is named "hardware_groups" and the content of the cells is something
like: printer, notebook, workstation, and so on.

Is there a simple way to select, for example, only the notebooks?

Hope my problem is understandable.
Thanks if someone can help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-28 Thread sebb86
John

> You only use {$this->modelClass} when you want to use the model
> instance.

Thats it. Thanks very much! :)

If someone other wants to use this, here is my final code (add
function in app_controller):

[code]
  function add()
  {
if(!empty($this->data))
{
  if($this->{$this->modelClass}->save($this->data))
  {
$this->Session->setFlash('saved!');
$this->redirect($this->data[$this->modelClass]['referer']);
  }
  else
  {
$this->Session->setFlash('fail!');
  }
}
if (!$this->data[$this->modelClass]['referer'])
{
  $this->data[$this->modelClass]['referer'] = $this->referer();
}
  }
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-28 Thread sebb86
John

> You only use {$this->modelClass} when you want to use the model
> instance.

Thats it. Thanks very much! :)

If someone other wants to use this, here is my final code (add
function in app_controller):

[code]
  function add()
  {
if(!empty($this->data))
{
  if($this->{$this->modelClass}->save($this->data))
  {
$this->Session->setFlash('Speichervorgang erfolgreich!');
$this->redirect($this->data[$this->modelClass]['referer']);
  }
  else
  {
$this->Session->setFlash('Speichervorgang fehlgeschlagen!');
  }
}
if (!$this->data[$this->modelClass]['referer'])
{
  $this->data[$this->modelClass]['referer'] = $this->referer();
}
  }
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to set "paginate -> limit" on the fly in my views?

2010-02-28 Thread sebb86
Thanks for your answers but i think it's to difficult for me to solve
that.
But thanks a lot!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-28 Thread sebb86
Paul

In my inventory-management, every table/model has the need of an add-
function. The models are, for example: rooms, locations,
hardware_groups, hardware_units, mobile_radio_units, ports ... and so
on.
Furthermore, the add functions are equal to each other, expect, if
there is an foreign-key inside. So i'd like to create the add-function
in the app_controller.

Your code works, thanks! :)
My last question is, do you know how to make this dynamical, because
the code has to be inside the add_controller.

[code]
  function add()
  {
if(!empty($this->data))
{
  if($this->{$this->modelClass}->save($this->data))
  {
$this->Session->setFlash('Speichervorgang erfolgreich!');
$this->redirect($this->data[{$this->modelClass}]['referer']);
  }
}
if (!$this->data[{$this->modelClass}]['referer'])
{
  $this->data[{$this->modelClass}]['referer'] = $this->referer();
}
  }
[/code]

I've tryed: {$this->modelClass}
I think the result of this is only the [code]class[/code] but i need
[code]'class'[/code].

And again, thank you very much for helping me in nearly all me topics!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to set "paginate -> limit" on the fly in my views?

2010-02-27 Thread sebb86
Hello again WebbedIT, :-)

i found something in the book and got some simple paginating links
working in my views.

[code]
link('50', array('limit' => 50));
  echo $paginator->link('75', array('limit' => 75));
  echo $paginator->link('100', array('limit' => 100));
?>
[/code]

Is there also a simple way, to create a text-field?
In this field i'd like to type the limit-number dynamical.
Or it could be also a text field with a "send"-button.

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to set "paginate -> limit" on the fly in my views?

2010-02-27 Thread sebb86
Hello again WebbedIT, :-)

i found something in the book and got some simple paginating links
working in my views.

[code]
link('50', array('limit' => 50));
  echo $paginator->link('75', array('limit' => 75));
  echo $paginator->link('100', array('limit' => 100));
?>
[/code]

Is there also a simple way, to create a text-field?
In this field i'd like to type the limit-number dynamical.

Greetings.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-26 Thread sebb86
Well, when i write down the complete add-function again (with
additional foreign-key content) in the controllers, that need this
additional content, it seems to work.
But is it possible, to only add the foreign-key content to the
controllers instead of the complete function?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-26 Thread sebb86
Well, i have a continative problem.
Now, i have my global add-function in my appController.
But some add-views have drop-down fields to show the available foreign-
keys.

So how can i extend the concerning controllers with my foreign-key
drop-down field code?

[code]
$this->set('foreignKey', $this->Model1->Model2->find('list'));
[/code]

Is it possible to extend my controllers?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Possible to define a global "add-function" in the appController?

2010-02-26 Thread sebb86
John, Jon

Thanks a lot for helping me.
Here is my working add-function in the app-controller if someone want
to see an example:

[code]
  function add()
  {
if(!empty($this->data))
{
if($this->{$this->modelClass}->save($this->data))
{
$this->Session->setFlash('Speichervorgang 
erfolgreich!');
$this->redirect(array('action' => 'index'));
}
  else
  {
$this->Session->setFlash('Speichervorgang fehlgeschlagen!');
  }
}
}
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-26 Thread sebb86
Paul,
hmm, it dont works :/
Could you look at the source please?
And should i pass something to the view and write it in the brackets
after "function add"?

[controller code]
function add()
  {
   if(!empty($this->data))
   {
if($this->HardwareGroup->save($this->data))
  {
$this->Session->setFlash('saved');
if (!$this->data['HardwareGroup']['referer']) { $this-
>data['HardwareGroup']['referer'] = $this->referer(); }

$this->redirect($this->data['HardwareGroup']['referer']);
}
   }
  }
[/controller code]


[some view code]
create('HardwareGroup');
  echo $form->input('HardwareGroup.referer',
array('type'=>'hidden'));
  echo $form->input('description');
echo $form->end('Save');
?>
[/some view code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Possible to define a global "add-function" in the appController?

2010-02-26 Thread sebb86
John,

Hello and thanks for your help.

"Are your controllers only using one model and the models is named the
same as the controller (singular)? If that is so, you don't need to
pass the model, just take your controllers name and Inflect it into a
model name and use that!
"

Yes, for example i have a controller: LocationsController with a
model: location.
But how can i make the add-function in the appController dynamical?
I tryed to pass $model with the current model name from the current
controller to the appController but it dont works.

Could you tell me, how to pass the model name?

Thanks! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Possible to define a global "add-function" in the appController?

2010-02-25 Thread sebb86
Hello,
i'd like to build a global-add function in the appController, so that
all controllers can use it. is that possible?

[App-Controller code:]
function add($modell)
{
if(!empty($this->data))
{
if($this->$modell->save($this->data))
{
$this->Session->setFlash('saved');
$this->redirect(array('action' => 'index'));
}
  else
  {
$this->Session->setFlash('not saved!');
  }
}
}
[.../]

for example the current controller is named LocationsController:
[code]
var $modell = $this->Location;
[/]

Thats what i tryed, but it dont works.

Thanks if someone can help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-25 Thread sebb86
Hello,
thanks for your help!!!

But with this code, if i copyed it on the right places, i every time
go back to the add view :/
But the destination should be the view where i came from.

Hmm, or it's my mistake. Could you tell me, where i exactly have to
post this code?:

if (!$this->data['HardwareGroup']['referer']) {
  $this->data['HardwareGroup']['referer'] = $this->referer();

}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Possible to blank (hide) columns and show those again in a complete rendered view?

2010-02-21 Thread sebb86
Hello,
in a complete rendered view, is it possible to blank (hide) columns
and show those again (for example by clicking on column-caption like
paginating)?
Hope my question is understandable.

Thanks very much if someone can help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-21 Thread sebb86
Oh sorry, i don't want to "edit", i want to "add".
I create an inventory management.
When i'm in view "hardware units", it's handy to add (via global drop
down menu) a hardware group.
This helps me to save time because without that global drop-down, i
have to go to view "hardware groups", then add once, then go back to
"hardware units".
Hope thats understandable?

Could you create a short example please, i dont know how to solve
that :/
Thanks for your help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (views) Redirect where i came from

2010-02-21 Thread sebb86
Hello,
thanks, but i know this code.
The problem is, that i have to redirect dynamical to the view, where i
came from, because you can access some views from many other views.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to set "paginate -> limit" on the fly in my views?

2010-02-21 Thread sebb86
Hello,
i'd like to manually set the "limit"-option on the fly in my views.
So, for example, there could be 3 fields with "10", "25" and "50" or a
input field to write the number.

Thanks a lot if someone can help!!!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


(views) Redirect where i came from

2010-02-21 Thread sebb86
Hello,
How can i redirect to a view, where i came from?

Example:
In view A, i click a button which opens the edit view B
When the user completes the edit action and clicks on save, i want to
redirect to view A.
(with "refer", the redirect goes to view B :(  )

Thanks a lot, if someone can help!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to disable bottom CakePHP section (query, errors, ...)

2010-02-16 Thread sebb86
Miles J

Thank you very much, thats it. :)
If others want to change the output-style, see here:
http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-16 Thread sebb86
WebbedIT

It works. Thanks a lot! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


how to disable bottom CakePHP section (query, errors, ...)

2010-02-14 Thread sebb86
Hello,
how can i disable the CakePHP section (in this section are sql
statements) on the bottom of each view?

Thanks a lot!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-14 Thread sebb86
WebbedIT

Thanks for your addition!
I included your idea and now, my image moves a little bit, when i move
the mouse over it. :-)
But unfortunately my title / tag option dont works anymore when i move
my mouse over the picture. :/

view:
[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
&contr, "action" => "delete", $row[$class]['id'])),
array('class'=>'delete'),  sprintf(__('Are you sure you want to delete
# %s?', true), $row[$class]['id']), false); ?>
[code]

Do you have an idea to fix this? (Is there something in css?)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Hello all,

i finally got it working!!! :-)

i merged some ideas i found in the google-group, so the following code
works for me. It is an image, which links to a delete-view and it
outputs a confirm message with the current row number (id).

[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
"sample_controllers", "action" => "delete", $row['SampleController']
['id'])), array(), sprintf(__('Are you sure you want to delete # %s?',
true), $row['SampleController']['id']), false); ?>
[/code]

With "title", you can show something when you move the mouse over the
image.

Hope this helps!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: confirm message

2010-02-12 Thread sebb86
arif, paulos

Hello,

i merged your ideas, this code works for me. It is a image, which
links to a view and it outputs a confirm message with the current row
number (id).
I used this for a delete option.

[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
"sample_controllers", "action" => "delete", $row['SampleController']
['id'])), array(), sprintf(__('Are you sure you want to delete # %s?',
true), $row['SampleController']['id']), false); ?>
[/code]

With "title", it appears "title" => "value" when you move the mouse
over the image.

Hope this helps!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


simple question about CakePHP syntax

2010-02-12 Thread sebb86
Hello,

i have a question about some signs. Is the use of this   "sample"
always equal to this   'sample'  ?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Guillermo

No, i'd like something like a pop-up warning window, which says: "are
you sure you want to delete?".
Is this possible with an image-link?

[code]
image("delete.png", array("alt" => "delete",
'url' => array('controller' => 'hardware_units', 'action' => 'delete',
'id' => $hardware_unit['HardwareUnit']['id'])));?>
[\code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Addition:
this works with the "$hrml->link" but not with "$html->image". :-(

[code]
link('Delete', array('action' => 'delete', 'id' =>
$hardware_unit['HardwareUnit']['id']), null, 'Sind sie sicher?'); ?>
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Guillermo

No, i'd like something like a pop-up warning window, which says: "are
you sure?".


On 11 Feb., 16:57, Guillermo Mansilla  wrote:
> you already did with this line
> $this->Session->setFlash('hardware unit with id: '.$id.' has been
> deleted');
>
> make sure you have set up the session messages var in your layout
>
> On 11 February 2010 11:25, sebb86  wrote:
>
> > Hello all,
>
> > thanks for all your answers. After reading all your answers, i've
> > decided to use a image, which links to a page.
> > Could someone help me to add a warning-message, e.g. when i delete
> > something???
>
> > Here is my image/link code from the view:
> > [code]
> >        image("delete.png", array("alt" => "delete",
> > 'url' => array('controller' => 'hardware_units', 'action' => 'delete',
> > 'id' => $hardware_unit['HardwareUnit']['id'])));?>
> > [\code]
>
> > And my delete function in the controller:
> > [code]
> > function delete($id)
> >        {
> >                $this->HardwareUnit->del($id);
> >                $this->Session->setFlash('hardware unit with id: '.$id.' has 
> > been
> > deleted');
> >                $this->redirect(array ('action' => 'index'));
> >        }
> > [\code]
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Hello all,

thanks for all your answers. After reading all your answers, i've
decided to use a image, which links to a page.
Could someone help me to add a warning-message, e.g. when i delete
something???

Here is my image/link code from the view:
[code]
image("delete.png", array("alt" => "delete",
'url' => array('controller' => 'hardware_units', 'action' => 'delete',
'id' => $hardware_unit['HardwareUnit']['id'])));?>
[\code]

And my delete function in the controller:
[code]
function delete($id)
{
$this->HardwareUnit->del($id);
$this->Session->setFlash('hardware unit with id: '.$id.' has 
been
deleted');
$this->redirect(array ('action' => 'index'));
}
[\code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Jeremy

Thanks for your answer.
But actually i'd like to create a button (not a button-picture), which
links to a view.
I don't want to add a picture, because every button would have an
other description.
So is this possible to realize or must i create lots of pictures? ;-)

Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Retrieve data in table cells -> how to avoid line breaks?

2010-02-11 Thread sebb86
Thanks, that works.
Furthermore, is it possible to create only a horizontal line under
each complete data-row?



On 11 Feb., 09:21, mike karthauser  wrote:
> You need to set a css style for th
>
> Ie
> th { whitespace:nowrap}
>
> which will stop the lines breaking on spaces.
>
> Mike Karthauser
> Brightstorm limited
> Tel: 07939252144
>
> On 11 Feb 2010, at 07:19, sebb86  wrote:
>
> > Hello,
> > when i retrieve my data in table-cells, how can i avoid line breaks,
> > for example in the table header?
>
> > [retrieve-code]
> > 
> >      
> >          
> >            sort(array('asc' =>'id v',  
> > 'desc'
> > =>'id ^'), 'id');  ?>
> >          ...
> >          ...
> >        
>
> > 
> >          
> >          
> >          
> >           > td>
> >           ...
> > [/retrieve-code]
>
> > Thanks if someone can help! :)
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help  
> > others with their CakePHP related questions.
>
> > 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, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this  
> > group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to include a button which links to a view?

2010-02-11 Thread sebb86
Hello,

how can i create a button in a view, which links to another view? This
is my code with a simple text link, but how can i this as a button?

[code]

  link('add a hardware unit', array('controller'
=> 'hardware_units', 'action' => 'add')) ?>
[\code]

Thanks a lot if someone can help!!! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Retrieve data in table cells -> how to avoid line breaks?

2010-02-11 Thread sebb86
Thanks! That works for me:

[code]

th { white-space:nowrap; }

[/code]

Furthermore, is it possible to create only a horizontal line under
each complete data row?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Retrieve data in table cells -> how to avoid line breaks?

2010-02-11 Thread sebb86
Thanks. Furthermore, is it possible to create only a horizotal line
under each complete data-row?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Retrieve data in table cells -> how to avoid line breaks?

2010-02-11 Thread sebb86
Addition: It also would be nice, if the cell width would fit to the
cell content.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Retrieve data in table cells -> how to avoid line breaks?

2010-02-10 Thread sebb86
Hello,
when i retrieve my data in table-cells, how can i avoid line breaks,
for example in the table header?

[retrieve-code]

  

  sort(array('asc' =>'id v', 'desc'
=>'id ^'), 'id');  ?>
  ...
  ...





  
  
   ...
[/retrieve-code]

Thanks if someone can help! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to validate two unique fields together?

2010-02-05 Thread sebb86
matzehahn

Thanks for this link. Unfortunately this source don't worked with my
edit-function (add worked).
I tryed to change the source, but without success.



BrendonKoz

Thanks also for your help. I tryed some hours to get all this working
but also without success.


Fortunately, i found a link to a nice validate function: (http://
bin.cakephp.org/view/653776884   -> Thanks a lot to the author!!!)
This code works for my with add and edit.
I simply included a 'notEmpty' rule and it was done. :)

So here is my source:
[code]
var $validate = array(
  'location_id' => array(
/* In the parameters, after 'description', there can be added
more fields to validate */
  'rule' => array('noDuplicates',
array('description', 'location_id')),
'message' => 'this combination of Location and Description
is already in use'
  ),
  'description' => array(
'rule' => 'notEmpty',
'message' => '"Description" cannot be left blank'
  )
   );


   /* Checks to see if there is already a duplicate of the specific
combination of fields */
   function noDuplicates($value, $params)
   {
  /* if editing an existing record then don't count this record in
the check for duplicates */
  if (!empty($this->id))
  $conditions[] = array($this->primaryKey . ' <>' => $this-
>id);

  /* Add a condition for each field we want to check against */
  foreach ($params as $field)
  {
  /* check if value is empty. if it is then check for a NULL
value against this field */
  if($this->data[$this->name][$field])
  $fieldVal = $this->data[$this->name][$field];
  else
  $fieldVal = null;
  $conditions[] = array($field => $fieldVal);
  }

  $existingFieldsCount = $this->find( 'count', array('conditions'
=> $conditions, 'recursive' => -1) );
  return $existingFieldsCount < 1;
   }
[\code]

The function can by included in the current model or in the app_model.

Greetings! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: HABTM view: how to retrieve data in extra column?

2010-02-04 Thread sebb86
John

That's it. Thanks very much!!! :)
Here is the complete code with columns, if needed:

[code]

  

  sort(array('asc' =>'id v', 'desc'
=>'id ^'), 'id');  ?>
  sort(array('asc' =>'forename v',
'desc' =>'forename ^'), 'forename');  ?>
  sort(array('asc' =>'surname v',
'desc' =>'surname ^'), 'surname');  ?>
  sort(array('asc'
=>'telephon_number v', 'desc' =>'telephon_number ^'),
'telephon_number');  ?>
  sort(array('asc' =>'e_mail v',
'desc' =>'e_mail ^'), 'e_mail');  ?>
  rooms





  link($staff['Staff']['id'],
array('action' => 'edit', 'id' => $staff['Staff']['id'])); ?>
  
  
  
  
  
 ,
 


  
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


  1   2   >