-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
Hello,
Tested my project in 2.5 for J3.0:
I - Jcook IP Validator is not working.
^(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5])$
ex: 10.29.201.152 => not match
Custom Validator :
^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$
ex: 10.29.201.152 => match
II - Button 'Save to copy' do not save a new Item.
Edit Item,
Clic Button 'Save to copy',
But modify and save only the current id.
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Thanks for the regex.
I am not expert in regexp, so Cook is not providing garanteed regexp.
Thank you for your contribution, I will create a documentation category for RegExp.
Save to copy :
Do not save current item.
Create a copy with all the modified informations and redirect on this new cloned item.
It works on my hands.
Can you tell me wich project and I will try. (PTL)
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
Project : HPC7000
Table: virtual_machins
Layout : Machine Vrtuelle.
Select an Item, and try to save as copy...
Thank for your return, It's a usefull button for me ...
|
Last Edit: 11 Jun 2013 11:28 by liubov.
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Found :
This is a Joomla issue (Legacy Controller)
I will fix it now.
I must now include an override of the save() function in the class controller of your component.
In the save() function : // The save2copy task needs to be handled slightly differently.
if ($task == 'save2copy')
{
// Check-in the original row.
if ($checkin && $model->checkin($data[$key]) === false)
{
// Check-in failed. Go back to the item and display a notice.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
return false;
}
// Reset the ID and then treat the request as for Apply.
$data[$key] = 0;
// HERE VERY IMPORTANT
$model->setState($model->getName() . '.id', 0);
$task = 'apply';
}
|
Coding is now a piece of cake
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Sorry for the cut (1 minute down)
Try again, it should work.
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
OUP !
I ve regenerate the Project :
- Error with 'save' function :
Fatal error: Call to undefined method Demo9139ControllerVirtualmachin::can() in /home/cook/sites/www.j-cook.net/public_html/sandbox/cms30/administrator/components/com_demo9139/classes/controller/item.php on line 643
Error : Call to undefined method Demo9139ControllerVirtualmachin::can()
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Retry again, it is my fault.
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
YYYeeeaahhhh ! It's Ok.
You 've just won your meal !
( I also forgot to tell you that I have the same behaviours with this button in .pro environment, original Project )
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Yes because it uses Joomla classes, and I can see there is an issue there.
Until, Cook is using the states vars properly, there is no other workaround then overriding the save function.
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
In conclusion, and to be clear,
Will we have to manualy modify (as proposed) the save function to use 'save2copy', in Cook2.5, even after the 15th ?
Or this will be fixed later on ?
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
It is now fixed if you download again now. (2.5.1)
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
Several Download this morning to add/correct few fonctionalities.
All works fine under J3.1.
Great job, once again !
I think I will publish this Component on the JED, witch could be usefull for vmWARE Admin ...
Marc
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
Already finished ?
Great job !
|
Coding is now a piece of cake
|
-
liubov
-
-
Offline
-
Elite Member
-
-
(=) 10 mn and it's ready!
- Posts: 279
- Thank you received: 36
-
Karma: 22
-
|
Yeah, I think I will love a lot this new interface, as Component Producer I am !!!
For this Project, I haven't modify anything in the Jcook code (except adding the 'DS' to build Item Menu). All the functionalities needed was already inside.
Just add a little Design for EndUsers ...
BackEnd view ...
FrontEnd view ...
Have good day ...
Marc
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
For this Project, I haven't modify anything in the Jcook code
Excellent exercice !
It means 100% Cook built !
|
Coding is now a piece of cake
|
|