Formfiller problem in adding in module

If you aren't speaking german, you can ask for support or post your request here.
Antworten
bernie
Beiträge: 1
Registriert: 2. Mai 2016, 08:20

Formfiller problem in adding in module

Beitrag von bernie »

Good day!

i need held in installing the formfiller where is the exact place to the code it say here

Add before command “$moduleMenu→show();” this line:
include(SERVER_PATH.“/adm_plugins/formfiller/formfiller.php”);

<!-- Here you can add your html code. This code will be applied at the end of the <body> area
and after the Admidio module code.
-->

<!-- Here you can add your html code. This code will be applied at the end of the <body> area
and after the Admidio module code.
-->

</div><!-- closes "div#left-block" -->
</div><!-- closes "div.col-md-9" -->
<div class="col-md-3">
<div id="right-block" class="admidio-container">
<?php

include(SERVER_PATH . '/adm_plugins/login_form/login_form.php');


?>
<div id="plugin_menu" class="admidio-plugin-content">
<?php

// Module Menu
$moduleMenu = new Menu('modules', $gL10n->get('SYS_MODULES'));

$moduleMenu->addItem('overview', '/adm_program/index.php',
$gL10n->get('SYS_OVERVIEW'), '/icons/home.png');

if($gPreferences['enable_announcements_module'] == 1
|| ($gPreferences['enable_announcements_module'] == 2 && $gValidLogin))
{
$moduleMenu->addItem('announcements', '/adm_program/modules/announcements/announcements.php',
$gL10n->get('ANN_ANNOUNCEMENTS'), '/icons/announcements.png');
}
if($gPreferences['enable_download_module'] == 1)
{
$moduleMenu->addItem('download', '/adm_program/modules/downloads/downloads.php',
$gL10n->get('DOW_DOWNLOADS'), '/icons/download.png');
}
if($gPreferences['enable_mail_module'] == 1 && !$gValidLogin)
{
$moduleMenu->addItem('email', '/adm_program/modules/messages/messages_write.php',
$gL10n->get('SYS_EMAIL'), '/icons/email.png');
}
if(($gPreferences['enable_pm_module'] == 1 || $gPreferences['enable_mail_module'] == 1) && $gValidLogin)
{
$unreadBadge = '';

// get number of unread messages for user
$message = new TableMessage($gDb);
$unread = $message->countUnreadMessageRecords($gCurrentUser->getValue('usr_id'));

if($unread > 0)
{
$unreadBadge = '<span class="badge">' . $unread . '</span>';
}

$moduleMenu->addItem('private_message', '/adm_program/modules/messages/messages.php',
$gL10n->get('SYS_MESSAGES') . $unreadBadge, '/icons/messages.png');
}
if($gPreferences['enable_photo_module'] == 1
|| ($gPreferences['enable_photo_module'] == 2 && $gValidLogin))
{
$moduleMenu->addItem('photo', '/adm_program/modules/photos/photos.php',
$gL10n->get('PHO_PHOTOS'), '/icons/photo.png');
}
if($gPreferences['enable_guestbook_module'] == 1
|| ($gPreferences['enable_guestbook_module'] == 2 && $gValidLogin))
{
$moduleMenu->addItem('guestbk', '/adm_program/modules/guestbook/guestbook.php',
$gL10n->get('GBO_GUESTBOOK'), '/icons/guestbook.png');
}

$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
$gL10n->get('LST_LISTS'), '/icons/lists.png');

if($gValidLogin)
{
$moduleMenu->addItem('mylist', '/adm_program/modules/lists/mylist.php',
$gL10n->get('LST_MY_LIST'), '/icons/mylist.png');
}

if($gPreferences['enable_dates_module'] == 1
|| ($gPreferences['enable_dates_module'] == 2 && $gValidLogin))
{
$moduleMenu->addItem('dates', '/adm_program/modules/dates/dates.php',
$gL10n->get('DAT_DATES'), '/icons/dates.png');
}

if($gPreferences['enable_weblinks_module'] == 1
|| ($gPreferences['enable_weblinks_module'] == 2 && $gValidLogin))
{
$moduleMenu->addItem('links', '/adm_program/modules/links/links.php',
$gL10n->get('LNK_WEBLINKS'), '/icons/weblinks.png');
}
include(SERVER_PATH."/adm_plugins/formfiller/formfiller.php"),

echo $moduleMenu->show();

// Administration Menu
if($gCurrentUser->approveUsers() || $gCurrentUser->editUsers()
|| $gCurrentUser->manageRoles() || $gCurrentUser->isWebmaster())
{
$adminMenu = new Menu('administration', $gL10n->get('SYS_ADMINISTRATION'));

if($gCurrentUser->approveUsers() && $gPreferences['registration_mode'] > 0)
{
$adminMenu->addItem('newreg', '/adm_program/modules/registration/registration.php',
$gL10n->get('NWU_NEW_REGISTRATIONS'), '/icons/new_registrations.png');
}
if($gCurrentUser->editUsers())
{
$adminMenu->addItem('usrmgt', '/adm_program/modules/members/members.php',
$gL10n->get('MEM_USER_MANAGEMENT'), '/icons/user_administration.png');
}
if($gCurrentUser->manageRoles())
{
$adminMenu->addItem('roladm', '/adm_program/modules/roles/roles.php',
$gL10n->get('ROL_ROLE_ADMINISTRATION'), '/icons/roles.png');
}
if($gCurrentUser->isWebmaster())
{
$adminMenu->addItem('dbback', '/adm_program/modules/backup/backup.php',
$gL10n->get('BAC_DATABASE_BACKUP'), '/icons/backup.png');
$adminMenu->addItem('orgprop', '/adm_program/modules/preferences/preferences.php',
$gL10n->get('SYS_SETTINGS'), '/icons/options.png');
}

echo $adminMenu->show();
}

?>
</div><!-- closes "div#plugin_menu" -->
</div><!-- closes "div#right-block" -->
</div><!-- closes "div.col-md-3" -->
</div><!-- closes "div.row" -->
</div><!-- closes "div#page" -->

<p id="copyright">
<a href="http://www.admidio.org/" style="text-decoration: none;">
<img src="<?php echo THEME_PATH; ?>/images/admidio_logo_20.png"
alt="<?php echo $gL10n->get('SYS_ADMIDIO_SHORT_DESC'); ?>"
title="<?php echo $gL10n->get('SYS_ADMIDIO_SHORT_DESC'); ?>"
style="border: 0; vertical-align: bottom;" />
</a>
<span style="font-size: 9pt; padding-left: 8px;">&copy; 2004 - 2016&nbsp;&nbsp;<?php echo $gL10n->get('SYS_ADMIDIO_TEAM'); ?></span>
</p>

i got this error

The hr.mgis.org.ph page isn’t working

hr.mgis.org.ph is currently unable to handle this request.
500

Thank you in advance
Bernie
rmb
Plugin-Developer
Beiträge: 632
Registriert: 10. Mai 2011, 19:56
Wohnort: 86856

Re: Formfiller problem in adding in module

Beitrag von rmb »

Hello Bernie,

the link is on the right position, but change

Code: Alles auswählen

include(SERVER_PATH."/adm_plugins/formfiller/formfiller.php"),
in

Code: Alles auswählen

include(SERVER_PATH.'/adm_plugins/formfiller/formfiller.php');
rmb
kdbone
Beiträge: 4
Registriert: 9. Jun 2016, 22:52

Re: Formfiller problem in adding in module

Beitrag von kdbone »

I to am having difficulties getting this plug-in to work. I followed the suggestion here and am able to get beyond my initial error, but I am not getting an error in the formfiller.php line 62.

I have disabled the line in the my_body_bottom.php to get the site functional, but I would really like to get the formfiller to work.
rmb
Plugin-Developer
Beiträge: 632
Registriert: 10. Mai 2011, 19:56
Wohnort: 86856

Re: Formfiller problem in adding in module

Beitrag von rmb »

Hello kdbone,

you have in my_body bottom.php exactly this line

Code: Alles auswählen

include(SERVER_PATH.'/adm_plugins/formfiller/formfiller.php');
Insert in front of this line

Code: Alles auswählen

echo $moduleMenu->show();
rmb
kdbone
Beiträge: 4
Registriert: 9. Jun 2016, 22:52

Re: Formfiller problem in adding in module

Beitrag von kdbone »

Yes, I do.

Then it gives me the other error in formfiller.php line 62.
rmb
Plugin-Developer
Beiträge: 632
Registriert: 10. Mai 2011, 19:56
Wohnort: 86856

Re: Formfiller problem in adding in module

Beitrag von rmb »

Hello kdbone,

in line 62, the plugin only checks whether a $pluginMenu is defined. This should not cause an error.

So add these lines in the my_body_bottom.php:

Code: Alles auswählen

$pluginMenu = new Menu('plugins', 'Plugins');
include(SERVER_PATH.'/adm_plugins/formfiller/formfiller.php');
echo $pluginMenu->show();
rmb
kdbone
Beiträge: 4
Registriert: 9. Jun 2016, 22:52

Re: Formfiller problem in adding in module

Beitrag von kdbone »

I am now getting the following error.

Fatal error: Call to undefined method Database::setCurrentDB() in /home/ehmradmin/e-hmr.com/public/admidio/adm_plugins/formfiller/formfiller.php on line 71

Here is my formfiller.php file

<?php
/******************************************************************************
* FormFiller
*
* Version 2.0.2
*
* Dieses Plugin für Admidio ermöglicht das Ausfüllen von PDF-Formularen sowie das Erstellen von Etiketten.
*
* Copyright : (c) 2004 - 2015 The Admidio Team
* Homepage : http://www.admidio.org
* License : GNU Public License 2 http://www.gnu.org/licenses/gpl-2.0.html
* Author : rmb
*
* Libraries : FormFiller verwendet die externen PHP-Klassen FPDF, FPDI und FPDF_TPL
*
* Version : 2.0.2
* Datum : 18.01.2016
* Änderung : - Die versehentlich gelöschte Funktion "strstr_multiple" wieder eingefügt
* - Link zur Dokumentation geändert
* - Option Vortext "{=" und Nachtext "}=" von lagro eingearbeitet
*
* Version : 2.0.1
* Datum : 02.11.2015
* Änderung : - Fehler (verursacht durch die Methode addHeadline) behoben
*
* Version : 2.0.0
* Datum : 27.05.2015
* Änderung : - Anpassung an Admidio 3.0
* - Deinstallationsroutine erstellt
* - Verfahren zum Einbinden des Plugins (include) geändert
* - Menübezeichnungen angepasst (gleichlautend mit anderen Plugins)
* - Nur Intern: Verwaltung der Konfigurationsdaten geändert
*
* Version : 1.0.3
* Datum : 04.12.2014
* Änderung : Druckmöglichkeit von Profilfoto und aktuellem Datum
*
* Version : 1.0.2
* Datum : 07.05.2014
* Änderung : Erzeugung von Mehrfachdokumenten über neues Modul Listenwahl realisiert
*
* Version : 1.0.1
* Datum : 30.04.2014
* Änderung : Aufruf des Plugins über die Klasse Menu realisiert
* (Systemanforderung jetzt Admidio Version 2.4.4 oder höher)
*
* Version : 1.0.0
* Datum : 14.04.2014
*
*****************************************************************************/

//$gNaviagation ist zwar definiert, aber in diesem Script in bestimmten Fällen nicht sichtbar
global $gNavigation;

// Pfad des Plugins ermitteln
$plugin_folder_pos = strpos(__FILE__, 'adm_plugins') + 11;
$plugin_file_pos = strpos(__FILE__, basename(__FILE__));
$plugin_path = substr(__FILE__, 0, $plugin_folder_pos);
$plugin_folder = substr(__FILE__, $plugin_folder_pos+1, $plugin_file_pos-$plugin_folder_pos-2);

require_once($plugin_path. '/../adm_program/system/common.php');
require_once($plugin_path. '/'.$plugin_folder.'/common_function.php');
require_once($plugin_path. '/'.$plugin_folder.'/classes/configtable.php');

// Einbinden der Sprachdatei
$gL10n->addLanguagePath($plugin_path.'/'.$plugin_folder.'/languages');

$pPreferences = new ConfigTablePFF();

// DB auf Admidio setzen, da evtl. noch andere DBs beim User laufen
$gDb->setCurrentDB();

//Initialisierung und Anzeige des Links nur, wenn vorher keine Deinstallation stattgefunden hat
// sonst wäre die Deinstallation hinfällig, da hier wieder Default-Werte der config in die DB geschrieben werden
if( strpos($gNavigation->getUrl(), 'preferences_function.php?mode=3') === false)
{
if ($pPreferences->checkforupdate())
{
$pPreferences->init();
}
else
{
$pPreferences->read();
}

//$url und $user_id einlesen, falls von der Proilanzeige aufgerufen wurde
$url = $_SERVER['REQUEST_URI'];
$user_id = (isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : '');

// Zeige Link zum Plugin
if(check_showpluginPFF($pPreferences->config['Pluginfreigabe']['freigabe']) )
{
// wenn in der my_body_bottom.php ein $pluginMenu definiert wurde, dann innerhalb dieses Menüs anzeigen,
// wenn nicht, dann innerhalb des (immer vorhandenen) Module-Menus anzeigen
if (isset($pluginMenu))
{
$menue=$pluginMenu;
}
else
{
$menue=$moduleMenu;
}

$menue->addItem('formfiller_show', '/adm_plugins/'.$plugin_folder.'/formfiller_show.php',$gL10n->get('PFF_FORMFILLER'), '/icons/page_white_acrobat.png');
if(strstr($url, 'adm_program/modules/profile/profile.php?user_id=')!=null )
{
foreach($pPreferences->config['Formular']['desc'] as $key => $data)
{
$menue->addItem($data, '/adm_plugins/'.$plugin_folder.'/createpdf.php?user_id='.$user_id.'&form_id='.$key, '['.$data.']', '/icons/page_white_acrobat.png');
}
}
}
}

?>
rmb
Plugin-Developer
Beiträge: 632
Registriert: 10. Mai 2011, 19:56
Wohnort: 86856

Re: Formfiller problem in adding in module

Beitrag von rmb »

Hello kdbone,

which admidio version do you use?

(FormFiller 2.0.2 is for Admidio 3.0, for Admidio 3.1 you need FormFiller 2.1)

rmb
kdbone
Beiträge: 4
Registriert: 9. Jun 2016, 22:52

Re: Formfiller problem in adding in module

Beitrag von kdbone »

I only see version 2.0.1 on the plugins site. I found 2.0.2 on the sourceforge site and thought it was newer.

I see the problem, the latest version on the English site is 2.0.1.

The latest version on the German site is 2.1.1.

I just used the formfiller 2.1.1 and changed the line:

include(SERVER_PATH.'/adm_plugins/formfiller/formfiller.php');

And I now have the link to the formfiller in the modules menu!

Thanks you for your help!

Kyle
Antworten