cvsimport
Conflicts: htdocs/contact/canvas/actions_contactcard_common.class.php htdocs/contact/fiche.php htdocs/core/class/canvas.class.php htdocs/societe/class/societe.class.php htdocs/societe/soc.php
This commit is contained in:
commit
f08e9ae5c6
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ default.properties
|
|||||||
.settings/
|
.settings/
|
||||||
.buildpath
|
.buildpath
|
||||||
.gitmodules
|
.gitmodules
|
||||||
|
dolibarr_install.log
|
||||||
|
|||||||
@ -121,13 +121,11 @@ if ($resql)
|
|||||||
print_barre_liste($langs->trans("SocialContributions"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
|
print_barre_liste($langs->trans("SocialContributions"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mesg)
|
|
||||||
{
|
dol_htmloutput_mesg($mesg);
|
||||||
print $mesg."<br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (empty($mysoc->pays_id) && empty($mysoc->pays_code))
|
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
||||||
{
|
{
|
||||||
print '<div class="error">';
|
print '<div class="error">';
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@ -54,7 +54,7 @@ abstract class ActionsContactCardCommon
|
|||||||
function __construct($DB, $dirmodule, $targetmodule, $canvas, $card)
|
function __construct($DB, $dirmodule, $targetmodule, $canvas, $card)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
$this->dirmodule = $targetmodule;
|
$this->dirmodule = $dirmodule;
|
||||||
$this->targetmodule = $targetmodule;
|
$this->targetmodule = $targetmodule;
|
||||||
$this->canvas = $canvas;
|
$this->canvas = $canvas;
|
||||||
$this->card = $card;
|
$this->card = $card;
|
||||||
|
|||||||
@ -277,7 +277,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists())
|
|||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// When used with CANVAS
|
// When used with CANVAS
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
if (! $objcanvas->hasActions() && $id)
|
||||||
|
{
|
||||||
|
$object = new Societe($db);
|
||||||
|
$object->fetch($id); // For use with "pure canvas" (canvas that contains templates only)
|
||||||
|
}
|
||||||
$objcanvas->assign_values($action, $id); // Set value for templates
|
$objcanvas->assign_values($action, $id); // Set value for templates
|
||||||
$objcanvas->display_canvas(); // Show template
|
$objcanvas->display_canvas(); // Show template
|
||||||
}
|
}
|
||||||
@ -324,6 +328,8 @@ else
|
|||||||
/*
|
/*
|
||||||
* Fiche en mode creation
|
* Fiche en mode creation
|
||||||
*/
|
*/
|
||||||
|
$object->canvas=$canvas;
|
||||||
|
|
||||||
$object->fk_departement = $_POST["departement_id"];
|
$object->fk_departement = $_POST["departement_id"];
|
||||||
|
|
||||||
// We set pays_id, pays_code and label for the selected country
|
// We set pays_id, pays_code and label for the selected country
|
||||||
|
|||||||
@ -37,24 +37,22 @@ class Canvas
|
|||||||
|
|
||||||
var $dirmodule; // Module directory
|
var $dirmodule; // Module directory
|
||||||
var $targetmodule; // Module concerned by canvas (ex: thirdparty, contact, ...)
|
var $targetmodule; // Module concerned by canvas (ex: thirdparty, contact, ...)
|
||||||
var $canvas; // Name of canvas
|
var $canvas; // Name of canvas (ex: company, individual, product, service, ...)
|
||||||
var $card; // Tab (sub-canvas)
|
var $card; // Tab (sub-canvas)
|
||||||
|
|
||||||
var $template_dir; // Initialized by getCanvas with templates directory
|
var $template_dir; // Initialized by getCanvas with templates directory
|
||||||
var $control_file; // Initialized by getCanvas with controller file name
|
|
||||||
var $control; // Initialized by getCanvas with controller instance
|
var $control; // Initialized by getCanvas with controller instance
|
||||||
var $object; // Initialized by getCanvas with dao instance, filled by getObject
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $DB Database handler
|
||||||
|
* @param string $actiontype Action type ('create', 'view', 'edit', 'list')
|
||||||
*/
|
*/
|
||||||
function __construct($DB, $actiontype='view')
|
function __construct($DB, $actiontype='view')
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|
||||||
$this->actiontype = $actiontype;
|
$this->actiontype = $actiontype;
|
||||||
if ($this->actiontype == 'add') $this->actiontype='create';
|
if ($this->actiontype == 'add') $this->actiontype='create';
|
||||||
if ($this->actiontype == 'update') $this->actiontype='edit';
|
if ($this->actiontype == 'update') $this->actiontype='edit';
|
||||||
@ -62,19 +60,17 @@ class Canvas
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize properties: ->targetmodule, ->canvas, ->card
|
* Initialize properties: ->targetmodule, ->canvas, ->card, ->dirmodule, ->template_dir
|
||||||
* and MVC properties: ->control (Controller), ->control->object (Model), ->template_dir (View)
|
|
||||||
*
|
*
|
||||||
* @param module Name of target module (thirdparty, contact, ...)
|
* @param string $module Name of target module (thirdparty, contact, ...)
|
||||||
* @param card Type of card (ex: 'card', 'info', 'contactcard', ...) or '' for a list page
|
* @param string $card Tab name of card (ex: 'card', 'info', 'contactcard', ...) or '' for a list page
|
||||||
* @param canvas Name of canvas (ex: mycanvas, default, or mycanvas@myexternalmodule)
|
* @param string $canvas Name of canvas (ex: mycanvas, default, or mycanvas@myexternalmodule)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getCanvas($module, $card, $canvas)
|
function getCanvas($module, $card, $canvas)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$error='';
|
|
||||||
|
|
||||||
// Set properties with value specific to dolibarr core: this->targetmodule, this->card, this->canvas
|
// Set properties with value specific to dolibarr core: this->targetmodule, this->card, this->canvas
|
||||||
$this->targetmodule = $module;
|
$this->targetmodule = $module;
|
||||||
$this->canvas = $canvas;
|
$this->canvas = $canvas;
|
||||||
@ -89,6 +85,7 @@ class Canvas
|
|||||||
// For compatibility
|
// For compatibility
|
||||||
if ($this->dirmodule == 'thirdparty') { $this->dirmodule = 'societe'; }
|
if ($this->dirmodule == 'thirdparty') { $this->dirmodule = 'societe'; }
|
||||||
|
|
||||||
|
// Control file
|
||||||
$controlclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/actions_'.$this->card.'_'.$this->canvas.'.class.php');
|
$controlclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/actions_'.$this->card.'_'.$this->canvas.'.class.php');
|
||||||
if (file_exists($controlclassfile))
|
if (file_exists($controlclassfile))
|
||||||
{
|
{
|
||||||
@ -110,17 +107,24 @@ class Canvas
|
|||||||
|
|
||||||
//print 'dimodule='.$dirmodule.' canvas='.$this->canvas.'<br>';
|
//print 'dimodule='.$dirmodule.' canvas='.$this->canvas.'<br>';
|
||||||
//print ' => template_dir='.$this->template_dir.'<br>';
|
//print ' => template_dir='.$this->template_dir.'<br>';
|
||||||
//print ' => control_file='.$this->control_file.' is_object(this->control)='.is_object($this->control).'<br>';
|
}
|
||||||
|
|
||||||
return 1;
|
/**
|
||||||
|
* Return if a canvas contains an action controller
|
||||||
|
*
|
||||||
|
* @return boolean Return if canvas contains actions (old feature. now actions should be inside hooks)
|
||||||
|
*/
|
||||||
|
function hasActions()
|
||||||
|
{
|
||||||
|
return (! is_object($this->control));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared method for canvas to execute actions
|
* Shared method for canvas to execute actions
|
||||||
*
|
*
|
||||||
* @param string $action Action string
|
* @param string &$action Action string
|
||||||
* @param int $id Object id
|
* @param int $id Object id
|
||||||
* @return void
|
* @return mixed Return return code of doActions of canvas
|
||||||
*/
|
*/
|
||||||
function doActions(&$action='view', $id=0)
|
function doActions(&$action='view', $id=0)
|
||||||
{
|
{
|
||||||
@ -134,7 +138,7 @@ class Canvas
|
|||||||
/**
|
/**
|
||||||
* Shared method for canvas to assign values for templates
|
* Shared method for canvas to assign values for templates
|
||||||
*
|
*
|
||||||
* @param string $action Action string
|
* @param string &$action Action string
|
||||||
* @param int $id Object id
|
* @param int $id Object id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -146,7 +150,7 @@ class Canvas
|
|||||||
/**
|
/**
|
||||||
* Return the template to display canvas (if it exists)
|
* Return the template to display canvas (if it exists)
|
||||||
*
|
*
|
||||||
* @return string Path to display canvas file if it exists, '' otherwise.
|
* @return int 0=Canvas template file does not exist, 1=Canvas template file exists
|
||||||
*/
|
*/
|
||||||
function displayCanvasExists()
|
function displayCanvasExists()
|
||||||
{
|
{
|
||||||
@ -158,8 +162,7 @@ class Canvas
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a canvas page. This will include the template for output.
|
* Display a canvas page. This will include the template for output.
|
||||||
* Variables used by templates may have been defined, loaded before
|
* Variables used by templates may have been defined or loaded before into the assign_values function.
|
||||||
* into the assign_values function.
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -459,8 +459,8 @@ class ProductFournisseur extends Product
|
|||||||
/**
|
/**
|
||||||
* List all supplier prices of a product
|
* List all supplier prices of a product
|
||||||
*
|
*
|
||||||
* @param rowid id du produit
|
* @param int $rowid id du produit
|
||||||
* @return table table de ProductFournisseur
|
* @return array Array of ProductFournisseur
|
||||||
*/
|
*/
|
||||||
function fetch_product_fournisseur($prodid)
|
function fetch_product_fournisseur($prodid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -986,7 +986,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
//print "$object->id, $object->socid, $object->fk_project";
|
//print "$object->id, $object->socid, $object->fk_project";
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid');
|
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -158,14 +158,16 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Save").'"></center>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table></form>";
|
print "</form>";
|
||||||
|
|
||||||
print "</div>\n";
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -130,7 +130,7 @@ if ($_GET["facid"])
|
|||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Note priv<EFBFBD>e
|
// Note private
|
||||||
if (! $user->societe_id)
|
if (! $user->societe_id)
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("NotePrivate").' :</td>';
|
print '<tr><td valign="top">'.$langs->trans("NotePrivate").' :</td>';
|
||||||
@ -153,11 +153,11 @@ if ($_GET["facid"])
|
|||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
print '</div>';
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer && $_GET["action"] <> 'edit')
|
if ($user->rights->fournisseur->facture->creer && $_GET["action"] <> 'edit')
|
||||||
|
|||||||
@ -1,132 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \defgroup mantis Module mantis
|
|
||||||
* \brief Module to include Mantis into Dolibarr
|
|
||||||
* \file htdocs/includes/modules/modMantis.class.php
|
|
||||||
* \ingroup mantis
|
|
||||||
* \brief Description and activation file for module Mantis
|
|
||||||
*/
|
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \class modMantis
|
|
||||||
* \brief Description and activation class for module Mantis
|
|
||||||
*/
|
|
||||||
|
|
||||||
class modMantis extends DolibarrModules
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Constructor. Define names, constants, directories, boxes, permissions
|
|
||||||
* \param DB Database handler
|
|
||||||
*/
|
|
||||||
function modMantis($DB)
|
|
||||||
{
|
|
||||||
$this->db = $DB;
|
|
||||||
|
|
||||||
// Id for module (must be unique).
|
|
||||||
// Use here a free id.
|
|
||||||
$this->numero = 50300;
|
|
||||||
|
|
||||||
// Family can be 'crm','financial','hr','projects','product','technic','other'
|
|
||||||
// It is used to sort modules in module setup page
|
|
||||||
$this->family = "projects";
|
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
|
||||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
|
||||||
// Module description used translation string 'ModuleXXXDesc' not found (XXX is id value)
|
|
||||||
$this->description = "Interfacage avec le bug tracking Mantis";
|
|
||||||
// Possible values for version are: 'experimental' or 'dolibarr' or version
|
|
||||||
$this->version = 'development';
|
|
||||||
// Id used in llx_const table to manage module status (enabled/disabled)
|
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
|
||||||
// Where to store the module in setup page (0=common,1=interface,2=other)
|
|
||||||
$this->special = 1;
|
|
||||||
// Name of png file (without png) used for this module
|
|
||||||
$this->picto='calendar';
|
|
||||||
|
|
||||||
// Data directories to create when module is enabled
|
|
||||||
$this->dirs = array();
|
|
||||||
|
|
||||||
// Config pages
|
|
||||||
$this->config_page_url = array("mantis.php@mantis");
|
|
||||||
|
|
||||||
// Dependencies
|
|
||||||
$this->depends = array(); // List of modules id that must be enabled
|
|
||||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
|
||||||
|
|
||||||
// Constants
|
|
||||||
$this->const = array(); // List of parameters
|
|
||||||
|
|
||||||
// Boxes
|
|
||||||
$this->boxes = array(); // List of boxes
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
$this->rights_class = 'mantis'; // Permission key
|
|
||||||
$this->rights = array(); // Permission array used by this module
|
|
||||||
|
|
||||||
// Menus
|
|
||||||
//------
|
|
||||||
$r=0;
|
|
||||||
|
|
||||||
$this->menu[$r]=array('fk_menu'=>0,
|
|
||||||
'type'=>'top',
|
|
||||||
'titre'=>'BugTracker',
|
|
||||||
'mainmenu'=>'mantis',
|
|
||||||
'leftmenu'=>'1',
|
|
||||||
'url'=>'/mantis/mantis.php',
|
|
||||||
'langs'=>'other',
|
|
||||||
'position'=>100,
|
|
||||||
'enabled'=>'$conf->mantis->enabled',
|
|
||||||
'perms'=>'',
|
|
||||||
'target'=>'',
|
|
||||||
'user'=>0);
|
|
||||||
$r++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Function called when module is enabled.
|
|
||||||
* Add constants, boxes and permissions into Dolibarr database.
|
|
||||||
* It also creates data directories.
|
|
||||||
*/
|
|
||||||
function init()
|
|
||||||
{
|
|
||||||
$sql = array();
|
|
||||||
|
|
||||||
return $this->_init($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Function called when module is disabled.
|
|
||||||
* Remove from database constants, boxes and permissions from Dolibarr database.
|
|
||||||
* Data directories are not deleted.
|
|
||||||
*/
|
|
||||||
function remove()
|
|
||||||
{
|
|
||||||
$sql = array();
|
|
||||||
|
|
||||||
return $this->_remove($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@ -676,7 +676,7 @@ if (! defined('NOLOGIN'))
|
|||||||
{
|
{
|
||||||
// If not active, we refuse the user
|
// If not active, we refuse the user
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
dol_syslog ("Authentification ko as login is disabled");
|
dol_syslog("Authentification ko as login is disabled");
|
||||||
accessforbidden($langs->trans("ErrorLoginDisabled"));
|
accessforbidden($langs->trans("ErrorLoginDisabled"));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -763,11 +763,13 @@ if (! function_exists("llxHeader"))
|
|||||||
* @param string $help_url Url links to help page
|
* @param string $help_url Url links to help page
|
||||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||||
* For other external page: http://server/url
|
* For other external page: http://server/url
|
||||||
|
* @param string $target Target to use on links
|
||||||
* @param int $disablejs More content into html header
|
* @param int $disablejs More content into html header
|
||||||
* @param int $disablehead More content into html header
|
* @param int $disablehead More content into html header
|
||||||
* @param array $arrayofjs Array of complementary js files
|
* @param array $arrayofjs Array of complementary js files
|
||||||
* @param array $arrayofcss Array of complementary css files
|
* @param array $arrayofcss Array of complementary css files
|
||||||
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
||||||
{
|
{
|
||||||
@ -781,6 +783,8 @@ if (! function_exists("llxHeader"))
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show HTTP header
|
* Show HTTP header
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function top_httphead()
|
function top_httphead()
|
||||||
{
|
{
|
||||||
@ -1047,6 +1051,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
* @param array $arrayofjs Array of js files to add in header
|
* @param array $arrayofjs Array of js files to add in header
|
||||||
* @param array $arrayofcss Array of css files to add in header
|
* @param array $arrayofcss Array of css files to add in header
|
||||||
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
||||||
{
|
{
|
||||||
@ -1275,14 +1280,16 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show left menu bar
|
* Show left menu bar
|
||||||
* @param menu_array_before Table of menu entries to show before entries of menu handler
|
*
|
||||||
* @param helppagename Name of wiki page for help ('' by default).
|
* @param array $menu_array_before Table of menu entries to show before entries of menu handler
|
||||||
|
* @param string $helppagename Name of wiki page for help ('' by default).
|
||||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||||
* For other external page: http://server/url
|
* For other external page: http://server/url
|
||||||
* @param moresearchform Search Form Permanent Supplemental
|
* @param string $moresearchform Search Form Permanent Supplemental
|
||||||
* @param menu_array_after Table of menu entries to show after entries of menu handler
|
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
||||||
* @param leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
|
* @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
|
||||||
* @param title Title of web page
|
* @param string $title Title of web page
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
||||||
{
|
{
|
||||||
@ -1305,30 +1312,26 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php',
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
|
||||||
img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php',
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
||||||
img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((($conf->product->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire))
|
if ((($conf->product->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire))
|
||||||
&& $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)
|
&& $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php',
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
||||||
img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
|
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
||||||
img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
// Execute hook printSearchForm
|
||||||
@ -1460,8 +1463,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
if (empty($leftmenuwithoutmainarea)) main_area($title);
|
if (empty($leftmenuwithoutmainarea)) main_area($title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin main area
|
* Begin main area
|
||||||
|
*
|
||||||
|
* @param string $title Title
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function main_area($title='')
|
function main_area($title='')
|
||||||
{
|
{
|
||||||
@ -1499,8 +1506,10 @@ function main_area($title='')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return helpbaseurl, helppage and mode
|
* Return helpbaseurl, helppage and mode
|
||||||
* @param helppagename Page name (EN:xxx,ES:eee,FR:fff...)
|
*
|
||||||
* @param langs Language
|
* @param string $helppagename Page name (EN:xxx,ES:eee,FR:fff...)
|
||||||
|
* @param Translate $langs Language
|
||||||
|
* @return array Array of help urls
|
||||||
*/
|
*/
|
||||||
function getHelpParamFor($helppagename,$langs)
|
function getHelpParamFor($helppagename,$langs)
|
||||||
{
|
{
|
||||||
@ -1538,13 +1547,14 @@ function getHelpParamFor($helppagename,$langs)
|
|||||||
/**
|
/**
|
||||||
* Show a search area
|
* Show a search area
|
||||||
*
|
*
|
||||||
* @param urlaction Url post
|
* @param string $urlaction Url post
|
||||||
* @param urlobject Url of the link under the search box
|
* @param string $urlobject Url of the link under the search box
|
||||||
* @param title Title search area
|
* @param string $title Title search area
|
||||||
* @param htmlmodesearch 'search'
|
* @param string $htmlmodesearch Value to set into parameter "mode_search" ('soc','contact','products','member',...)
|
||||||
* @param htmlinputname Field Name input form
|
* @param string $htmlinputname Field Name input form
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname)
|
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -1567,13 +1577,15 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show HTML footer
|
|
||||||
* Close div /DIV data-role=page + /DIV class=fiche + /DIV /DIV main layout + /BODY + /HTML
|
|
||||||
* @param foot A text to add in HTML generated page
|
|
||||||
*/
|
|
||||||
if (! function_exists("llxFooter"))
|
if (! function_exists("llxFooter"))
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Show HTML footer
|
||||||
|
* Close div /DIV data-role=page + /DIV class=fiche + /DIV /DIV main layout + /BODY + /HTML
|
||||||
|
*
|
||||||
|
* @param string $foot A text to add in HTML generated page
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function llxFooter($foot='')
|
function llxFooter($foot='')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $dolibarr_auto_user, $micro_start_time;
|
global $conf, $langs, $dolibarr_auto_user, $micro_start_time;
|
||||||
|
|||||||
@ -1,206 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
|
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/mantis/admin/mantis.php
|
|
||||||
* \ingroup mantis
|
|
||||||
* \brief Page de configuration du module mantis
|
|
||||||
*/
|
|
||||||
|
|
||||||
require("../../main.inc.php");
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/mantis/class/mantis.class.php');
|
|
||||||
|
|
||||||
|
|
||||||
if (!$user->admin)
|
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
|
|
||||||
$langs->load("admin");
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$def = array();
|
|
||||||
$actiontest=$_POST["test"];
|
|
||||||
$actionsave=$_POST["save"];
|
|
||||||
|
|
||||||
// Sauvegardes parametres
|
|
||||||
if ($actionsave)
|
|
||||||
{
|
|
||||||
$i=0;
|
|
||||||
|
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
$i+=dolibarr_set_const($db,'PHPMANTIS_URL',trim($_POST["phpmantis_url"]),'chaine',0,'',$conf->entity);
|
|
||||||
$i+=dolibarr_set_const($db,'PHPMANTIS_HOST',trim($_POST["phpmantis_host"]),'chaine',0,'',$conf->entity);
|
|
||||||
$i+=dolibarr_set_const($db,'PHPMANTIS_DBNAME',trim($_POST["phpmantis_dbname"]),'chaine',0,'',$conf->entity);
|
|
||||||
$i+=dolibarr_set_const($db,'PHPMANTIS_USER',trim($_POST["phpmantis_user"]),'chaine',0,'',$conf->entity);
|
|
||||||
$i+=dolibarr_set_const($db,'PHPMANTIS_PASS',trim($_POST["phpmantis_pass"]),'chaine',0,'',$conf->entity);
|
|
||||||
|
|
||||||
if ($i >= 5)
|
|
||||||
{
|
|
||||||
$db->commit();
|
|
||||||
$mesg = "<font class=\"ok\">".$langs->trans("MantisSetupSaved")."</font>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$db->rollback();
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($actiontest)
|
|
||||||
{
|
|
||||||
//$resql=$db->query("select count(*) from llx_const");
|
|
||||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
|
||||||
|
|
||||||
// Test de la connexion a la database mantis
|
|
||||||
$conf->mantis->db->type=$dolibarr_main_db_type;
|
|
||||||
$conf->mantis->db->host=$_POST["phpmantis_host"];
|
|
||||||
$conf->mantis->db->port=$_POST["phpmantis_port"];
|
|
||||||
$conf->mantis->db->user=$_POST["phpmantis_user"];
|
|
||||||
$conf->mantis->db->pass=$_POST["phpmantis_pass"];
|
|
||||||
$conf->mantis->db->name=$_POST["phpmantis_dbname"];
|
|
||||||
|
|
||||||
$mantis=new Mantis();
|
|
||||||
|
|
||||||
//print "D ".$db." - ".$db->db."<br>\n";
|
|
||||||
//print "W ".$mantis->localdb." - ".$mantis->localdb->db."<br>\n";
|
|
||||||
|
|
||||||
if ($mantis->localdb->connected == 1 && $mantis->localdb->database_selected == 1)
|
|
||||||
{
|
|
||||||
// V<>rifie si bonne base
|
|
||||||
$sql="SELECT value FROM mantis_config_table WHERE config_id='database_version'";
|
|
||||||
$resql=$mantis->localdb->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$mesg ="<div class=\"ok\">";
|
|
||||||
$mesg.=$langs->trans("MantisTestOk",$_POST["phpmantis_host"],$_POST["phpmantis_dbname"],$_POST["phpmantis_user"]);
|
|
||||||
$mesg.="</div>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$mesg ="<div class=\"error\">";
|
|
||||||
$mesg.=$langs->trans("MantisErrorConnectOkButWrongDatabase");
|
|
||||||
$mesg.="</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
//$mantis->localdb->close(); Ne pas fermer car la conn de mantis est la meme que dolibarr si parametre host/user/pass identique
|
|
||||||
}
|
|
||||||
elseif ($mantis->connected == 1 && $mantis->database_selected != 1)
|
|
||||||
{
|
|
||||||
$mesg ="<div class=\"error\">".$langs->trans("MantisTestKo1",$_POST["phpmantis_host"],$_POST["phpmantis_dbname"]);
|
|
||||||
$mesg.="<br>".$mantis->localdb->error();
|
|
||||||
$mesg.="</div>";
|
|
||||||
//$mantis->localdb->close(); Ne pas fermer car la conn de mantis est la meme que dolibarr si parametre host/user/pass identique
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mesg ="<div class=\"error\">".$langs->trans("MantisTestKo2",$_POST["phpmantis_host"],$_POST["phpmantis_user"]);
|
|
||||||
$mesg.="<br>".$mantis->localdb->error();
|
|
||||||
$mesg.="</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
//$resql=$db->query("select count(*) from llx_const");
|
|
||||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Affichage du formulaire de saisie
|
|
||||||
*/
|
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
|
||||||
print_fiche_titre($langs->trans("MantisSetup"),$linkback,'setup');
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<form name="phpmantisconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
|
||||||
|
|
||||||
print "<tr class=\"liste_titre\">";
|
|
||||||
print "<td width=\"30%\">".$langs->trans("Parameter")."</td>";
|
|
||||||
print "<td>".$langs->trans("Value")."</td>";
|
|
||||||
print "<td>".$langs->trans("Examples")."</td>";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "<tr class=\"impair\">";
|
|
||||||
print "<td>".$langs->trans("MantisURL")."</td>";
|
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"phpmantis_url\" value=\"". ($_POST["phpmantis_url"]?$_POST["phpmantis_url"]:$conf->global->PHPMANTIS_URL) . "\" size=\"40\"></td>";
|
|
||||||
print "<td>http://localhost/mantis/";
|
|
||||||
print "<br>https://mantisserver/";
|
|
||||||
print "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "<tr class=\"pair\">";
|
|
||||||
print "<td>".$langs->trans("MantisServer")."</td>";
|
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"phpmantis_host\" value=\"". ($_POST["phpmantis_host"]?$_POST["phpmantis_host"]:$conf->global->PHPMANTIS_HOST) . "\" size=\"30\"></td>";
|
|
||||||
print "<td>localhost";
|
|
||||||
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
|
|
||||||
print "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "<tr class=\"impair\">";
|
|
||||||
print "<td>".$langs->trans("MantisDatabaseName")."</td>";
|
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"phpmantis_dbname\" value=\"". ($_POST["phpmantis_dbname"]?$_POST["phpmantis_dbname"]:$conf->global->PHPMANTIS_DBNAME) . "\" size=\"30\"></td>";
|
|
||||||
print "<td>bugtracker";
|
|
||||||
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
|
|
||||||
print "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "<tr class=\"pair\">";
|
|
||||||
print "<td>".$langs->trans("MantisUser")."</td>";
|
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"phpmantis_user\" value=\"". ($_POST["phpmantis_user"]?$_POST["phpmantis_user"]:$conf->global->PHPMANTIS_USER) . "\" size=\"30\"></td>";
|
|
||||||
print "<td>mantis";
|
|
||||||
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
|
|
||||||
print "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "<tr class=\"impair\">";
|
|
||||||
print "<td>".$langs->trans("Password")."</td>";
|
|
||||||
print "<td><input type=\"password\" class=\"flat\" name=\"phpmantis_pass\" value=\"" . ($_POST["phpmantis_pass"]?$_POST["phpmantis_pass"]:$conf->global->PHPMANTIS_PASS) . "\" size=\"30\"></td>";
|
|
||||||
print '<td>';
|
|
||||||
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
|
||||||
print ' </td>';
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
|
|
||||||
print '<br><center>';
|
|
||||||
print "<input type=\"submit\" name=\"test\" class=\"button\" value=\"".$langs->trans("TestConnection")."\">";
|
|
||||||
print " ";
|
|
||||||
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
|
||||||
print "</center>";
|
|
||||||
|
|
||||||
print "</form>\n";
|
|
||||||
|
|
||||||
|
|
||||||
clearstatcache();
|
|
||||||
|
|
||||||
if ($mesg) print "<br>$mesg<br>";
|
|
||||||
print "<br>";
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
|
||||||
?>
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/mantis/class/mantis.class.php
|
|
||||||
* \ingroup mantis
|
|
||||||
* \brief Ensemble des fonctions permettant d'acceder a la database mantis.
|
|
||||||
* \author Laurent Destailleur.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \class Mantis
|
|
||||||
* \brief Classe permettant d'acceder a la database mantis
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Mantis {
|
|
||||||
|
|
||||||
var $localdb;
|
|
||||||
|
|
||||||
var $date;
|
|
||||||
var $duree = 0; // Secondes
|
|
||||||
var $texte;
|
|
||||||
var $desc;
|
|
||||||
|
|
||||||
var $error;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Constructeur de la classe d'interface a mantisendar
|
|
||||||
*/
|
|
||||||
function Mantis()
|
|
||||||
{
|
|
||||||
global $conf;
|
|
||||||
global $dolibarr_main_db_type,$dolibarr_main_db_host,$dolibarr_main_db_user;
|
|
||||||
global $dolibarr_main_db_pass,$dolibarr_main_db_name;
|
|
||||||
|
|
||||||
// Defini parametres mantis (avec substitution eventuelle)
|
|
||||||
$mantistype=preg_replace('/__dolibarr_main_db_type__/i',$dolibarr_main_db_type,$conf->mantis->db->type);
|
|
||||||
$mantishost=preg_replace('/__dolibarr_main_db_host__/i',$dolibarr_main_db_host,$conf->mantis->db->host);
|
|
||||||
$mantisport=preg_replace('/__dolibarr_main_db_port__/i',$dolibarr_main_db_port,$conf->mantis->db->port);
|
|
||||||
$mantisuser=preg_replace('/__dolibarr_main_db_user__/i',$dolibarr_main_db_user,$conf->mantis->db->user);
|
|
||||||
$mantispass=preg_replace('/__dolibarr_main_db_pass__/i',$dolibarr_main_db_pass,$conf->mantis->db->pass);
|
|
||||||
$mantisname=preg_replace('/__dolibarr_main_db_name__/i',$dolibarr_main_db_name,$conf->mantis->db->name);
|
|
||||||
|
|
||||||
// On initie la connexion a la base mantisendar
|
|
||||||
require_once (DOL_DOCUMENT_ROOT ."/lib/databases/".$mantistype.".lib.php");
|
|
||||||
$this->localdb = new DoliDb($mantistype,$mantishost,$mantisuser,$mantispass,$mantisname,$mantisport);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Url not available
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/mantis/mantis.php
|
|
||||||
* \ingroup mantis
|
|
||||||
* \brief Page generant 2 frames, une pour le menu Dolibarr, l'autre pour l'affichage de Mantis
|
|
||||||
* \author Laurent Destailleur
|
|
||||||
*/
|
|
||||||
|
|
||||||
require("../main.inc.php");
|
|
||||||
|
|
||||||
if (empty($conf->global->PHPMANTIS_URL))
|
|
||||||
{
|
|
||||||
llxHeader();
|
|
||||||
print '<div class="error">Module Mantis was not configured properly.</div>';
|
|
||||||
llxFooter();
|
|
||||||
}
|
|
||||||
|
|
||||||
$mainmenu=isset($_GET["mainmenu"])?$_GET["mainmenu"]:"";
|
|
||||||
$leftmenu=isset($_GET["leftmenu"])?$_GET["leftmenu"]:"";
|
|
||||||
$idmenu=isset($_GET["idmenu"])?$_GET["idmenu"]:"";
|
|
||||||
|
|
||||||
print "
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Dolibarr frame for Mantis</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<frameset rows=\"".$heightforframes.",*\" border=0 framespacing=0 frameborder=0>
|
|
||||||
<frame name=\"barre\" src=\"mantistop.php?mainmenu=".$mainmenu."&leftmenu=".$leftmenu."&idmenu=".$idmenu."&nobackground=1\" noresize scrolling=\"NO\" noborder>
|
|
||||||
<frame name=\"main\" src=\"".$conf->global->PHPMANTIS_URL."\">
|
|
||||||
<noframes>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</noframes>
|
|
||||||
</frameset>
|
|
||||||
|
|
||||||
<noframes>
|
|
||||||
<body>
|
|
||||||
<br><center>
|
|
||||||
Sorry, your browser is too old or not correctly configured to view this area.<br>
|
|
||||||
Your browser must support frames.<br>
|
|
||||||
</center>
|
|
||||||
</body>
|
|
||||||
</noframes>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2001-2003 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/mantis/mantistop.php
|
|
||||||
* \ingroup mantis
|
|
||||||
* \brief Top frame to show mantis application
|
|
||||||
*/
|
|
||||||
|
|
||||||
require ("../main.inc.php");
|
|
||||||
|
|
||||||
top_htmlhead("","");
|
|
||||||
top_menu("","","_top");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -298,6 +298,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
$this->name = trim($this->name);
|
$this->name = trim($this->name);
|
||||||
|
$this->nom=$this->name; // For backward compatibility
|
||||||
|
|
||||||
if (! $this->name)
|
if (! $this->name)
|
||||||
{
|
{
|
||||||
@ -393,11 +394,16 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$this->name = trim($this->name);
|
$this->name=$this->name?trim($this->name):trim($this->nom);
|
||||||
$this->address = trim($this->address);
|
$this->nom=trim($this->nom); // TODO obsolete
|
||||||
$this->zip = trim($this->zip);
|
$this->address=$this->address?trim($this->address):trim($this->adresse);
|
||||||
$this->town = trim($this->town);
|
$this->adresse=$this->address; // TODO obsolete
|
||||||
$this->state_id = trim($this->state_id);
|
$this->zip=$this->zip?trim($this->zip):trim($this->cp);
|
||||||
|
$this->cp=$this->zip; // TODO obsolete
|
||||||
|
$this->town=$this->town?trim($this->town):trim($this->ville);
|
||||||
|
$this->ville=$this->town; // TODO obsolete
|
||||||
|
$this->state_id=trim($this->state_id);
|
||||||
|
$this->pays_id=trim($this->pays_id);
|
||||||
$this->country_id = trim($this->country_id);
|
$this->country_id = trim($this->country_id);
|
||||||
$this->tel = trim($this->tel);
|
$this->tel = trim($this->tel);
|
||||||
$this->fax = trim($this->fax);
|
$this->fax = trim($this->fax);
|
||||||
@ -407,6 +413,9 @@ class Societe extends CommonObject
|
|||||||
$this->fax = preg_replace("/\./","",$this->fax);
|
$this->fax = preg_replace("/\./","",$this->fax);
|
||||||
$this->email = trim($this->email);
|
$this->email = trim($this->email);
|
||||||
$this->url = $this->url?clean_url($this->url,0):'';
|
$this->url = $this->url?clean_url($this->url,0):'';
|
||||||
|
$this->siren=trim($this->siren); // TODO obsolete
|
||||||
|
$this->siret=trim($this->siret); // TODO obsolete
|
||||||
|
$this->ape=trim($this->ape); // TODO obsolete
|
||||||
$this->idprof1 = trim($this->idprof1);
|
$this->idprof1 = trim($this->idprof1);
|
||||||
$this->idprof2 = trim($this->idprof2);
|
$this->idprof2 = trim($this->idprof2);
|
||||||
$this->idprof3 = trim($this->idprof3);
|
$this->idprof3 = trim($this->idprof3);
|
||||||
|
|||||||
@ -104,6 +104,7 @@ if (empty($reshook))
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||||
|
|
||||||
if ($action == 'update') $object->fetch($socid);
|
if ($action == 'update') $object->fetch($socid);
|
||||||
|
else $object->canvas=$canvas;
|
||||||
|
|
||||||
if (GETPOST("private") == 1)
|
if (GETPOST("private") == 1)
|
||||||
{
|
{
|
||||||
@ -474,7 +475,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists())
|
|||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// When used with CANVAS
|
// When used with CANVAS
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
if (! $objcanvas->hasActions() && $socid)
|
||||||
|
{
|
||||||
|
$object = new Societe($db);
|
||||||
|
$object->fetch($socid); // For use with "pure canvas" (canvas that contains templates only)
|
||||||
|
}
|
||||||
$objcanvas->assign_values($action, $socid); // Set value for templates
|
$objcanvas->assign_values($action, $socid); // Set value for templates
|
||||||
$objcanvas->display_canvas(); // Show template
|
$objcanvas->display_canvas(); // Show template
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user