List Manager Forum

"Add" button in separate module?

User moon_682 2014-01-14 14:45:37

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).

Moonsoft support 2014-01-14 19:16:36

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

User moon_682 2014-01-17 06:03:41

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

Moonsoft support 2014-01-17 14:20:51

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 for lower than,greater than symbols):















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

User moon_682 2014-01-29 06:14:34

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!

Moonsoft support 2014-01-29 10:08:07

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,

User moon_682 2014-02-01 13:25:28

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!!

User moon_682 2014-02-02 16:50:46

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

Moonsoft support 2014-02-03 10:19:14

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,

User moon_682 2014-02-03 15:34:05

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!

Moonsoft support 2014-02-03 16:18:51

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

User moon_682 2014-02-18 02:37:36

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"?

Moonsoft support 2014-02-18 09:54:17

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,

User moon_682 2014-02-19 02:13:35

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?

Moonsoft support 2014-02-19 11:32:26

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,

User moon_682 2014-02-20 06:38:43

OK great, I will look forward to your new release!

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!