diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
index 485e31cc11b..d44b01c21b4 100644
--- a/.settings/org.eclipse.core.resources.prefs
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -1,4 +1,4 @@
-#Fri Jan 23 00:49:24 CET 2009
+#Wed Feb 11 15:08:12 CET 2009
eclipse.preferences.version=1
encoding//dev/initdemo/initdemo.sql=UTF-8
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1
@@ -614,6 +614,14 @@ encoding//htdocs/lib/product.lib.php=ISO-8859-1
encoding//htdocs/main.inc.php=ISO-8859-1
encoding//htdocs/master.inc.php=ISO-8859-1
encoding//htdocs/paiement.class.php=ISO-8859-1
+encoding//htdocs/product/canvas/livre/liste.tpl=UTF-8
+encoding//htdocs/product/canvas/livre/livre-create.tpl=UTF-8
+encoding//htdocs/product/canvas/livre/livre-edit.tpl=UTF-8
+encoding//htdocs/product/canvas/livre/livre-view.tpl=UTF-8
+encoding//htdocs/product/canvas/livrecontrat/livrecontrat-edit.tpl=UTF-8
+encoding//htdocs/product/canvas/livrecontrat/livrecontrat-view.tpl=UTF-8
+encoding//htdocs/product/canvas/livrecouverture/livrecouverture-edit.tpl=UTF-8
+encoding//htdocs/product/canvas/livrecouverture/livrecouverture-view.tpl=UTF-8
encoding//htdocs/product/fiche.php=ISO-8859-1
encoding//htdocs/product/reassort.php=ISO-8859-1
encoding//htdocs/product/stats/fiche.php=ISO-8859-1
diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php
index a3080a63f93..705a17e01a4 100644
--- a/dev/skeletons/modMyModule.class.php
+++ b/dev/skeletons/modMyModule.class.php
@@ -43,60 +43,61 @@ class modMyModule extends DolibarrModules
function modMyModule($DB)
{
$this->db = $DB;
-
+
// Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 10000;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'mymodule';
-
+
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
- // It is used to group modules in module setup page
- $this->family = "other";
+ // It is used to group modules in module setup page
+ $this->family = "other";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = eregi_replace('^mod','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Description of module MyModule";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = '1.0';
+ $this->version = '1.0';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 0;
// Name of png file (without png) used for this module.
- // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
+ // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='generic';
-
+
// Data directories to create when module is enabled.
$this->dirs = array();
//$this->dirs[0] = DOL_DATA_ROOT.'/mymodule;
//$this->dirs[1] = DOL_DATA_ROOT.'/mymodule/temp;
-
+
// Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'.
$this->style_sheet = '';
// Config pages. Put here list of php page names stored in admmin directory used to setup module.
$this->config_page_url = array("mymodulesetuppage.php");
-
+
// Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(4,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module
$this->langfiles = array("mymodule");
-
+
// Constants
$this->const = array(); // List of particular constants to add when module is enabled
-
-
+ //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0),
+ // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) );
+
// New pages on tabs
$this->tabs = array('entity:Title:@mymodule:/mymodule/mynewtab.php?id=__ID__');
-
-
+
+
// Boxes
- $this->boxes = array(); // List of boxes
+ $this->boxes = array(); // List of boxes
$r=0;
-
+
// Add here list of php file(s) stored in includes/boxes that contains class to show a box.
// Example:
//$this->boxes[$r][1] = "myboxa.php";
@@ -104,11 +105,11 @@ class modMyModule extends DolibarrModules
//$this->boxes[$r][1] = "myboxb.php";
//$r++;
-
+
// Permissions
$this->rights = array(); // Permission array used by this module
$r=0;
-
+
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example:
// $this->rights[$r][0] = 2000; // Permission id (must not be already used)
@@ -118,11 +119,11 @@ class modMyModule extends DolibarrModules
// $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
// $r++;
-
+
// Main menu entries
$this->menus = array(); // List of menus to add
$r=0;
-
+
// Add here entries to declare new menus
// Example to declare the Top Menu entry:
// $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
@@ -163,11 +164,11 @@ class modMyModule extends DolibarrModules
// 'target'=>'',
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
// $r++;
-
-
+
+
// Exports
$r=1;
-
+
// Example:
// $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
@@ -191,9 +192,9 @@ class modMyModule extends DolibarrModules
function init()
{
$sql = array();
-
+
$result=$this->load_tables();
-
+
return $this->_init($sql);
}
@@ -210,7 +211,7 @@ class modMyModule extends DolibarrModules
return $this->_remove($sql);
}
-
+
/**
* \brief Create tables and keys required by module
* Files mymodule.sql and mymodule.key.sql with create table and create keys
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index c4e89d7f51e..367e571bd39 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -263,10 +263,10 @@ asort($orders);
// Affichage debut page
-if ($mode==0) print $langs->trans("ModulesDesc")." \n";
-if ($mode==1) print $langs->trans("ModulesInterfaceDesc")." \n";
-if ($mode==2) print $langs->trans("ModulesSpecialDesc")." \n";
-if ($mode==3) print $langs->trans("ModulesJobDesc")." \n";
+if ($mode==0) { $tagmode = 'common'; print $langs->trans("ModulesDesc")." \n"; }
+if ($mode==2) { $tagmode = 'other'; print $langs->trans("ModulesSpecialDesc")." \n"; }
+if ($mode==1) { $tagmode = 'interfaces'; print $langs->trans("ModulesInterfaceDesc")." \n"; }
+if ($mode==3) { $tagmode = 'functional'; print $langs->trans("ModulesJobDesc")." \n"; }
print " \n";
@@ -281,15 +281,6 @@ if (! empty($categ[$categidx]))
$h++;
}
-$categidx=1;
-if (! empty($categ[$categidx]))
-{
- $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
- $head[$h][1] = $langs->trans("ModulesInterfaces");
- $head[$h][2] = 'interfaces';
- $h++;
-}
-
$categidx=2;
if (! empty($categ[$categidx]))
{
@@ -299,16 +290,25 @@ if (! empty($categ[$categidx]))
$h++;
}
+$categidx=1;
+if (! empty($categ[$categidx]))
+{
+ $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
+ $head[$h][1] = $langs->trans("ModulesInterfaces");
+ $head[$h][2] = 'interfaces';
+ $h++;
+}
+
$categidx=3;
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
- $head[$h][1] = $langs->trans("ModulesJob");
+ $head[$h][1] = $langs->trans("ModulesSpecial");
$head[$h][2] = 'functional';
$h++;
}
-dolibarr_fiche_head($head, $mode, $langs->trans("Modules"));
+dolibarr_fiche_head($head, $tagmode, $langs->trans("Modules"));
if ($mesg) print '
'.$mesg.'
';
diff --git a/htdocs/docs/class/courrier-droit-editeur.class.php b/htdocs/docs/class/pdf_courrier_droit_editeur.class.php
similarity index 100%
rename from htdocs/docs/class/courrier-droit-editeur.class.php
rename to htdocs/docs/class/pdf_courrier_droit_editeur.class.php
diff --git a/htdocs/docs/document.class.php b/htdocs/docs/document.class.php
index cb5d8bff8b1..245eae29f85 100644
--- a/htdocs/docs/document.class.php
+++ b/htdocs/docs/document.class.php
@@ -37,7 +37,9 @@ class Document
{
$this->db = $db;
}
-
+
+
+
/**
\brief Génère le document
\return int 0= ok, <> 0 = ko
@@ -46,31 +48,11 @@ class Document
{
$errno = 0;
- dolibarr_syslog("Document::Generate id=$id", LOG_DEBUG );
+ dolibarr_syslog("Document::Generate id=$id", LOG_DEBUG );
$this->id = $id;
-
- // On récupère données du mail
- $sql = "SELECT classfile,class";
- $sql .= " FROM ".MAIN_DB_PREFIX."document_generator";
- $sql .= " WHERE rowid = '".$this->id."';";
-
- $resql=$this->db->query($sql);
- if ($resql)
- {
- while ($obj = $this->db->fetch_object($resql) )
- {
- $class = $obj->class;
- $classfile = $obj->classfile;
- }
- $this->db->free($resql);
- }
- else
- {
- print $this->db->error();
- print "$sql\n";
- }
-
-
+ $class = $id;
+ $classfile = 'docs/class/'.$class.'.class.php';
+
require DOL_DOCUMENT_ROOT.'/'.$classfile;
$obj = new $class($this->db);
@@ -78,19 +60,19 @@ class Document
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document";
$sql.= " WHERE name='".$obj->name."';";
-
+
$resql=$this->db->query($sql);
-
+
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document";
$sql.= " (name,file_name,file_extension,date_generation) VALUES";
$sql.= " ('".$obj->name."','".$obj->file."','".$obj->extension."',".$this->db->idate(mktime()).")";
-
+
$resql=$this->db->query($sql);
-
+
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."document");
-
+
$err = $obj->Generate($id);
-
+
if ($err === 0)
{
$this->db->commit();
@@ -101,7 +83,7 @@ class Document
$this->db->rollback();
dolibarr_syslog("Document::Generate ROLLBACK", LOG_ERR );
}
-
+
return $errno;
}
diff --git a/htdocs/docs/generate.php b/htdocs/docs/generate.php
index 060824be377..0e0394422a5 100644
--- a/htdocs/docs/generate.php
+++ b/htdocs/docs/generate.php
@@ -14,39 +14,44 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- * $Source$
*/
/**
- \file htdocs/docs/index.php
- \ingroup document
- \brief Page d'accueil module document
- \version $Revision$
-*/
+ \file htdocs/docs/index.php
+ \ingroup document
+ \brief Page d'accueil module document
+ \version $Id$
+ */
require("./pre.inc.php");
+
+
/*
- * Affichage page configuration module societe
- *
+ * Actions
*/
-if ($_GET["id"] > 0)
+if ($_GET["id"])
{
- require_once(DOL_DOCUMENT_ROOT.'/docs/document.class.php');
- $doc = new Document($db);
- if ($doc->Generate($_GET["id"]) == 0)
- {
- Header("Location: index.php");
- }
+ require_once(DOL_DOCUMENT_ROOT.'/docs/document.class.php');
+ $doc = new Document($db);
+ if ($doc->Generate($_GET["id"]) == 0)
+ {
+ Header("Location: index.php");
+ exit;
+ }
+
}
+
+/*
+ * View
+ */
+
llxHeader();
-print_titre($langs->trans("Documents"));
+print_titre($langs->trans("DocumentsBuilder"));
print "
\n";
print "
\n";
@@ -54,30 +59,18 @@ print '
'.$langs->trans("Name").'
';
print '
'.$langs->trans("Description").'
';
print "
\n";
-$sql = "SELECT dg.rowid,dg.name, dg.classfile, dg.class";
-$sql.= " FROM ".MAIN_DB_PREFIX."document_generator as dg";
-$sql.= " ORDER BY dg.name ASC;";
+// TODO: Scan class that are in docs/class directory to find generator availables
+$listofmodules=array('pdf_courrier_droit_editeur');
-$resql = $db->query($sql);
-if ($resql)
+$var=true;
+foreach ($listofmodules as $val)
{
- $var=True;
- while ($obj = $db->fetch_object($resql) )
- {
-
- $var=!$var;
-
- print "
\n";
}
diff --git a/htdocs/docs/index.php b/htdocs/docs/index.php
index bf60328eb74..9ef4fe14fc3 100644
--- a/htdocs/docs/index.php
+++ b/htdocs/docs/index.php
@@ -14,27 +14,25 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- * $Source$
*/
/**
\file htdocs/docs/index.php
\ingroup document
\brief Page d'accueil module document
- \version $Revision$
+ \version $Id$
*/
require("./pre.inc.php");
+
/*
- * Affichage page configuration module societe
- *
+ * View
*/
+
llxHeader();
-print_titre($langs->trans("Documents"));
+print_titre($langs->trans("DocumentsBuilder"));
print "