Forum


List Manager Support

List Manager support
Forums
Public write access is disabled. Please login

"Add" button in separate module? 14.01.2014 14:45

Is it possible to have the Listmanager "Add" button in a separate module?

I want to be able to place it on the page. (similar to the Listmanager Search module).

Re: 'Add' button in separate module? 14.01.2014 19:16

Hi,
at this time such module doesn't exist, but we could build it on demand, we can create a module able to print an add button in charge of displaying the default input form at the main view, same action as if default button was pressed. If you're interested please place a helpdesk ticket and ask for a quote regarding this, we'll confirm price and delivery time.

Thanks, regards
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 17.01.2014 06:03

Thank you for the answer and good ideas. One more question: is it possible to pre-populate the Add entry form? For example, from fields in the URL?

I'm almost ready with a request to submit by helpdesk ticket.

Edited by moon_682 - 17.01.2014 06:04

Re: 'Add' button in separate module? 17.01.2014 14:20

Hi,
the default values of the fields can be entered (if they are fixed), from field configuration. If you need to handle dynamic data (to recover params from session, for ex) you have from latest version of the extension the option to add custom code to 'calculate' the default values. Place a file called

customserverpages.php

at this path:

joomla\components\com_listmanager\models\customserverpages.php

with the following contents(replace [ and ] for lower than,greater than symbols):

[?php

//Please replace here '1' for the ID of the field to fill the default value with.
$idfieldcustom = 1;

//Calculate the value and replace here
$valuecustom= "Custom value";

//fixed code
$defaultcondition="if(f.id=".$idfieldcustom.",".$valuecustom.",ifnull(v.defaulttext,f.defaulttext))";

?]


so if you're able to build the php code to recover your values from external source, you can use this to create dynamic default values for your field.


Hope this helps, regards
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 29.01.2014 06:14

Thank you for this very nice detailed reply! I have implemented the file customserverpages.php and placed it in the location joomla\components\com_listmanager\models\customserverpages.php

I tried it with a test value in the file for $valuecustom= "testvalue";

I then tried the front-end page and used the "Add" button to open the editor panel. Should I see the dynamic default value already populated in the specified field in the edit panel?

This is what I think should happen, then the user would press "Save" to write the row?

It is not working, but I'll continue testing.

I will also send a more specific rfq by ticket.

Thank you!

Re: 'Add' button in separate module? 29.01.2014 10:08

Hello,

We forgot and important detail, this only works with views. You should create a view (no extra configuration in view is needed) and select it in menu item or module.

Also, if you use text as custom value, you should add single quote to:

//fixed code
$defaultcondition="if(f.id=".$idfieldcustom.",'".$valuecustom."',ifnull(v.defaulttext,f.defaulttext))";

in your customserverpages.php

Hope this helps. Regards,
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 01.02.2014 13:25

OK thank you again for your kind replies here in the forum and to the ticket. I made the View and set a default for the field, and substituted the new fixed code in the file customserverpages.php. The default value does appear fine in the front end, but the custom value does not. Is the Field number the same for the View? Do I have the quotes right?

?php

//Please replace here '1' for the ID of the field to fill the default value with.
$idfieldcustom = 55;

//Calculate the value and replace here
$valuecustom= "testvalue";

//fixed code
$defaultcondition="if(f.id=".$idfieldcustom.",'".$valuecustom."',ifnull(v.defaulttext,f.defaulttext))";

?

Many thanks!!

Re: 'Add' button in separate module? 02.02.2014 16:50

also, I tested a variable instead of string using the Custom ID Field variable for testing ...

$valuecustom=$idfieldcustom;

and the fixed code with single quotes

$defaultcondition="if(f.id=".$idfieldcustom.",'".$valuecustom."',ifnull(v.defaulttext,f.defaulttext))";

I'm a PHP newbie and I appreciate learning from your code! So I put in

$str = $defaultcondition;
echo $str;

Then in the front end I see $defaultcondition; is

if(f.id=55,'55',ifnull(v.defaulttext,f.defaulttext))

So this string should be evaluated in the $query and '55' used as defvalue? I can't follow what serverpages.php does (but fun to look :) But this is not showing in the front end.

Edited by moon_682 - 03.02.2014 00:29

Edited by moon_682 - 03.02.2014 01:53

Re: 'Add' button in separate module? 03.02.2014 10:19

Hello,

In this code:

if(f.id=55,'55',ifnull(v.defaulttext,f.defaulttext))

f.id=55 should be the id of the calculator and '55' should be the default value you should set.

Please check if first 55 (f.id=55) is the id of your calculator.

Regards,
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 03.02.2014 15:34

yes, I verified that the field ID I want to use is 55. I put a default text in the front end View for that field and I see it correctly in the "Add" panel. I should see the text string '55' in the "Add" panel instead of my default, correct?

many thanks!

Re: 'Add' button in separate module? 03.02.2014 16:18

Hi,
yes, the field ID is the same for the views or the main list. With that configuration, if you publish the list, you should see the default value, if you publish the view, you should see your custom value. Please ensure the new view you have created is selected at the menu/module options instead of the main list.
Place a private ticket at the helpdesk if you can't get it working and share your url in order we can debug at your page.

Regards
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 18.02.2014 02:37

Thank you for the excellent help via the private messages. Making good progress.

Is there a way to have the "Add" record control default to "Add Panel Open"?

Re: 'Add' button in separate module? 18.02.2014 09:54

Hello,

You should use language files located at JOOMLA/language. For example, for en-GB language file, go to JOOMLA/language/en-GB and change en-GB.com-listmanager.ini and en-GB.mod-listmanager.ini. For add button you should search for 'LM_ADD' and change its value.

Regards,
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 19.02.2014 02:13

sorry for the confusion, I meant in the LIstManger Module Front End user interface for a List or View, there is a button (btadd.png) which opens an edit panel for the user to add a new record, then select save.

I would like to set it so the edit panel is already open on page load?

Re: 'Add' button in separate module? 19.02.2014 11:32

Hello,

By now that is not possible without introducing some code. We´ve planned to include this feature as a new configuration parameter for next release.

Regards,
Moonsoft Team
www.moonsoft.es

Re: 'Add' button in separate module? 20.02.2014 06:38

OK great, I will look forward to your new release!
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback