Clean a lot of code

This commit is contained in:
Laurent Destailleur 2009-02-11 15:09:59 +00:00
parent ab0d83633f
commit 0056facfd2
27 changed files with 283 additions and 354 deletions

View File

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

View File

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

View File

@ -263,10 +263,10 @@ asort($orders);
// Affichage debut page
if ($mode==0) print $langs->trans("ModulesDesc")."<br>\n";
if ($mode==1) print $langs->trans("ModulesInterfaceDesc")."<br>\n";
if ($mode==2) print $langs->trans("ModulesSpecialDesc")."<br>\n";
if ($mode==3) print $langs->trans("ModulesJobDesc")."<br>\n";
if ($mode==0) { $tagmode = 'common'; print $langs->trans("ModulesDesc")."<br>\n"; }
if ($mode==2) { $tagmode = 'other'; print $langs->trans("ModulesSpecialDesc")."<br>\n"; }
if ($mode==1) { $tagmode = 'interfaces'; print $langs->trans("ModulesInterfaceDesc")."<br>\n"; }
if ($mode==3) { $tagmode = 'functional'; print $langs->trans("ModulesJobDesc")."<br>\n"; }
print "<br>\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 '<div class="error">'.$mesg.'</div>';

View File

@ -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;
}

View File

@ -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 "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
@ -54,30 +59,18 @@ print ' <td>'.$langs->trans("Name").'</td>';
print ' <td>'.$langs->trans("Description").'</td>';
print "</tr>\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 "<tr $bc[$var]>";
print '<td><a href="generate.php?id='.$obj->rowid.'">'.stripslashes($obj->name).'</a></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
}
$var=!$var;
$db->free($resql);
}
else
{
dolibarr_print_error($db);
print "<tr $bc[$var]>";
print '<td><a href="generate.php?id='.urlencode($val).'">'.$val.'</a></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
}

View File

@ -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 "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
@ -52,9 +50,9 @@ if ($resql)
{
$var=True;
while ($obj = $db->fetch_object($resql) )
{
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td>';
$loc = get_exdir($obj->rowid).$obj->rowid.".pdf";

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,98 +19,101 @@
*/
/**
\file htdocs/pre.inc.php
\brief Fichier gestionnaire du menu de gauche de l'accueil
\version $Source$
*/
* \file htdocs/docs/pre.inc.php
* \brief Fichier gestionnaire du menu de gauche de l'accueil
* \version $Source$
*/
require ("../main.inc.php");
function llxHeader($head = "")
{
global $user, $conf, $langs;
require_once("../main.inc.php");
top_menu($head);
$menu = new Menu();
if ($conf->societe->enabled && $user->rights->societe->lire)
{
$langs->load("companies");
$menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"));
if(is_dir("societe/groupe"))
{
function llxHeader($head = "", $title="", $help_url='')
{
global $user, $conf, $langs;
top_menu($head);
$menu = new Menu();
if ($conf->societe->enabled && $user->rights->societe->lire)
{
$langs->load("companies");
$menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"));
if(is_dir("societe/groupe"))
{
$menu->add_submenu(DOL_URL_ROOT."/societe/groupe/index.php", $langs->trans("MenuSocGroup"));
}
$menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts"));
}
if ($conf->commercial->enabled && $user->rights->commercial->lire)
{
$langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial"));
$menu->add_submenu(DOL_URL_ROOT."/comm/clients.php",$langs->trans("Customers"));
$menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects"));
if ($user->rights->propale->lire)
{
}
$menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts"));
}
if ($conf->commercial->enabled && $user->rights->commercial->lire)
{
$langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial"));
$menu->add_submenu(DOL_URL_ROOT."/comm/clients.php",$langs->trans("Customers"));
$menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects"));
if ($user->rights->propale->lire)
{
$langs->load("propal");
$menu->add_submenu(DOL_URL_ROOT."/comm/propal.php", $langs->trans("Prop"));
}
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("MenuFinancial"));
if ($user->rights->facture->lire) {
$langs->load("bills");
$menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills"));
}
}
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
{
$langs->trans("interventions");
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
}
if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire)
{
$langs->load("products");
$chaine="";
if ($conf->produit->enabled) { $chaine.= $langs->trans("Products"); }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.= $langs->trans("Services"); }
$menu->add(DOL_URL_ROOT."/product/index.php", "$chaine");
}
}
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("MenuFinancial"));
if ($user->rights->facture->lire) {
$langs->load("bills");
$menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills"));
}
}
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
{
$langs->trans("interventions");
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
}
if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire)
{
$langs->load("products");
$chaine="";
if ($conf->produit->enabled) { $chaine.= $langs->trans("Products"); }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.= $langs->trans("Services"); }
$menu->add(DOL_URL_ROOT."/product/index.php", "$chaine");
}
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
}
if ($conf->document->enabled)
{
$menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents"));
$menu->add_submenu(DOL_URL_ROOT."/docs/generate.php", $langs->trans("Génération"));
}
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
{
$langs->load("suppliers");
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
}
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
}
left_menu($menu->liste);
if ($conf->document->enabled)
{
$menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("DocumentsBuilder"));
$menu->add_submenu(DOL_URL_ROOT."/docs/generate.php", $langs->trans("Build"));
}
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
{
$langs->load("suppliers");
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
}
left_menu($menu->liste);
}
?>

View File

@ -118,27 +118,6 @@ class DolibarrModules
}
}
// Cree les documents generables
if (is_array($this->docs))
{
foreach ($this->docs as $key => $doc)
{
if (! $err)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_generator (rowid,name,classfile,class) VALUES ";
$sql .= "(".$doc[0].",'".addslashes($doc[1])."','".$doc[2]."','".$doc[3]."');";
$result=$this->db->query($sql);
if (! $result)
{
$this->error=$this->db->error();
dolibarr_syslog("DolibarrModules::_init Error sql=".$sql." - ".$this->error, LOG_ERR);
$err++;
}
}
}
}
// Cree les repertoires
if (is_array($this->dirs))
{
@ -198,9 +177,6 @@ class DolibarrModules
// Supprime les menus apportes par le module
$err+=$this->delete_menus();
// Supprime les documents generables
$err+=$this->delete_docs();
// Execute les requetes sql complementaires
for ($i = 0 ; $i < sizeof($array_sql) ; $i++)
{
@ -535,37 +511,6 @@ class DolibarrModules
}
/**
* \brief Supprime les documents
* \return int Nombre d'erreurs (0 si ok)
*/
function delete_docs()
{
$err=0;
// Supprime les documents generables
if (is_array($this->docs))
{
foreach ($this->docs as $key => $doc)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_generator ";
$sql .= "WHERE name= '".addslashes($doc[0])."' AND classfile='".$doc[1]."'AND class='".$doc[2]."';";
dolibarr_syslog("DolibarrModules::delete_docs sql=".$sql);
$result=$this->db->query($sql);
if (! $result)
{
dolibarr_syslog("DolibarrModules::delete_docs Error sql=".$sql." - ".$this->db->error());
$err++;
}
}
}
return $err;
}
/**
* \brief Supprime les boites
* \return int Nombre d'erreurs (0 si ok)

View File

@ -45,69 +45,69 @@ class modCategorie extends DolibarrModules
{
$this->db = $DB;
$this->numero = 1780;
$this->family = "technic";
// 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));
$this->description = "Gestion des catégories (produits, clients, fournisseurs...)";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->special = 2;
$this->picto = 'generic';
// Dir
$this->dirs = array();
// Dependencies
$this->depends = array("modProduit");
// Config pages
$this->config_page_url = array();
$this->langfiles = array("products","companies","categories");
// Constantes
$this->const = array();
// Boxes
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'categorie';
$r=0;
$this->rights[$r][0] = 241; // id de la permission
$this->rights[$r][1] = 'Lire les categories'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 242; // id de la permission
$this->rights[$r][1] = 'Creer/modifier les categories'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 243; // id de la permission
$this->rights[$r][1] = 'Supprimer les categories'; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 244; // id de la permission
$this->rights[$r][1] = 'Voir le contenu des categories cachees'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'voir';
$r++;
// Exports
//--------
$r=0;
@ -135,7 +135,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
$r++;
$this->export_code[$r]='category_'.$r;
$this->export_label[$r]='List of products categories';
@ -158,9 +158,9 @@ class modCategorie extends DolibarrModules
{
// Permissions
$this->remove();
$sql = array();
return $this->_init($sql);
}
@ -171,7 +171,7 @@ class modCategorie extends DolibarrModules
function remove()
{
$sql = array();
return $this->_remove($sql);
}

View File

@ -51,12 +51,12 @@ class modDocument extends DolibarrModules
$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));
$this->description = "Gestion des documents";
$this->description = "Genération de courriers/publipostages";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->special = 3;
$this->picto='dir';
// Dir
@ -68,7 +68,7 @@ class modDocument extends DolibarrModules
// D<>pendances
$this->depends = array();
$this->requiredby = array();
$this->requiredby = array("modEditeur");
$this->conflictwith = array();
$this->langfiles = array("orders","bills","companies");

View File

@ -52,22 +52,31 @@ class modDroitPret extends DolibarrModules
// 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));
$this->description = "Gestion du droit de prets";
$this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version
$this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->special = 3;
// Dir
$this->dirs = array();
global $dolibarr_smarty_compile;
global $dolibarr_smarty_cache;
$this->dirs = array($dolibarr_smarty_compile,
$dolibarr_smarty_cache);
// D<>pendances
// Dependances
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
$this->needleftmenu = array();
$this->needtotopmenu = array();
$this->langfiles = array("orders","bills","companies");
// Config pages
$this->config_page_url = array("droitpret.php");
// Constantes
$this->const = array();
$this->const=array(0=>array('PRODUCT_CANVAS_ABILITY','chaine',1,'This is a constant',1),
1=>array('MAIN_NEED_SMARTY','chaine',1,'Need smarty',0)
);
// Boxes
$this->boxes = array();

View File

@ -53,43 +53,37 @@ class modEditeur extends DolibarrModules
$this->name = eregi_replace('^mod','',get_class($this));
$this->description = "Gestion des editeurs";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 3;
$this->picto='book';
// Dir
$this->dirs = array();
global $dolibarr_smarty_compile;
global $dolibarr_smarty_cache;
$this->dirs = array($dolibarr_smarty_compile,
$dolibarr_smarty_cache);
// Config pages
$this->config_page_url = array("editeur.php");
// D<EFBFBD>pendances
$this->depends = array();
// Dependances
$this->depends = array("modDocument");
$this->requiredby = array();
$this->conflictwith = array();
$this->needleftmenu = array('default.php');
$this->needleftmenu = array('rodolphe.php');
$this->needtotopmenu = array();
$this->langfiles = array("orders","bills","companies");
// Constantes
$this->const = array();
$this->const=array();
// Boites
$this->boxes = array();
// Documents
$this->docs = array();
$this->docs[0][0] = 1;
$this->docs[0][1] = 'Courrier des droits';
$this->docs[0][2] = 'docs/class/courrier-droit-editeur.class.php';
$this->docs[0][3] = 'pdf_courrier_droit_editeur';
// Permissions
$this->rights = array();
}
@ -101,8 +95,6 @@ class modEditeur extends DolibarrModules
{
global $conf;
$sql = array();
return $this->_init($sql);
}
@ -113,7 +105,7 @@ class modEditeur extends DolibarrModules
*/
function remove()
{
$sql = array();
global $conf;
return $this->_remove($sql);
}

View File

@ -57,9 +57,9 @@ class modEnergie extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->special = 3;
$this->picto='energie';
// Dir

View File

@ -54,7 +54,7 @@ class modMailing extends DolibarrModules
$this->description = "Gestion des EMailings";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->special = 0;
$this->picto='email';
// Dir
@ -113,7 +113,7 @@ class modMailing extends DolibarrModules
{
// Permissions
$this->remove();
return $this->_init($sql);
}

View File

@ -58,9 +58,9 @@ class modTelephonie extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->special = 3;
$this->picto='phoning';
// Dir

View File

@ -69,11 +69,10 @@ OtherSetup=Other setup
CurrentValueSeparatorDecimal=Decimal separator
CurrentValueSeparatorThousand=Thousand separator
Modules=Modules
ModulesCommon=Common modules
ModulesInterfaces=Interfaces modules
ModulesCommon=Main modules
ModulesOther=Other modules
ModulesJob=Setup modules
ModulesSpecial=Special modules
ModulesInterfaces=Interfaces modules
ModulesSpecial=Modules very specific
ParameterInDolibarr=Parameter %s
LanguageParameter=Language parameter %s
LanguageBrowserParameter=Parameter %s

View File

@ -69,11 +69,10 @@ OtherSetup=Divers
CurrentValueSeparatorDecimal=Séparateur décimal
CurrentValueSeparatorThousand=Séparateur de milliers
Modules=Modules
ModulesCommon=Modules standards
ModulesCommon=Modules principaux
ModulesOther=Modules complémentaires
ModulesInterfaces=Modules interfaces
ModulesOther=Modules autres
ModulesJob=Modules métiers
ModulesSpecial=Modules spéciaux
ModulesSpecial=Modules très spécifiques
ParameterInDolibarr=Variable %s
LanguageParameter=Variable langue %s
LanguageBrowserParameter=Variable %s

View File

@ -110,7 +110,7 @@ function llxHeader($head = "")
if (! empty($conf->document->enabled))
{
$menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents"));
$menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("DocumentsBuilder"));
}
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire)

View File

@ -14,7 +14,7 @@
<td class="liste_titre">Case
</td>
<td class="liste_titre" >Référence
<td class="liste_titre" >Référence
<a href="liste.php?sortfield=p.ref&amp;sortorder=asc&amp;begin=&amp;envente=&amp;canvas=livre&amp;fourn_id=&amp;snom=&amp;sref=">
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
</a>
@ -33,7 +33,7 @@
</td>
<td class="liste_titre" align="center">Casier</td>
<td class="liste_titre" align="center">Entrepôt</td>
<td class="liste_titre" align="center">Entrepot</td>
<td class="liste_titre" align="center">Ventes</td>
<td class="liste_titre">Stock</td>
<td class="liste_titre" align="center">Pages</td>

View File

@ -35,7 +35,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Référence</td>
<td width="15%">Référence</td>
<td colspan="2">
<input name="ref" size="20" value="{$prod_ref}"
class="{$class_normal_ref}" onfocus="this.className='{$class_focus_ref}';" onblur="this.className='{$class_normal_ref}';">
@ -62,13 +62,13 @@
{$prod_isbn}
</td>
<td width="15%">ISBN-13</td>
<td width="35%"><i>sera calculé</i>
<td width="35%"><i>sera calculé</i>
</td>
</tr>
<tr>
<td width="15%">EAN</td>
<td colspan="3" width="85%"><i>sera calculé</i></td>
<td colspan="3" width="85%"><i>sera calculé</i></td>
</tr>
<tr>
@ -100,7 +100,7 @@
</tr>
<tr>
<td>Prix de revient</td>
<td><i>sera calculé</i></td>
<td><i>sera calculé</i></td>
<td>Prix reliure</td>
<td>
<input name="px_reliure" type="text" size="7" maxlength="6" value="{$prod_pxreliure}"
@ -171,7 +171,7 @@
</td>
</tr>
<tr>
<td width="15%">Durée du contrat :</td>
<td width="15%">Durée du contrat :</td>
<td width="35%">
<input name="contrat_duree" type="text" size="7" maxlength="6" value="{$livre_contrat_duree}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -186,7 +186,7 @@
<input name="contrat_taux" type="text" size="7" maxlength="6" value="{$livre_contrat_taux}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">%
</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>
<input name="contrat_quant" type="text" size="7" maxlength="6" value="{$livre_contrat_quant}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -213,7 +213,7 @@
</tr>
<tr>
<td colspan="4" align="center">
<input type="submit" class="button" value="Créer">
<input type="submit" class="button" value="Créer">
</td>
</tr>

View File

@ -29,14 +29,14 @@
<table width="100%" border="0" class="notopnoleftnoright">
<tr>
<td class="notopnoleftnoright" valign="middle">
<div class="titre">Éditer Livre</div>
<div class="titre">Éditer Livre</div>
</td>
</tr>
</table>
<table class="border" width="100%">
<tr>
<td width="15%">Réf.</td>
<td width="15%">Réf.</td>
<td colspan="2">
<input name="ref" size="20" value="{$prod_ref}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -182,7 +182,7 @@
<td>Saisi par</td><td>{$livre_contrat_user_fullname}</td>
</tr>
<tr>
<td width="15%">Durée du contrat :</td>
<td width="15%">Durée du contrat :</td>
<td width="35%">
<input name="contrat_duree" type="text" size="7" maxlength="6" value="{$livre_contrat_duree}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -198,7 +198,7 @@
<input name="contrat_taux" type="text" size="7" maxlength="6" value="{$livre_contrat_taux}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">%
</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>
<input name="contrat_quant" type="text" size="7" maxlength="6" value="{$livre_contrat_quant}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -220,7 +220,7 @@
<td>Saisi par</td><td>{$livre_contrat_user_fullname}</td>
</tr>
<tr>
<td width="15%">Durée du contrat : </td>
<td width="15%">Durée du contrat : </td>
<td width="35%">{$livre_contrat_duree}</td>
<td width="15%">Date d'application</td>
<td width="35%">{$livre_contrat_date_app|date_format:"%d %B %Y"}</td>
@ -228,7 +228,7 @@
<tr>
<td>Taux conclu</td>
<td>{$livre_contrat_taux} %</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>{$livre_contrat_quant}</td>
</tr>
{/if}

View File

@ -24,7 +24,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Référence</td>
<td width="15%">Référence</td>
<td width="35%" style="font-weight: bold;">{$prod_ref}</td>
<td width="50%" colspan="2" align="right">
{$fiche_cursor_prev}{$fiche_cursor_next}
@ -96,7 +96,7 @@
</tr>
<tr>
<td width="15%">Stock réel</td>
<td width="15%">Stock réel</td>
<td width="35%">{$prod_stock_reel}</td>
<td width="15%">Exemplaires en commande</td>
<td width="35%">{$prod_stock_in_command}</td>
@ -125,7 +125,7 @@
</tr>
<tr>
<td width="15%">Durée du contrat : </td>
<td width="15%">Durée du contrat : </td>
<td width="35%">{$livre_contrat_duree}</td>
<td width="15%">Date d'application</td>
<td width="35%">{$livre_contrat_date_app|date_format:"%d %B %Y"}</td>
@ -134,7 +134,7 @@
<tr>
<td>Taux conclu</td>
<td>{$livre_contrat_taux} %</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>{$livre_contrat_quant}</td>
</tr>

View File

@ -10,7 +10,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Réf.</td>
<td width="15%">Réf.</td>
<td >{$prod_ref}</td>
</tr>
@ -39,7 +39,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Durée du contrat :</td>
<td width="15%">Durée du contrat :</td>
<td width="35%">
<input name="contrat_duree" type="text" size="7" maxlength="6" value="{$prod_contrat_duree}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -54,7 +54,7 @@
<input name="contrat_taux" type="text" size="7" maxlength="6" value="{$prod_contrat_taux}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">%
</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>
<input name="contrat_quant" type="text" size="7" maxlength="6" value="{$prod_contrat_quant}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">

View File

@ -1,7 +1,7 @@
<!-- BEGIN SMARTY TEMPLATE -->
<table class="border" width="100%">
<tr>
<td width="15%">Référence</td>
<td width="15%">Référence</td>
<td width="35%" style="font-weight: bold;">{$prod_ref}</td>
<td width="50%" colspan="2" align="right">
{$fiche_cursor_prev}{$fiche_cursor_next}
@ -28,7 +28,7 @@
</tr>
<tr>
<td width="15%">Stock réel</td>
<td width="15%">Stock réel</td>
<td width="35%">{$prod_stock_reel}</td>
<td width="15%">Exemplaires en commande</td>
<td width="35%">{$prod_stock_in_command}</td>
@ -41,7 +41,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Durée du contrat : </td>
<td width="15%">Durée du contrat : </td>
<td width="35%">{$prod_contrat_duree}</td>
<td width="15%">Date d'application</td>
<td width="35%">{$prod_contrat_date_app|date_format:"%e %B %Y"}</td>
@ -50,7 +50,7 @@
<tr>
<td>Taux conclu</td>
<td>{$prod_contrat_taux}</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>{$prod_contrat_quant}</td>
</tr>

View File

@ -7,7 +7,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Réf.</td>
<td width="15%">Réf.</td>
<td colspan="2">
<input name="ref" size="20" value="{$prod_ref}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -131,7 +131,7 @@
<table class="border" width="100%">
<tr>
<td width="15%">Durée du contrat :</td>
<td width="15%">Durée du contrat :</td>
<td width="35%">
<input name="contrat_duree" type="text" size="7" maxlength="6" value="{$prod_contrat_duree}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
@ -149,7 +149,7 @@
<input name="contrat_taux" type="text" size="7" maxlength="6" value="{$prod_contrat_taux}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">%
</td>
<td>Quantité achetée</td>
<td>Quantité achetée</td>
<td>
<input name="contrat_quant" type="text" size="7" maxlength="6" value="{$prod_contrat_quant}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">

View File

@ -1,7 +1,7 @@
<!-- BEGIN SMARTY TEMPLATE -->
<table class="border" width="100%">
<tr>
<td width="15%">Référence</td>
<td width="15%">Réf</td>
<td width="35%" style="font-weight: bold;">{$livre_ref}</td>
<td width="50%" align="right">
&nbsp;
@ -26,7 +26,7 @@
</tr>
<tr>
<td width="15%">Stock réel</td>
<td width="15%">Stock réel</td>
<td width="35%">{$prod_stock_reel}</td>
<td width="15%">Exemplaires en commande</td>
<td width="35%">{$prod_stock_in_command}</td>