HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   Problems on creating new module (http://www.howtoforge.com/forums/showthread.php?t=48296)

bruno_floyd 26th August 2010 15:27

Problems on creating new module
 
Hi guys,

I'm trying to creat a new module following the instructions based on this tutorial:
http://docs.ispconfig.org/development/interface/

I created the DB Table of the new module on my own at the main account accoding to the model used on the other tables... and did all the steps, changing what is concerned to my new module instead of "help".

I'm able to select the new module for the admin, but when I login again and click on the link of the it, I got the following error on a alertbox:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../themes/default/css/central.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="uniForm">
<div id="errorMsg">
<h3>Error</h3>
<ol>
<li>301</li>
</ol>
</div>
</div>
</body>
</html>


Does anybody knows what's going on?
Thanks guys! :)

till 26th August 2010 15:36

Which ISPConfig version do you use?

bruno_floyd 26th August 2010 15:50

Last release... 3.0.2.2

I installed on a computer for testing. I creat a new table at the DB and uploading the files I created to the ISPConfig directory and testing...

bruno_floyd 31st August 2010 16:46

I had success on creating my new module and so on...

Now I'm trying to setup the admin and user permissions. How can I set a button, for exemple the "delete entry" button to only appear when the logged account is from the Admin?

Thks guys!
:)

till 31st August 2010 19:14

This should work in all templates:

Code:

<tmpl_if name="is_admin">
.... your html code here ....
</tmpl_if>


bruno_floyd 2nd September 2010 14:41

Thanks till!

It worked! :)

I have another question if you allow me...

I'm trying to get a valeu from the DB, doing this:

$sql = $app->db->query("SELECT groupid FROM sys_group WHERE client_id = ".$this->dataRecord['indicou_id']);

$group = $app->db->queryOneRecord($sql);

And then update "sys_groupid" from my table "indicacao":

$app->db->query("UPDATE indicacao SET sys_groupid = ".$group." WHERE indicacao_id = ".$this->id);

These lines are in the function onAfterInsert()... and when I execute another stuff from my code in that section they are executed, but not the update above. Could you help?

Thanks again!
;)

bruno_floyd 9th September 2010 00:30

Can you help me till?

sorry about disturbing ya!
=)

till 9th September 2010 10:35

The code to get the group has to look like this:

$group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$this->dataRecord['indicou_id']);

bruno_floyd 14th September 2010 16:02

I could not store the value from the DB to my $group variable...

Is this the right way to get a value from the Db and put into the variable?

Thanks again till!
:D

till 15th September 2010 15:34

$group is a hash array, it is not a single value.


All times are GMT +2. The time now is 16:03.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.