Merge branch 'develop' of git://github.com/Dolibarr/dolibarr.git into webservices
This commit is contained in:
commit
9b28f98119
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -69,6 +69,52 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
|
||||
print $langs->trans("DefaultRightsDesc");
|
||||
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Charge les modules soumis a permissions
|
||||
$modules = array();
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||
//print $dir."\n<br>";
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
if ($modName)
|
||||
{
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
|
||||
// Load all lang files of module
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||
{
|
||||
foreach($objMod->langfiles as $domain)
|
||||
{
|
||||
$langs->load($domain);
|
||||
}
|
||||
}
|
||||
// Load all permissions
|
||||
if ($objMod->rights_class)
|
||||
{
|
||||
$ret=$objMod->insert_permissions(0);
|
||||
$modules[$objMod->rights_class]=$objMod;
|
||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
|
||||
// Show warning about external users
|
||||
print showModulesExludedForExternal($modules).'<br>'."\n";
|
||||
print "<br>\n";
|
||||
@ -81,54 +127,6 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Charge les modules soumis a permissions
|
||||
$modules = array();
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||
//print $dir."\n<br>";
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
|
||||
// Load all lang files of module
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||
{
|
||||
foreach($objMod->langfiles as $domain)
|
||||
{
|
||||
$langs->load($domain);
|
||||
}
|
||||
}
|
||||
// Load all permissions
|
||||
if ($objMod->rights_class)
|
||||
{
|
||||
$ret=$objMod->insert_permissions(0);
|
||||
$modules[$objMod->rights_class]=$objMod;
|
||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
|
||||
// Affiche lignes des permissions
|
||||
$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -301,7 +301,7 @@ class Propal extends CommonObject
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $type Type of line (product, service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param int $fk_parent_line Id of parent line
|
||||
* @param int $fk_fournprice Id supplier price
|
||||
* @param int $pa_ht Buying price without tax
|
||||
@ -457,7 +457,7 @@ class Propal extends CommonObject
|
||||
* @param string $desc Description
|
||||
* @param double $price_base_type HT ou TTC
|
||||
* @param int $info_bits Miscellanous informations
|
||||
* @param int $special_code Set special code ('' = we don't change it)
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
||||
* @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules)
|
||||
* @param int $fk_fournprice Id of origin supplier price
|
||||
@ -480,7 +480,7 @@ class Propal extends CommonObject
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if (empty($qty) && empty($special_code)) $special_code=3; // Set option tag
|
||||
if (! empty($qty) && $special_code == 3) $special_code=0; // Remove option tag
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
||||
@ -995,7 +995,7 @@ class Commande extends CommonOrder
|
||||
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param int $fk_parent_line Parent line
|
||||
* @param int $fk_fournprice Id supplier price
|
||||
* @param int $pa_ht Buying price (without tax)
|
||||
@ -2176,9 +2176,10 @@ class Commande extends CommonOrder
|
||||
* @param int $fk_fournprice Id of origin supplier price
|
||||
* @param int $pa_ht Price (without tax) of product when it was bought
|
||||
* @param string $label Label
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2197,6 +2198,7 @@ class Commande extends CommonOrder
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($remise)) $remise=0;
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($special_code) || $special_code == 3) $special_code=0;
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu = price2num($pu);
|
||||
@ -2251,7 +2253,7 @@ class Commande extends CommonOrder
|
||||
$this->line->remise_percent=$remise_percent;
|
||||
$this->line->subprice=$subprice;
|
||||
$this->line->info_bits=$info_bits;
|
||||
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
|
||||
$this->line->special_code=$special_code;
|
||||
$this->line->total_ht=$total_ht;
|
||||
$this->line->total_tva=$total_tva;
|
||||
$this->line->total_localtax1=$total_localtax1;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -1874,7 +1874,7 @@ class Facture extends CommonInvoice
|
||||
* @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note)
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $fk_parent_line Id of parent line
|
||||
@ -2037,9 +2037,10 @@ class Facture extends CommonInvoice
|
||||
* @param int $fk_fournprice Id of origin supplier price
|
||||
* @param int $pa_ht Price (without tax) of product when it was bought
|
||||
* @param string $label Label of the line
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
@ -2052,11 +2053,12 @@ class Facture extends CommonInvoice
|
||||
// Clean parameters
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($special_code) || $special_code == 3) $special_code=0;
|
||||
|
||||
$remise_percent = price2num($remise_percent);
|
||||
$qty = price2num($qty);
|
||||
$pu = price2num($pu);
|
||||
$pa_ht = price2num($pa_ht);
|
||||
$pa_ht = price2num($pa_ht);
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
@ -2105,21 +2107,21 @@ class Facture extends CommonInvoice
|
||||
$this->line->rowid = $rowid;
|
||||
$this->line->label = $label;
|
||||
$this->line->desc = $desc;
|
||||
$this->line->qty= ($this->type==2?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative
|
||||
$this->line->qty = ($this->type==2?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative
|
||||
$this->line->tva_tx = $txtva;
|
||||
$this->line->localtax1_tx = $txlocaltax1;
|
||||
$this->line->localtax2_tx = $txlocaltax2;
|
||||
$this->line->remise_percent = $remise_percent;
|
||||
$this->line->subprice= ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->date_start = $date_start;
|
||||
$this->line->date_end = $date_end;
|
||||
$this->line->total_ht= (($this->type==2||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva= (($this->type==2||$qty<0)?-abs($total_tva):$total_tva);
|
||||
$this->line->total_localtax1=(($this->type==2||$qty<0)?-abs($total_localtax1):$total_localtax1);
|
||||
$this->line->total_localtax2=(($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2);
|
||||
$this->line->total_ttc= (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc);
|
||||
$this->line->total_ht = (($this->type==2||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva = (($this->type==2||$qty<0)?-abs($total_tva):$total_tva);
|
||||
$this->line->total_localtax1 = (($this->type==2||$qty<0)?-abs($total_localtax1):$total_localtax1);
|
||||
$this->line->total_localtax2 = (($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2);
|
||||
$this->line->total_ttc = (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc);
|
||||
$this->line->info_bits = $info_bits;
|
||||
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
|
||||
$this->line->special_code = $special_code;
|
||||
$this->line->product_type = $type;
|
||||
$this->line->fk_parent_line = $fk_parent_line;
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
|
||||
@ -2135,7 +2135,7 @@ abstract class CommonObject
|
||||
$this->array_options[$key] = null;
|
||||
}
|
||||
break;
|
||||
case 'price':
|
||||
case 'price':
|
||||
$this->array_options[$key] = price2num($this->array_options[$key]);
|
||||
break;
|
||||
}
|
||||
@ -2282,16 +2282,16 @@ abstract class CommonObject
|
||||
$qty= $obj->qty;
|
||||
$discount_percent_line = $obj->remise_percent;
|
||||
$total_ht = $obj->total_ht;
|
||||
|
||||
|
||||
$total_discount_line = price2num(($pu_ht * $qty) - $total_ht, 'MT');
|
||||
$total_discount += $total_discount_line;
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR);
|
||||
|
||||
//print $total_discount; exit;
|
||||
|
||||
//print $total_discount; exit;
|
||||
return price2num($total_discount);
|
||||
}
|
||||
|
||||
@ -2482,7 +2482,7 @@ abstract class CommonObject
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('showLinkedObjectBlock',$parameters,$this,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
if (! $reshook)
|
||||
if (empty($reshook))
|
||||
{
|
||||
$num = count($this->linkedObjects);
|
||||
|
||||
|
||||
@ -467,17 +467,17 @@ class ExtraFields
|
||||
* Load array this->attribute_label
|
||||
*
|
||||
* @param string $elementtype Type of element
|
||||
* @param boolean $forcecheck override test of MAIN_EXTRAFIELDS_DISABLED
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||
* @return array Array of attributes for all extra fields
|
||||
*/
|
||||
function fetch_name_optionals_label($elementtype='member',$forcecheck=false)
|
||||
function fetch_name_optionals_label($elementtype='member',$forceload=false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$array_name_label=array();
|
||||
|
||||
// For avoid conflicts with external modules
|
||||
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && !$forcecheck)
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
||||
return $array_name_label;
|
||||
|
||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired";
|
||||
|
||||
@ -41,6 +41,8 @@ class HookManager
|
||||
|
||||
// Array result
|
||||
var $resArray=array();
|
||||
// Printable result
|
||||
var $resPrint='';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -134,8 +134,7 @@ class Form
|
||||
$ret='';
|
||||
|
||||
// When option to edit inline is activated
|
||||
// TODO change for compatibility
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;/',$typeofdata))
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker
|
||||
{
|
||||
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success);
|
||||
}
|
||||
|
||||
@ -36,9 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
if (! empty($conf->produit->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (!empty($conf->produit->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (! empty($conf->projet->enabled))
|
||||
if (!empty($conf->projet->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
$langs->load('orders');
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -33,8 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefo
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (!empty($conf->produit->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (!empty($conf->projet->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
|
||||
$langs->load('bills');
|
||||
|
||||
@ -1368,7 +1368,7 @@ else
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
if ($caneditfield && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||
{
|
||||
@ -1376,13 +1376,13 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
}
|
||||
elseif ($caneditpassword && ! $object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a>';
|
||||
}
|
||||
|
||||
// Si on a un gestionnaire de generation de mot de passe actif
|
||||
@ -1393,9 +1393,9 @@ else
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a>';
|
||||
}
|
||||
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a>';
|
||||
}
|
||||
|
||||
if ($object->statut == 0)
|
||||
@ -1403,32 +1403,32 @@ else
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a>';
|
||||
}
|
||||
else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
if ($object->email) print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a>';
|
||||
if ($object->email) print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Activer
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||
}
|
||||
// Desactiver
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
}
|
||||
// Delete
|
||||
if ($user->id <> $id && $candisableuser &&
|
||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1582,7 +1582,7 @@ else
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="hidden" name="entity" value="'.$object->entity.'">';
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
$rowspan=13;
|
||||
|
||||
@ -98,34 +98,26 @@ print '</form>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Webservices list
|
||||
$webservices = array(
|
||||
'user' => '',
|
||||
'thirdparty' => '!empty($conf->societe->enabled)',
|
||||
'productorservice' => '(!empty($conf->product->enabled) || !empty($conf->service->enabled))',
|
||||
'order' => '!empty($conf->commande->enabled)',
|
||||
'invoice' => '!empty($conf->facture->enabled)',
|
||||
'supplier_invoice' => '!empty($conf->fournisseur->enabled)',
|
||||
'actioncomm' => '!empty($conf->agenda->enabled)',
|
||||
'category' => '!empty($conf->categorie->enabled)',
|
||||
'other' => ''
|
||||
);
|
||||
|
||||
|
||||
// WSDL
|
||||
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
foreach($webservices as $name => $right)
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_actioncomm.php?wsdl';
|
||||
if (!empty($right) && !verifCond($right)) continue;
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_'.$name.'.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
print '<br>';
|
||||
@ -133,31 +125,10 @@ print '<br>';
|
||||
|
||||
// Endpoint
|
||||
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
foreach($webservices as $name => $right)
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_actioncomm.php';
|
||||
if (!empty($right) && !verifCond($right)) continue;
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_'.$name.'.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user