Merge https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
09133a2063
@ -28,6 +28,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Files for variables of themes were renamed from graph-color.php into theme_vars.inc.php to match naming
|
||||
convention of extension .inc.php for files to be included.
|
||||
* All methods set_draft() were renamed into setDraft().
|
||||
* Signatures of methods createFromClone() has been standardized. All methods requires the object User as first parameter.
|
||||
* Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject.
|
||||
* Method load_measuring_units were renamed into selectMeasuringUnits and select_measuring_units was deprecated.
|
||||
* Hidden option CHANGE_ORDER_CONCAT_DESCRIPTION were renamed into MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION.
|
||||
|
||||
@ -258,7 +258,7 @@ if ($resql)
|
||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||
$sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system as a";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON a.fk_country = c.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON a.fk_country = c.rowid AND c.active = 1";
|
||||
$sql .= " WHERE a.active = 1";
|
||||
dol_syslog('accountancy/admin/account.php $sql='.$sql);
|
||||
print $sql;
|
||||
|
||||
@ -154,7 +154,7 @@ if ($result)
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -1,187 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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 3 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/accountancy/admin/importaccounts.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page import accounting account
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","accountancy"));
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("ImportAccount"));
|
||||
|
||||
$to_import = GETPOST("mesCasesCochees");
|
||||
|
||||
if ($_POST["action"] == 'import') {
|
||||
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||
if (is_array($to_import) && count($to_import) > 0) {
|
||||
print '<div><font color="red">' . count($to_import) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result && ($db->num_rows($result) > 0)) {
|
||||
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$cpt = 0;
|
||||
foreach ($to_import as $maLigneCochee) {
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
$monLabel = (string) GETPOST('label' . $maLigneCochee);
|
||||
$monParentAccount = (string) GETPOST('AccountParent' . $maLigneCochee);
|
||||
$monType = (string) GETPOST('pcgType' . $maLigneCochee);
|
||||
$monSubType = (string) GETPOST('pcgSubType' . $maLigneCochee);
|
||||
|
||||
$accounting->fk_pcg_version = $obj->pcg_version;
|
||||
$accounting->account_number = $maLigneCochee;
|
||||
$accounting->label = $monLabel;
|
||||
$accounting->account_parent = $monParentAccount;
|
||||
$accounting->pcg_type = $monType;
|
||||
$accounting->pcg_subtype = $monSubType;
|
||||
$accounting->active = 1;
|
||||
|
||||
$result = $accounting->create($user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
$cpt ++;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans('AccountPlanNotFoundCheckSetting'), null, 'errors');
|
||||
}
|
||||
} else {
|
||||
print '<div><font color="red">' . $langs->trans("AnyLineImport") . '</font></div>';
|
||||
}
|
||||
print '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
|
||||
}
|
||||
|
||||
// list accounting account from product
|
||||
|
||||
$sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p ";
|
||||
$sql .= " WHERE p.accountancy_code_sell >=0";
|
||||
$sql .= " GROUP BY accounting ";
|
||||
$sql .= ")";
|
||||
$sql .= "UNION ALL(SELECT p.rowid as product_id, p.accountancy_code_buy as accounting ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p ";
|
||||
$sql .= " WHERE p.accountancy_code_buy >=0";
|
||||
$sql .= " GROUP BY accounting ";
|
||||
$sql .= ") ";
|
||||
$sql .= " ORDER BY accounting DESC " . $db->plimit($limit + 1, $offset);
|
||||
|
||||
dol_syslog('accountancy/admin/importaccounts.php:: $sql=' . $sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
print_barre_liste($langs->trans("ImportAccount"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="action" value="import">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>' . $langs->trans("AccountAccouting") . '</td>';
|
||||
print '<td>' . $langs->trans("label") . '</td>';
|
||||
print '<td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||
print '<td class="center">' . $langs->trans("Import") . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td class="left">';
|
||||
print $objp->accounting;
|
||||
print '</td>';
|
||||
|
||||
print '<td class="left">';
|
||||
print '<input name="label" size="30" value="">';
|
||||
print '</td>';
|
||||
|
||||
// Colonne choix du compte
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($accounting->account_parent, 'AccountParent');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcgType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$accounting->pcg_type).'">';
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcgSubType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype', 'alpha'):$accounting->pcg_subtype).'">';
|
||||
print '</td>';
|
||||
|
||||
// Colonne choix ligne a ventiler
|
||||
$checked = ('label' == 'O') ? ' checked' : '';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="mesCasesCochees[]" ' . $checked . ' value="' . $objp->accounting . '"/>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" class="center"><input type="submit" class="butAction" value="' . $langs->trans("Import") . '"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -279,7 +279,8 @@ if ($result)
|
||||
if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc);
|
||||
if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account);
|
||||
if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid);
|
||||
|
||||
if ($accounting_product_mode) $param.='&accounting_product_mode='.urlencode($accounting_product_mode);
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -317,8 +318,11 @@ if ($result)
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="' . $langs->trans("Save") . '">';
|
||||
//print '<br><div class="center">'.$buttonsave.'</div>';
|
||||
|
||||
$texte=$langs->trans("ListOfProductsServices");
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||
@ -473,8 +477,8 @@ if ($result)
|
||||
|
||||
if (atleastoneselected) jQuery("#changeaccount").removeAttr(\'disabled\');
|
||||
else jQuery("#changeaccount").attr(\'disabled\',\'disabled\');
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'butAction\');
|
||||
else jQuery("#changeaccount").attr(\'class\',\'butActionRefused\');
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
}
|
||||
jQuery(".checkforselect, #checkallactions").click(function() {
|
||||
init_savebutton();
|
||||
@ -492,9 +496,6 @@ if ($result)
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
print '<br><div class="center"><input type="submit" class="butAction" id="changeaccount" name="changeaccount" value="' . $langs->trans("Save") . '"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
$db->free($result);
|
||||
|
||||
@ -233,16 +233,8 @@ class AccountingAccount extends CommonObject
|
||||
$this->pcg_subtype = trim($this->pcg_subtype);
|
||||
if (isset($this->account_number))
|
||||
$this->account_number = trim($this->account_number);
|
||||
if (isset($this->account_parent))
|
||||
$this->account_parent = trim($this->account_parent);
|
||||
if (isset($this->label))
|
||||
$this->label = trim($this->label);
|
||||
if (isset($this->account_category))
|
||||
$this->account_category = trim($this->account_category);
|
||||
if (isset($this->fk_user_author))
|
||||
$this->fk_user_author = trim($this->fk_user_author);
|
||||
if (isset($this->active))
|
||||
$this->active = trim($this->active);
|
||||
|
||||
if (empty($this->pcg_type) || $this->pcg_type == '-1')
|
||||
{
|
||||
|
||||
@ -1409,16 +1409,14 @@ class BookKeeping extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
*
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
$object = new BookKeeping($this->db);
|
||||
|
||||
|
||||
@ -421,6 +421,8 @@ if ($result) {
|
||||
$facture_static = new Facture($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
@ -440,7 +442,7 @@ if ($result) {
|
||||
$code_sell_p_notset = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
|
||||
$isinEEC = isInEEC($objp->country_code);
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
if ($objp->type_l == 1) {
|
||||
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
@ -455,15 +457,17 @@ if ($result) {
|
||||
}
|
||||
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
|
||||
|
||||
if ($objp->country_sell == '1') {
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
} elseif ($isinEEC === true) {
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
} else {
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
} else { // Foreign sale
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($objp->code_sell)) {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2019 Thibault Foucart <support@ptibogxiv.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
|
||||
@ -64,6 +65,11 @@ class AdherentType extends CommonObject
|
||||
* @var string Adherent type label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Adherent type nature
|
||||
*/
|
||||
public $morphy;
|
||||
|
||||
/**
|
||||
* @var int Subsription required (0 or 1)
|
||||
@ -184,6 +190,7 @@ class AdherentType extends CommonObject
|
||||
$sql.= "SET ";
|
||||
$sql.= "statut = ".$this->statut.",";
|
||||
$sql.= "libelle = '".$this->db->escape($this->label) ."',";
|
||||
$sql.= "morphy = '".$this->db->escape($this->morphy) ."',";
|
||||
$sql.= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql.= "vote = ".(integer) $this->db->escape($this->vote).",";
|
||||
@ -274,7 +281,7 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||
|
||||
@ -290,6 +297,7 @@ class AdherentType extends CommonObject
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->label = $obj->label;
|
||||
$this->morphy = $obj->morphy;
|
||||
$this->statut = $obj->statut;
|
||||
$this->subscription = $obj->subscription;
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
@ -402,6 +410,21 @@ class AdherentType extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return translated label by the nature of a adherent (physical or moral)
|
||||
*
|
||||
* @param string $morphy Nature of the adherent (physical or moral)
|
||||
* @return string Label
|
||||
*/
|
||||
public function getmorphylib($morphy = '')
|
||||
{
|
||||
global $langs;
|
||||
if ($morphy == 'phy') { return $langs->trans("Physical"); }
|
||||
elseif ($morphy == 'mor') { return $langs->trans("Moral"); }
|
||||
else return $langs->trans("Physical & Morale");
|
||||
//return $morphy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.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
|
||||
@ -668,7 +669,7 @@ if ($rowid > 0)
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.subscription,";
|
||||
$sql.= " c.datec,";
|
||||
$sql.= " c.datec, c.fk_type as cfk_type,";
|
||||
$sql.= " c.dateadh as dateh,";
|
||||
$sql.= " c.datef,";
|
||||
$sql.= " c.fk_bank,";
|
||||
@ -693,6 +694,7 @@ if ($rowid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder);
|
||||
print '<td class="center">'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Type").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
||||
@ -703,6 +705,7 @@ if ($rowid > 0)
|
||||
print "</tr>\n";
|
||||
|
||||
$accountstatic=new Account($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -711,9 +714,20 @@ if ($rowid > 0)
|
||||
$subscriptionstatic->ref=$objp->crowid;
|
||||
$subscriptionstatic->id=$objp->crowid;
|
||||
|
||||
if ($objp->cfk_type > 0)
|
||||
{
|
||||
$adht->fetch($objp->cfk_type);
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n";
|
||||
print '<td class="center">';
|
||||
if ($objp->cfk_type > 0)
|
||||
{
|
||||
print $adht->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->dateh), 'day')."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day')."</td>\n";
|
||||
print '<td class="right">'.price($objp->subscription).'</td>';
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.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
|
||||
@ -57,6 +58,7 @@ if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.lastname"; }
|
||||
|
||||
$label=GETPOST("label", "alpha");
|
||||
$morphy=GETPOST("morphy", "alpha");
|
||||
$statut=GETPOST("statut", "int");
|
||||
$subscription=GETPOST("subscription", "int");
|
||||
$vote=GETPOST("vote", "int");
|
||||
@ -103,6 +105,7 @@ if ($cancel) {
|
||||
|
||||
if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->label = trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->statut = (int) $statut;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->note = trim($comment);
|
||||
@ -157,6 +160,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$object->label = trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->statut = (int) $statut;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->note = trim($comment);
|
||||
@ -215,7 +219,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
{
|
||||
//dol_fiche_head('');
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut, d.morphy";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql.= " WHERE d.entity IN (".getEntity('member_type').")";
|
||||
|
||||
@ -256,6 +260,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Ref").'</th>';
|
||||
print '<th>'.$langs->trans("Label").'</th>';
|
||||
print '<th class="center">'.$langs->trans("Nature").'</th>';
|
||||
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||
print '<th class="center">'.$langs->trans("Status").'</th>';
|
||||
@ -277,6 +282,11 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
print '</td>';
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); }
|
||||
elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); }
|
||||
else print $langs->trans("Physical & Morale");
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">';
|
||||
@ -330,6 +340,14 @@ if ($action == 'create')
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
$morphys[""] = $langs->trans("Physical & Morale");
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Morale");
|
||||
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription", 1, 1);
|
||||
@ -411,6 +429,10 @@ if ($rowid > 0)
|
||||
print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased");
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print yn($object->subscription);
|
||||
@ -751,6 +773,14 @@ if ($rowid > 0)
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
$morphys[""] = $langs->trans("Physical & Morale");
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Morale");
|
||||
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription", $object->subscription, 1);
|
||||
|
||||
@ -48,6 +48,8 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectcard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$operationid = GETPOST('operationid', 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new EmailCollector($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -64,6 +66,7 @@ foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
|
||||
if (GETPOST('saveoperation2')) $action = 'updateoperation';
|
||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||
|
||||
// Load object
|
||||
@ -165,6 +168,24 @@ if (GETPOST('addoperation', 'alpha'))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'updateoperation')
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
$emailcollectoroperation->fetch(GETPOST('rowidoperation2', 'int'));
|
||||
|
||||
$emailcollectoroperation->actionparam = GETPOST('operationparam2', 'none');
|
||||
|
||||
$result = $emailcollectoroperation->update($user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->fetchActions();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
|
||||
}
|
||||
}
|
||||
if ($action == 'deleteoperation')
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
@ -452,19 +473,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$arrayoftypes=array(
|
||||
'from'=>array('label'=>'MailFrom', 'data-placeholder'=>'SearchString'),
|
||||
'to'=>array('label'=>'MailTo', 'data-placeholder'=>'SearchString'),
|
||||
'cc'=>array('label'=>'Cc', 'data-placeholder'=>'SearchString'),
|
||||
'bcc'=>array('label'=>'Bcc', 'data-placeholder'=>'SearchString'),
|
||||
'subject'=>array('label'=>'Subject', 'data-placeholder'=>'SearchString'),
|
||||
'body'=>array('label'=>'Body', 'data-placeholder'=>'SearchString'),
|
||||
'header'=>array('label'=>'Header', 'data-placeholder'=>'HeaderKey SearchString'), // HEADER key value
|
||||
'X1'=>'---',
|
||||
'from'=>array('label'=>'MailFrom', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
'to'=>array('label'=>'MailTo', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
'cc'=>array('label'=>'Cc', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
'bcc'=>array('label'=>'Bcc', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
'subject'=>array('label'=>'Subject', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
'body'=>array('label'=>'Body', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
// disabled because PHP imap_search is not compatible IMAPv4, only IMAPv2
|
||||
//'header'=>array('label'=>'Header', 'data-placeholder'=>'HeaderKey SearchString'), // HEADER key value
|
||||
//'X1'=>'---',
|
||||
//'notinsubject'=>array('label'=>'SubjectNotIn', 'data-placeholder'=>'SearchString'),
|
||||
//'notinbody'=>array('label'=>'BodyNotIn', 'data-placeholder'=>'SearchString'),
|
||||
'X2'=>'---',
|
||||
'seen'=>array('label'=>'AlreadyRead', 'data-noparam'=>1),
|
||||
'unseen'=>array('label'=>'NotRead', 'data-noparam'=>1),
|
||||
'smaller'=>array('label'=>'SmallerThan', 'data-placeholder'=>'NumberOfBytes'),
|
||||
'larger'=>array('label'=>'LargerThan', 'data-placeholder'=>'NumberOfBytes'),
|
||||
'X2'=>'---',
|
||||
'unanswered'=>array('label'=>'Unanswered', 'data-noparam'=>1),
|
||||
'answered'=>array('label'=>'Answered', 'data-noparam'=>1),
|
||||
'smaller'=>array('label'=>'SmallerThan', 'data-placeholder'=>$langs->trans('NumberOfBytes')),
|
||||
'larger'=>array('label'=>'LargerThan', 'data-placeholder'=>$langs->trans('NumberOfBytes')),
|
||||
'X3'=>'---',
|
||||
'withtrackingid'=>array('label'=>'WithDolTrackingID', 'data-noparam'=>1),
|
||||
'withouttrackingid'=>array('label'=>'WithoutDolTrackingID', 'data-noparam'=>1)
|
||||
);
|
||||
@ -530,7 +557,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
'recordevent'=>'RecordEvent');
|
||||
if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty';
|
||||
if ($conf->ticket->enabled) $arrayoftypes['ticket']='CreateTicketAndThirdParty';
|
||||
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1);
|
||||
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300');
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="operationparam">';
|
||||
$htmltext=$langs->transnoentitiesnoconv("OperationParamDesc");
|
||||
@ -558,7 +585,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $form->textwithpicto('', $langs->transnoentitiesnoconv('IfTrackingIDFoundEventWillBeLinked'));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$ruleaction['actionparam'].'</td>';
|
||||
print '<td>';
|
||||
if ($action == 'editoperation' && $ruleaction['id'] == $operationid)
|
||||
{
|
||||
print '<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="'.$ruleaction['actionparam'].'"><br>';
|
||||
print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>';
|
||||
print '<input type="submit" class="button" name="saveoperation2" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $ruleaction['actionparam'];
|
||||
}
|
||||
print '</td>';
|
||||
// Move up/down
|
||||
print '<td class="center linecolmove tdlineupdown">';
|
||||
if ($i > 0)
|
||||
@ -571,6 +609,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
// Delete
|
||||
print '<td class="right">';
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
|
||||
print ' ';
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -604,11 +644,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit">' . $langs->trans("Edit") . '</a>' . "\n";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit">' . $langs->trans("Edit") . '</a></div>';
|
||||
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=collect">' . $langs->trans("CollectNow") . '</a>' . "\n";
|
||||
// Clone
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=order">' . $langs->trans("ToClone") . '</a></div>';
|
||||
|
||||
print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a>' . "\n";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=collect">' . $langs->trans("CollectNow") . '</a></div>';
|
||||
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>';
|
||||
}
|
||||
print '</div>' . "\n";
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ if (! $user->admin)
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
||||
$file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
|
||||
@ -133,7 +133,8 @@ if ($what == 'mysql')
|
||||
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump);
|
||||
foreach($arrayofallowedcommand as $allowedcommand)
|
||||
{
|
||||
if (preg_match('/'.preg_quote($allowedcommand, '/').'/', $cmddump))
|
||||
$basenamecmddump=basename($cmddump);
|
||||
if (preg_match('/^'.preg_quote($allowedcommand, '/').'$/', $basenamecmddump)) // the provided command $cmddump must be an allowed command
|
||||
{
|
||||
$ok=1;
|
||||
break;
|
||||
|
||||
@ -295,6 +295,14 @@ if ($user->rights->asset->delete) $arrayofmassactions['predelete']='<span class=
|
||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$newcardbutton='';
|
||||
if ($user->rights->asset->write)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/asset/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAsset').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -305,7 +313,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail="SendAssetsRef";
|
||||
|
||||
@ -220,6 +220,14 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
$param = '';
|
||||
|
||||
$newcardbutton='';
|
||||
if ($user->rights->asset->configurer)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/asset/type.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAssetType').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -229,7 +237,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
@ -15,10 +15,15 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
use Luracast\Restler\RestException;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/api_members.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/api_products.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/api_contacts.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/api_thirdparties.class.php';
|
||||
|
||||
/**
|
||||
* API class for categories
|
||||
@ -335,4 +340,61 @@ class Categories extends DolibarrApi
|
||||
}
|
||||
return $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of objects in a category.
|
||||
*
|
||||
* @param int $id ID of category
|
||||
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact')
|
||||
* @param int $onlyids Return only ids of objects (consume less memory)
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @url GET {id}/objects
|
||||
*/
|
||||
public function getObjects($id, $type, $onlyids = 0)
|
||||
{
|
||||
dol_syslog("getObjects($id, $type, $onlyids)", LOG_DEBUG);
|
||||
|
||||
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
if (empty($type))
|
||||
{
|
||||
throw new RestException(500, 'The "type" parameter is required.');
|
||||
}
|
||||
|
||||
$result = $this->category->fetch($id);
|
||||
if (! $result) {
|
||||
throw new RestException(404, 'category not found');
|
||||
}
|
||||
|
||||
if (! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->category->getObjectsInCateg($type, $onlyids);
|
||||
|
||||
if ($result < 0) {
|
||||
throw new RestException(503, 'Error when retrieving objects list : '.$this->category->error);
|
||||
}
|
||||
|
||||
$objects = $result;
|
||||
$cleaned_objects = array();
|
||||
if ($type == 'member') {
|
||||
$objects_api = new Members();
|
||||
} elseif ($type == 'customer' || $type == 'supplier') {
|
||||
$objects_api = new Thirdparties();
|
||||
} elseif ($type == 'product') {
|
||||
$objects_api = new Products();
|
||||
} elseif ($type == 'contact') {
|
||||
$objects_api = new Contacts();
|
||||
}
|
||||
foreach ($objects as $obj) {
|
||||
$cleaned_objects[] = $objects_api->_cleanObjectDatas($obj);
|
||||
}
|
||||
|
||||
return $cleaned_objects;
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
reset($object->socpeopleassigned);
|
||||
$object->contactid = key($object->socpeopleassigned);
|
||||
}
|
||||
$result = $object->createFromClone(GETPOST('fk_userowner'), GETPOST('socid'));
|
||||
$result = $object->createFromClone($user, GETPOST('fk_userowner'), GETPOST('socid'));
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
|
||||
exit();
|
||||
@ -903,7 +903,7 @@ if ($action == 'create')
|
||||
|
||||
$numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
|
||||
$urloption='?action=create';
|
||||
$url = dol_buildpath('comm/action/card.php', 2).$urloption;
|
||||
|
||||
@ -1301,7 +1301,7 @@ if ($id > 0)
|
||||
$numprojet=$formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0);
|
||||
if ($numprojet==0)
|
||||
{
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -87,14 +87,14 @@ class ActionComm extends CommonObject
|
||||
* @var string Agenda event label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
|
||||
/**
|
||||
* Date creation record (datec)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $datec;
|
||||
|
||||
|
||||
/**
|
||||
* Date modification record (tms)
|
||||
*
|
||||
@ -129,14 +129,14 @@ class ActionComm extends CommonObject
|
||||
* @var int
|
||||
*/
|
||||
public $usermodid;
|
||||
|
||||
|
||||
/**
|
||||
* Date action start (datep)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $datep;
|
||||
|
||||
|
||||
/**
|
||||
* Date action end (datep2)
|
||||
*
|
||||
@ -504,13 +504,13 @@ class ActionComm extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param user $fuser Object user making action
|
||||
* @param User $fuser Object user making action
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fuser, $socid)
|
||||
public function createFromClone(User $fuser, $socid)
|
||||
{
|
||||
global $db, $user, $langs, $conf, $hookmanager;
|
||||
global $db, $conf, $hookmanager;
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
@ -529,20 +529,6 @@ class ActionComm extends CommonObject
|
||||
|
||||
$this->id=0;
|
||||
|
||||
if (!is_object($fuser))
|
||||
{
|
||||
if ($fuser > 0)
|
||||
{
|
||||
$u = new User($db);
|
||||
$u->fetch($fuser);
|
||||
$fuser = $u;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fuser = $user;
|
||||
}
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone']='createfromclone';
|
||||
$result=$this->create($fuser);
|
||||
|
||||
@ -614,18 +614,9 @@ if ($resql)
|
||||
|
||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||
// They are date start and end of action but modified to not be outside calendar view.
|
||||
if ($event->percentage <= 0)
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
}
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
// Define ponctual property
|
||||
if ($event->date_start_in_calendar == $event->date_end_in_calendar)
|
||||
{
|
||||
|
||||
@ -97,7 +97,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$object->createFromClone($object->id, $_REQUEST["clone_content"], $_REQUEST["clone_receivers"]);
|
||||
$result=$object->createFromClone($user, $object->id, $_REQUEST["clone_content"], $_REQUEST["clone_receivers"]);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
||||
|
||||
@ -114,22 +114,17 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_element)) $this->fk_element=trim($this->fk_element);
|
||||
if (isset($this->fk_element)) $this->fk_element=(int) $this->fk_element;
|
||||
if (isset($this->type_element)) $this->type_element=trim($this->type_element);
|
||||
|
||||
if (isset($this->name)) $this->name=trim($this->name);
|
||||
if (isset($this->filtervalue)) $this->filtervalue=trim($this->filtervalue);
|
||||
if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author);
|
||||
if (isset($this->fk_user_mod)) $this->fk_user_mod=trim($this->fk_user_mod);
|
||||
|
||||
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."advtargetemailing(";
|
||||
|
||||
$sql.= "name,";
|
||||
$sql.= "entity,";
|
||||
$sql.= "fk_element,";
|
||||
@ -138,10 +133,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql.= "fk_user_author,";
|
||||
$sql.= "datec,";
|
||||
$sql.= "fk_user_mod";
|
||||
|
||||
|
||||
$sql.= ") VALUES (";
|
||||
|
||||
$sql.= " ".(! isset($this->name)?'NULL':"'".$this->db->escape($this->name)."'").",";
|
||||
$sql.= " ".$conf->entity.",";
|
||||
$sql.= " ".(! isset($this->fk_element)?'NULL':"'".$this->db->escape($this->fk_element)."'").",";
|
||||
@ -149,9 +141,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql.= " ".(! isset($this->filtervalue)?'NULL':"'".$this->db->escape($this->filtervalue)."'").",";
|
||||
$sql.= " ".$user->id.",";
|
||||
$sql.= " '".$this->db->idate(dol_now())."',";
|
||||
$sql.= " ".$user->id;
|
||||
|
||||
|
||||
$sql.= " null";
|
||||
$sql.= ")";
|
||||
|
||||
$this->db->begin();
|
||||
@ -396,14 +386,10 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_element)) $this->fk_element=trim($this->fk_element);
|
||||
if (isset($this->fk_element)) $this->fk_element=(int) $this->fk_element;
|
||||
if (isset($this->type_element)) $this->type_element=trim($this->type_element);
|
||||
if (isset($this->name)) $this->name=trim($this->name);
|
||||
if (isset($this->filtervalue)) $this->filtervalue=trim($this->filtervalue);
|
||||
if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author);
|
||||
if (isset($this->fk_user_mod)) $this->fk_user_mod=trim($this->fk_user_mod);
|
||||
|
||||
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add a control on parameters values
|
||||
|
||||
@ -266,14 +266,15 @@ class Mailing extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @param int $option1 1=Copy content, 0=Forget content
|
||||
* @param int $option2 Not used
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid, $option1, $option2)
|
||||
public function createFromClone(User $user, $fromid, $option1, $option2)
|
||||
{
|
||||
global $user,$langs;
|
||||
global $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->createFromClone($socid);
|
||||
$result = $object->createFromClone($user, $socid);
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
|
||||
exit();
|
||||
@ -839,6 +839,7 @@ if (empty($reshook))
|
||||
|
||||
$qty = GETPOST('qty' . $predef);
|
||||
$remise_percent = GETPOST('remise_percent' . $predef);
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
|
||||
@ -473,7 +473,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
|
||||
if ($date_start && $date_end && $date_start > $date_end) {
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStartDateGreaterEnd');
|
||||
@ -690,7 +690,7 @@ class Propal extends CommonObject
|
||||
if (empty($qty) && empty($special_code)) $special_code=3; // Set option tag
|
||||
if (! empty($qty) && $special_code == 3) $special_code=0; // Remove option tag
|
||||
if (empty($type)) $type=0;
|
||||
|
||||
|
||||
if ($date_start && $date_end && $date_start > $date_end) {
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStartDateGreaterEnd');
|
||||
@ -1226,12 +1226,13 @@ class Propal extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($socid = 0)
|
||||
public function createFromClone(User $user, $socid = 0)
|
||||
{
|
||||
global $user,$conf,$hookmanager;
|
||||
global $conf,$hookmanager;
|
||||
|
||||
dol_include_once('/projet/class/project.class.php');
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ if (empty($reshook))
|
||||
// Because createFromClone modifies the object, we must clone it so that we can restore it later
|
||||
$orig = clone $object;
|
||||
|
||||
$result=$object->createFromClone($socid);
|
||||
$result=$object->createFromClone($user, $socid);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
||||
|
||||
@ -1070,10 +1070,11 @@ class Commande extends CommonOrder
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($socid = 0)
|
||||
public function createFromClone(User $user, $socid = 0)
|
||||
{
|
||||
global $conf, $user,$hookmanager;
|
||||
|
||||
|
||||
@ -269,13 +269,12 @@ class BankCateg // extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$object = new BankCateg($this->db);
|
||||
|
||||
@ -57,7 +57,7 @@ if (! $sortfield) $sortfield="name";
|
||||
$object = new PaymentVarious($db);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$upload_dir = $conf->banque->dir_output.'/'.dol_sanitizeFileName($object->id);
|
||||
$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id);
|
||||
$modulepart='banque';
|
||||
|
||||
|
||||
|
||||
@ -1543,14 +1543,16 @@ if (empty($reshook))
|
||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($datefacture)) {
|
||||
$error++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("Date")) . '</div>';
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("Date"));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
|
||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||
|
||||
if (!($_POST['situations'] > 0)) {
|
||||
$error++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation")) . '</div>';
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation"));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -2192,11 +2194,13 @@ $result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GET
|
||||
if (!$object->fetch($id) > 0) dol_print_error($db);
|
||||
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
|
||||
{
|
||||
$all_progress = GETPOST('all_progress', 'int');
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$percent = $line->get_prev_progress($object->id);
|
||||
if (GETPOST('all_progress') < $percent) {
|
||||
$mesg = '<div class="warning">' . $langs->trans("CantBeLessThanMinPercent") . '</div>';
|
||||
if (floatval($all_progress) < floatval($percent)) {
|
||||
$mesg = $langs->trans("Line") . ' ' . $i . ' '. $line->ref .' : ' . $langs->trans("CantBeLessThanMinPercent");
|
||||
setEventMessages($mesg, null, 'warnings');
|
||||
$result = -1;
|
||||
} else
|
||||
$object->update_percent($line, $_POST['all_progress']);
|
||||
@ -4453,7 +4457,9 @@ elseif ($id > 0 || ! empty($ref))
|
||||
// Show global modifiers
|
||||
if (! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
if ($object->situation_cycle_ref && $object->statut == 0) {
|
||||
if ($object->situation_cycle_ref && $object->statut == 0)
|
||||
{
|
||||
print '<!-- Area to change globally the situation percent -->'."\n";
|
||||
print '<div class="div-table-responsive">';
|
||||
|
||||
print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '#updatealllines" method="POST">';
|
||||
@ -4469,38 +4475,19 @@ elseif ($id > 0 || ! empty($ref))
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td align="center" width="5"> </td>';
|
||||
}
|
||||
print '<td>' . $langs->trans('ModifyAllLines') . '</td>';
|
||||
print '<td class="right" width="50"> </td>';
|
||||
print '<td class="right" width="80"> </td>';
|
||||
if ($inputalsopricewithtax) print '<td class="right" width="80"> </td>';
|
||||
print '<td class="right" width="50"> </td>';
|
||||
print '<td class="right" width="50"> </td>';
|
||||
print '<td class="right" width="50">' . $langs->trans('Progress') . '</td>';
|
||||
if (! empty($conf->margin->enabled) && empty($user->societe_id))
|
||||
{
|
||||
print '<td class="margininfos right" width="80"> </td>';
|
||||
if ((! empty($conf->global->DISPLAY_MARGIN_RATES) || ! empty($conf->global->DISPLAY_MARK_RATES)) && $usercanreadallmargin) {
|
||||
print '<td class="margininfos right" width="50"> </td>';
|
||||
}
|
||||
}
|
||||
print '<td class="right" width="50"> </td>';
|
||||
print '<td class="minwidth500imp">' . $langs->trans('ModifyAllLines') . '</td>';
|
||||
print '<td class="right">' . $langs->trans('Progress') . '</td>';
|
||||
print '<td> </td>';
|
||||
print '<td width="10"> </td>';
|
||||
print '<td width="10"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="nodrag nodrop">';
|
||||
// Adds a line numbering column
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td align="center" width="5"> </td>';
|
||||
print '<td align="center" width="5"> </td>';
|
||||
}
|
||||
print '<tr width="100%" class="nodrag nodrop">';
|
||||
print '<td> </td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '<td width="80"> </td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '<td class="nowrap right"><input type="text" size="1" value="" name="all_progress">%</td>';
|
||||
print '<td colspan="4" class="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
|
||||
print '<td class="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -393,13 +393,12 @@ class PaymentTerm // extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
global $user,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$object=new PaymentTerm($this->db);
|
||||
|
||||
@ -97,9 +97,6 @@ class Localtax extends CommonObject
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
$this->note=trim($this->note);
|
||||
$this->fk_bank=trim($this->fk_bank);
|
||||
$this->fk_user_creat=trim($this->fk_user_creat);
|
||||
$this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."localtax(";
|
||||
@ -121,9 +118,9 @@ class Localtax extends CommonObject
|
||||
$sql.= " '".$this->db->escape($this->amount)."',";
|
||||
$sql.= " '".$this->db->escape($this->label)."',";
|
||||
$sql.= " '".$this->db->escape($this->note)."',";
|
||||
$sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->db->escape($this->fk_bank)."'").",";
|
||||
$sql.= " '".$this->db->escape($this->fk_user_creat)."',";
|
||||
$sql.= " '".$this->db->escape($this->fk_user_modif)."'";
|
||||
$sql.= " ".($this->fk_bank <= 0 ? "NULL" : (int) $this->fk_bank).",";
|
||||
$sql.= " ".((int) $this->fk_user_creat).",";
|
||||
$sql.= " ".((int) $this->fk_user_modif);
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
@ -173,9 +170,6 @@ class Localtax extends CommonObject
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
$this->note=trim($this->note);
|
||||
$this->fk_bank=trim($this->fk_bank);
|
||||
$this->fk_user_creat=trim($this->fk_user_creat);
|
||||
$this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -188,9 +182,9 @@ class Localtax extends CommonObject
|
||||
$sql.= " amount=".price2num($this->amount).",";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " note='".$this->db->escape($this->note)."',";
|
||||
$sql.= " fk_bank=".$this->fk_bank.",";
|
||||
$sql.= " fk_user_creat=".$this->fk_user_creat.",";
|
||||
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
||||
$sql.= " fk_bank=".(int) $this->fk_bank.",";
|
||||
$sql.= " fk_user_creat=".(int) $this->fk_user_creat.",";
|
||||
$sql.= " fk_user_modif=".(int) $this->fk_user_modif;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -299,7 +293,6 @@ class Localtax extends CommonObject
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -324,6 +317,8 @@ class Localtax extends CommonObject
|
||||
*/
|
||||
public function initAsSpecimen()
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->id=0;
|
||||
|
||||
$this->tms='';
|
||||
@ -333,9 +328,9 @@ class Localtax extends CommonObject
|
||||
$this->amount='';
|
||||
$this->label='';
|
||||
$this->note='';
|
||||
$this->fk_bank='';
|
||||
$this->fk_user_creat='';
|
||||
$this->fk_user_modif='';
|
||||
$this->fk_bank=0;
|
||||
$this->fk_user_creat=$user->id;
|
||||
$this->fk_user_modif=$user->id;
|
||||
}
|
||||
|
||||
|
||||
@ -347,7 +342,6 @@ class Localtax extends CommonObject
|
||||
*/
|
||||
public function solde($year = 0)
|
||||
{
|
||||
|
||||
$reglee = $this->localtax_sum_reglee($year);
|
||||
|
||||
$payee = $this->localtax_sum_payee($year);
|
||||
@ -528,7 +522,7 @@ class Localtax extends CommonObject
|
||||
$sql.= "'".$this->db->idate($this->datev)."'," . $this->amount;
|
||||
if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
|
||||
if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
|
||||
$sql.=", '".$user->id."', NULL";
|
||||
$sql.=", ".((int) $user->id).", NULL";
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."::addPayment", LOG_DEBUG);
|
||||
|
||||
@ -115,13 +115,9 @@ class PaymentSalary extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->fk_user=trim($this->fk_user);
|
||||
$this->amount=trim($this->amount);
|
||||
$this->label=trim($this->label);
|
||||
$this->note=trim($this->note);
|
||||
$this->fk_bank=trim($this->fk_bank);
|
||||
$this->fk_user_author=trim($this->fk_user_author);
|
||||
$this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->fk_user) || $this->fk_user < 0)
|
||||
@ -140,16 +136,16 @@ class PaymentSalary extends CommonObject
|
||||
$sql.= " datep='".$this->db->idate($this->datep)."',";
|
||||
$sql.= " datev='".$this->db->idate($this->datev)."',";
|
||||
$sql.= " amount=".price2num($this->amount).",";
|
||||
$sql.= " fk_projet='".$this->db->escape($this->fk_project)."',";
|
||||
$sql.= " fk_projet=".((int) $this->fk_project).",";
|
||||
$sql.= " fk_typepayment=".$this->fk_typepayment."',";
|
||||
$sql.= " num_payment='".$this->db->escape($this->num_payment)."',";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " datesp='".$this->db->idate($this->datesp)."',";
|
||||
$sql.= " dateep='".$this->db->idate($this->dateep)."',";
|
||||
$sql.= " note='".$this->db->escape($this->note)."',";
|
||||
$sql.= " fk_bank=".($this->fk_bank > 0 ? "'".$this->db->escape($this->fk_bank)."'":"null").",";
|
||||
$sql.= " fk_user_author=".$this->fk_user_author.",";
|
||||
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
||||
$sql.= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").",";
|
||||
$sql.= " fk_user_author=".((int) $this->fk_user_author).",";
|
||||
$sql.= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : 'null');
|
||||
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
|
||||
@ -346,15 +346,14 @@ class Cchargesociales
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
*
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
global $user;
|
||||
$error = 0;
|
||||
$object = new Cchargesociales($this->db);
|
||||
|
||||
|
||||
@ -448,13 +448,12 @@ class PaymentSocialContribution extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
global $user,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$object=new PaymentSocialContribution($this->db);
|
||||
|
||||
@ -51,6 +51,7 @@ if (! $sortfield) $sortfield="ref";
|
||||
|
||||
// Category
|
||||
$selected_cat = (int) GETPOST('search_categ', 'int');
|
||||
$selected_soc = (int) GETPOST('search_soc', 'int');
|
||||
$subcat = false;
|
||||
if (GETPOST('subcat', 'alpha') === 'yes') {
|
||||
$subcat = true;
|
||||
@ -137,6 +138,7 @@ $headerparams['q'] = $q;
|
||||
|
||||
$tableparams = array();
|
||||
$tableparams['search_categ'] = $selected_cat;
|
||||
$tableparams['search_soc'] = $selected_soc;
|
||||
$tableparams['search_type'] = $selected_type;
|
||||
$tableparams['subcat'] = ($subcat === true)?'yes':'';
|
||||
|
||||
@ -225,7 +227,9 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
|
||||
$sql.= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
|
||||
$sql.= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
if($selected_soc > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
|
||||
$sql.= ",".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
@ -259,6 +263,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql.= ")";
|
||||
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
||||
}
|
||||
if($selected_soc > 0) $sql .= " AND soc.rowid=".$selected_soc;
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
@ -313,6 +318,10 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
print ' ';
|
||||
print $langs->trans("Type"). ': ';
|
||||
$form->select_type_of_lines(isset($selected_type)?$selected_type:-1, 'search_type', 1, 1, 1);
|
||||
|
||||
//select thirdparty
|
||||
print '</br>';
|
||||
print $langs->trans("ThirdParty") . ': ' . $form->select_thirdparty_list($selected_soc, 'search_soc', '', 1);
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="5" class="right">';
|
||||
|
||||
@ -146,6 +146,8 @@ $fieldstosearchall = array(
|
||||
'p.email'=>'EMail',
|
||||
's.nom'=>"ThirdParty",
|
||||
'p.phone'=>"Phone",
|
||||
'p.note_public'=>"NotePublic",
|
||||
'p.note_private'=>"NotePrivate",
|
||||
);
|
||||
|
||||
// Definition of fields for list
|
||||
|
||||
@ -1072,7 +1072,7 @@ if (empty($reshook))
|
||||
else
|
||||
{
|
||||
if ($object->id > 0) {
|
||||
$result = $object->createFromClone($socid);
|
||||
$result = $object->createFromClone($user, $socid);
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
|
||||
exit();
|
||||
|
||||
@ -2388,13 +2388,14 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $socid Id of thirdparty
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $socid Id of thirdparty
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($socid = 0, $notrigger = 0)
|
||||
public function createFromClone(User $user, $socid = 0, $notrigger = 0)
|
||||
{
|
||||
global $db, $user, $langs, $conf, $hookmanager, $extrafields;
|
||||
global $db, $langs, $conf, $hookmanager, $extrafields;
|
||||
|
||||
dol_include_once('/projet/class/project.class.php');
|
||||
|
||||
|
||||
@ -195,23 +195,6 @@ if ($action == 'confirm_delete' && ! empty($permissiontodelete))
|
||||
}
|
||||
}
|
||||
|
||||
// Action clone object
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd)
|
||||
{
|
||||
$objectutil = dol_clone($object); // To avoid to denaturate loaded object when setting some properties for clone
|
||||
//$objectutil->date = dol_mktime(12, 0, 0, GETPOST('newdatemonth', 'int'), GETPOST('newdateday', 'int'), GETPOST('newdateyear', 'int'));
|
||||
|
||||
$result = $objectutil->createFromClone($id);
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
|
||||
exit();
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($objectutil->error, $objectutil->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Action clone object
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd)
|
||||
{
|
||||
|
||||
@ -345,6 +345,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($objectclass == 'Supplier_Proposal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO));
|
||||
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
|
||||
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
|
||||
if ($objectclass == 'Project') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROJECT_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROJECT_TO));
|
||||
|
||||
// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
|
||||
// $looparray will be an array with number of email to send for the current thirdparty (so 1 or n if n object for same thirdparty)
|
||||
|
||||
@ -179,7 +179,7 @@ if ($type == 'directory')
|
||||
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
|
||||
|
||||
// Right area. If module is defined here, we are in automatic ecm.
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday');
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday', 'banque');
|
||||
|
||||
// TODO change for multicompany sharing
|
||||
// Auto area for suppliers invoices
|
||||
@ -212,12 +212,14 @@ if ($type == 'directory')
|
||||
elseif ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
|
||||
// Auto area for holiday
|
||||
elseif ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
|
||||
// Auto area for holiday
|
||||
elseif ($module == 'banque') $upload_dir = $conf->bank->dir_output;
|
||||
|
||||
// Automatic list
|
||||
if (in_array($module, $automodules))
|
||||
{
|
||||
$param.='&module='.$module;
|
||||
if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.$search_doc_ref;
|
||||
if (isset($search_doc_ref) && $search_doc_ref != '') $param.='&search_doc_ref='.urlencode($search_doc_ref);
|
||||
|
||||
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
|
||||
|
||||
@ -335,8 +337,8 @@ if ($useajax || $action == 'delete')
|
||||
$formquestion['section_id']=array('type'=>'hidden','value'=>$section_id,'name'=>'section_id'); // We must always put field, even if empty because it is fille by javascript later
|
||||
$formquestion['section_dir']=array('type'=>'hidden','value'=>$section_dir,'name'=>'section_dir'); // We must always put field, even if empty because it is fille by javascript later
|
||||
if (! empty($action) && $action == 'file_manager') $formquestion['file_manager']=array('type'=>'hidden','value'=>1,'name'=>'file_manager');
|
||||
if (! empty($websitekey)) $formquestion['website']=array('type'=>'hidden','value'=>$websitekey,'name'=>'website');
|
||||
if (! empty($pageid) && $pageid > 0) $formquestion['pageid']=array('type'=>'hidden','value'=>$pageid,'name'=>'pageid');
|
||||
if (! empty($websitekey)) $formquestion['website'] =array('type'=>'hidden','value'=>$websitekey,'name'=>'website');
|
||||
if (! empty($pageid) && $pageid > 0) $formquestion['pageid'] =array('type'=>'hidden','value'=>$pageid,'name'=>'pageid');
|
||||
|
||||
print $form->formconfirm($url, $langs->trans("DeleteFile"), $langs->trans("ConfirmDeleteFile"), 'confirm_deletefile', $formquestion, "no", ($useajax?'deletefile':0));
|
||||
}
|
||||
|
||||
@ -94,6 +94,8 @@ class AntiVir
|
||||
// Run CLI command. If run of Windows, you can get return with echo %ERRORLEVEL%
|
||||
$lastline=exec($fullcommand, $output, $return_var);
|
||||
|
||||
if (is_null($output)) $output=array();
|
||||
|
||||
//print "x".$lastline." - ".join(',',$output)." - ".$return_var."y";exit;
|
||||
|
||||
/*
|
||||
|
||||
@ -3963,8 +3963,10 @@ abstract class CommonObject
|
||||
// Reduction short
|
||||
print '<td class="linecoldiscount right">'.$langs->trans('ReductionShort').'</td>';
|
||||
|
||||
// Fields for situation invoice
|
||||
if ($this->situation_cycle_ref) {
|
||||
print '<td class="linecolcycleref right">' . $langs->trans('Progress') . '</td>';
|
||||
print '<td class="linecolcycleref2 right">' . $langs->trans('TotalHT100Short') . '</td>';
|
||||
}
|
||||
|
||||
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
|
||||
|
||||
@ -404,15 +404,14 @@ class Ctyperesource
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
*
|
||||
* @return int New id of clone
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid)
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
global $user;
|
||||
$error = 0;
|
||||
$object = new Ctyperesource($this->db);
|
||||
|
||||
|
||||
@ -1837,7 +1837,7 @@ class ExtraFields
|
||||
$out='';
|
||||
|
||||
// Only if something to display (perf)
|
||||
if ($value) // If we have -1 here, pb is into sert, not into ouptu
|
||||
if ($value) // If we have -1 here, pb is into insert, not into ouptut (fix insert instead of changing code here to compensate)
|
||||
{
|
||||
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
|
||||
|
||||
|
||||
@ -195,7 +195,6 @@ class Fiscalyear extends CommonObject
|
||||
$sql .= ", date_start = '".$this->db->idate($this->date_start)."'";
|
||||
$sql .= ", date_end = ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||
$sql .= ", statut = '".$this->db->escape($this->statut?$this->statut:0)."'";
|
||||
$sql .= ", datec = " . ($this->datec != '' ? "'".$this->db->idate($this->datec)."'" : 'null');
|
||||
$sql .= ", fk_user_modif = " . $user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
|
||||
@ -237,9 +237,9 @@ class Form
|
||||
}
|
||||
elseif (preg_match('/^ckeditor/', $typeofdata))
|
||||
{
|
||||
$tmp=explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols
|
||||
$tmp=explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($htmlname, ($editvalue?$editvalue:$value), ($tmp[2]?$tmp[2]:''), ($tmp[3]?$tmp[3]:'100'), ($tmp[1]?$tmp[1]:'dolibarr_notes'), 'In', ($tmp[5]?$tmp[5]:0), true, true, ($tmp[6]?$tmp[6]:'20'), ($tmp[7]?$tmp[7]:'100'));
|
||||
$doleditor=new DolEditor($htmlname, ($editvalue?$editvalue:$value), ($tmp[2]?$tmp[2]:''), ($tmp[3]?$tmp[3]:'100'), ($tmp[1]?$tmp[1]:'dolibarr_notes'), 'In', ($tmp[5]?$tmp[5]:0), (isset($tmp[8])?($tmp[8]?true:false):true), true, ($tmp[6]?$tmp[6]:'20'), ($tmp[7]?$tmp[7]:'100'));
|
||||
$ret.=$doleditor->Create(1);
|
||||
}
|
||||
if (empty($notabletag)) $ret.='</td>';
|
||||
@ -5146,7 +5146,7 @@ class Form
|
||||
* - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location)
|
||||
* - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1)
|
||||
*
|
||||
* @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
|
||||
* @param integer $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
|
||||
* @param string $prefix Prefix for fields name
|
||||
* @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty
|
||||
* @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty
|
||||
|
||||
@ -1464,7 +1464,7 @@ class FormFile
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -1474,10 +1474,10 @@ class FormFile
|
||||
print '<tr class="liste_titre">';
|
||||
$sortref="fullname";
|
||||
if ($modulepart == 'invoice_supplier') $sortref='level1name';
|
||||
print_liste_field_titre("Ref", $url, $sortref, "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Documents2", $url, "name", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Size", $url, "size", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $url, "date", "", $param, 'class="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Ref", $url, $sortref, "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Documents2", $url, "name", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Size", $url, "size", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Date", $url, "date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre('', '', '');
|
||||
print '</tr>'."\n";
|
||||
|
||||
@ -1557,6 +1557,11 @@ class FormFile
|
||||
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
$object_instance=new Holiday($this->db);
|
||||
}
|
||||
elseif ($modulepart == 'banque')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$object_instance=new Account($this->db);
|
||||
}
|
||||
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
@ -1569,17 +1574,20 @@ class FormFile
|
||||
// Define relative path used to store the file
|
||||
$relativefile=preg_replace('/'.preg_quote($upload_dir.'/', '/').'/', '', $file['fullname']);
|
||||
|
||||
//var_dump($file);
|
||||
$id=0; $ref=''; $label='';
|
||||
|
||||
// To show ref or specific information according to view to show (defined by $module)
|
||||
if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); }
|
||||
elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices
|
||||
elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); }
|
||||
elseif (in_array($modulepart, array('invoice', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'project', 'fichinter', 'expensereport')))
|
||||
elseif (in_array($modulepart, array('invoice', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'project', 'fichinter', 'expensereport', 'banque')))
|
||||
{
|
||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');
|
||||
}
|
||||
else
|
||||
{
|
||||
//print 'Error: Value for modulepart = '.$modulepart.' is not yet implemented in function list_of_autoecmfiles'."\n";
|
||||
}
|
||||
|
||||
if (! $id && ! $ref) continue;
|
||||
$found=0;
|
||||
@ -1597,13 +1605,13 @@ class FormFile
|
||||
//fetchOneLike looks for objects with wildcards in its reference.
|
||||
//It is useful for those masks who get underscores instead of their actual symbols
|
||||
//fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned
|
||||
//that's why we look only look fetchOneLike when fetch returns 0
|
||||
//that's why we look only into fetchOneLike when fetch returns 0
|
||||
if (!$result = $object_instance->fetch('', $ref)) {
|
||||
$result = $object_instance->fetchOneLike($ref);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result > 0) { // Save object into a cache
|
||||
if ($result > 0) { // Save object loaded into a cache
|
||||
$found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref] = clone $object_instance;
|
||||
}
|
||||
if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); }
|
||||
|
||||
@ -1037,9 +1037,12 @@ class FormMail extends Form
|
||||
|
||||
$showinfobcc='';
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_supplier_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'invoice_supplier_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROJECT_TO) && ! empty($this->param['models']) && $this->param['models'] == 'project') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROJECT_TO;
|
||||
if ($showinfobcc) $out.=' + '.$showinfobcc;
|
||||
$out.= "</td></tr>\n";
|
||||
return $out;
|
||||
|
||||
@ -466,7 +466,9 @@ class Translate
|
||||
if (! $found && ! empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
// Overwrite translation with database read
|
||||
$sql="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."'";
|
||||
$sql ="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."' OR lang IS NULL";
|
||||
$sql.=" AND entity IN (0, ".getEntity('overwrite_trans').")";
|
||||
$sql.=$db->order("lang", "DESC");
|
||||
$resql=$db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
|
||||
@ -239,36 +239,37 @@ class Utils
|
||||
dol_mkdir($conf->admin->dir_output.'/backup');
|
||||
|
||||
// Parameteres execution
|
||||
$command=$cmddump;
|
||||
if (preg_match("/\s/", $command)) $command=escapeshellarg($command); // Use quotes on command
|
||||
$command = $cmddump;
|
||||
$command = preg_replace('/(\$|%)/', '', $command); // We removed chars that can be used to inject vars that contains space inside path of command without seeing there is a space to bypass the escapeshellarg.
|
||||
if (preg_match("/\s/", $command)) $command=escapeshellarg($command); // If there is spaces, we add quotes on command to be sure $command is only a program and not a program+parameters
|
||||
|
||||
//$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass);
|
||||
$param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host;
|
||||
$param.=" -u ".$dolibarr_main_db_user;
|
||||
if (! empty($dolibarr_main_db_port)) $param.=" -P ".$dolibarr_main_db_port;
|
||||
if (! GETPOST("use_transaction")) $param.=" -l --single-transaction";
|
||||
if (GETPOST("disable_fk") || $usedefault) $param.=" -K";
|
||||
if (GETPOST("sql_compat") && GETPOST("sql_compat") != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat", "alpha"));
|
||||
if (GETPOST("drop_database")) $param.=" --add-drop-database";
|
||||
if (GETPOST("sql_structure") || $usedefault)
|
||||
if (! GETPOST("use_transaction", "alpha")) $param.=" -l --single-transaction";
|
||||
if (GETPOST("disable_fk", "alpha") || $usedefault) $param.=" -K";
|
||||
if (GETPOST("sql_compat", "alpha") && GETPOST("sql_compat", "alpha") != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat", "alpha"));
|
||||
if (GETPOST("drop_database", "alpha")) $param.=" --add-drop-database";
|
||||
if (GETPOST("sql_structure", "alpha") || $usedefault)
|
||||
{
|
||||
if (GETPOST("drop") || $usedefault) $param.=" --add-drop-table=TRUE";
|
||||
else $param.=" --add-drop-table=FALSE";
|
||||
if (GETPOST("drop", "alpha") || $usedefault) $param.=" --add-drop-table=TRUE";
|
||||
else $param.=" --add-drop-table=FALSE";
|
||||
}
|
||||
else
|
||||
{
|
||||
$param.=" -t";
|
||||
}
|
||||
if (GETPOST("disable-add-locks")) $param.=" --add-locks=FALSE";
|
||||
if (GETPOST("sql_data") || $usedefault)
|
||||
if (GETPOST("disable-add-locks", "alpha")) $param.=" --add-locks=FALSE";
|
||||
if (GETPOST("sql_data", "alpha") || $usedefault)
|
||||
{
|
||||
$param.=" --tables";
|
||||
if (GETPOST("showcolumns") || $usedefault) $param.=" -c";
|
||||
if (GETPOST("extended_ins") || $usedefault) $param.=" -e";
|
||||
if (GETPOST("showcolumns", "alpha") || $usedefault) $param.=" -c";
|
||||
if (GETPOST("extended_ins", "alpha") || $usedefault) $param.=" -e";
|
||||
else $param.=" --skip-extended-insert";
|
||||
if (GETPOST("delayed")) $param.=" --delayed-insert";
|
||||
if (GETPOST("sql_ignore")) $param.=" --insert-ignore";
|
||||
if (GETPOST("hexforbinary") || $usedefault) $param.=" --hex-blob";
|
||||
if (GETPOST("delayed", "alpha")) $param.=" --delayed-insert";
|
||||
if (GETPOST("sql_ignore", "alpha")) $param.=" --insert-ignore";
|
||||
if (GETPOST("hexforbinary", "alpha") || $usedefault) $param.=" --hex-blob";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -436,8 +437,9 @@ class Utils
|
||||
dol_mkdir($conf->admin->dir_output.'/backup');
|
||||
|
||||
// Parameteres execution
|
||||
$command=$cmddump;
|
||||
if (preg_match("/\s/", $command)) $command=escapeshellarg($command); // Use quotes on command
|
||||
$command = $cmddump;
|
||||
$command = preg_replace('/(\$|%)/', '', $command); // We removed chars that can be used to inject vars that contains space inside path of command without seeing there is a space to bypass the escapeshellarg.
|
||||
if (preg_match("/\s/", $command)) $command=escapeshellarg($command); // If there is spaces, we add quotes on command to be sure $command is only a program and not a program+parameters
|
||||
|
||||
//$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass);
|
||||
//$param="-F c";
|
||||
|
||||
@ -90,24 +90,20 @@ function pad(n) {
|
||||
|
||||
|
||||
/* function from http://www.timlabonne.com/2013/07/parsing-a-time-string-with-javascript/ */
|
||||
/* timeStr must be a duration with format XX:YY (AM/PM not supported) */
|
||||
function parseTime(timeStr, dt)
|
||||
{
|
||||
if (!dt) {
|
||||
dt = new Date();
|
||||
}
|
||||
|
||||
var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i);
|
||||
//var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i);
|
||||
var time = timeStr.match(/(\d+)(?::(\d\d))?/i);
|
||||
if (!time) {
|
||||
return -1;
|
||||
}
|
||||
var hours = parseInt(time[1], 10);
|
||||
if (hours == 12 && !time[3]) {
|
||||
hours = 0;
|
||||
}
|
||||
else {
|
||||
hours += (hours < 12 && time[3]) ? 12 : 0;
|
||||
}
|
||||
|
||||
|
||||
dt.setHours(hours);
|
||||
dt.setMinutes(parseInt(time[2], 10) || 0);
|
||||
dt.setSeconds(0, 0);
|
||||
|
||||
@ -108,7 +108,7 @@ function length_accountg($account)
|
||||
*/
|
||||
function length_accounta($accounta)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
if ($accounta < 0 || empty($accounta)) return '';
|
||||
|
||||
@ -156,12 +156,11 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (empty($hselected)) $hselected='report';
|
||||
|
||||
print "\n\n<!-- debut cartouche journal -->\n";
|
||||
|
||||
if(! empty($varlink)) $varlink = '?'.$varlink;
|
||||
|
||||
$head=array();
|
||||
$h=0;
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
|
||||
$head[$h][1] = $langs->trans("Journalization");
|
||||
@ -180,10 +179,8 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
|
||||
// Ligne de titre
|
||||
print '<tr>';
|
||||
print '<td width="110">'.$langs->trans("Name").'</td>';
|
||||
if (! $variantexxx) print '<td colspan="3">';
|
||||
else print '<td>';
|
||||
print '<td colspan="3">';
|
||||
print $nom;
|
||||
if ($variantexxx) print '</td><td colspan="2">'.$variantexxx;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -160,6 +160,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
|
||||
else $buf = fgets($fp);
|
||||
|
||||
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
||||
$reg=array();
|
||||
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i', $buf, $reg))
|
||||
{
|
||||
$qualified=1;
|
||||
@ -794,8 +795,9 @@ function listOfSessions()
|
||||
{
|
||||
$tmp=explode('_', $file);
|
||||
$idsess=$tmp[1];
|
||||
$login = preg_match('/dol_login\|s:[0-9]+:"([A-Za-z0-9]+)"/i', $sessValues, $regs);
|
||||
$arrayofSessions[$idsess]["login"] = $regs[1];
|
||||
$regs=array();
|
||||
$loginfound = preg_match('/dol_login\|s:[0-9]+:"([A-Za-z0-9]+)"/i', $sessValues, $regs);
|
||||
if ($loginfound) $arrayofSessions[$idsess]["login"] = $regs[1];
|
||||
$arrayofSessions[$idsess]["age"] = time()-filectime($fullpath);
|
||||
$arrayofSessions[$idsess]["creation"] = filectime($fullpath);
|
||||
$arrayofSessions[$idsess]["modification"] = filemtime($fullpath);
|
||||
@ -820,7 +822,6 @@ function purgeSessions($mysessionid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$arrayofSessions = array();
|
||||
$sessPath = ini_get("session.save_path")."/";
|
||||
dol_syslog('admin.lib:purgeSessions mysessionid='.$mysessionid.' sessPath='.$sessPath);
|
||||
|
||||
@ -868,7 +869,9 @@ function purgeSessions($mysessionid)
|
||||
*/
|
||||
function activateModule($value, $withdeps = 1)
|
||||
{
|
||||
global $db, $modules, $langs, $conf, $mysoc;
|
||||
global $db, $langs, $conf, $mysoc;
|
||||
|
||||
$ret=array();
|
||||
|
||||
// Check parameters
|
||||
if (empty($value)) {
|
||||
@ -1689,8 +1692,10 @@ function phpinfo_array()
|
||||
foreach($info_lines as $line)
|
||||
{
|
||||
// new cat?
|
||||
$title = array();
|
||||
preg_match("~<h2>(.*)</h2>~", $line, $title) ? $cat = $title[1] : null;
|
||||
if(preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val))
|
||||
$val = array();
|
||||
if (preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val))
|
||||
{
|
||||
$info_arr[trim($cat)][trim($val[1])] = $val[2];
|
||||
}
|
||||
@ -1709,7 +1714,7 @@ function phpinfo_array()
|
||||
*/
|
||||
function company_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -182,7 +182,7 @@ function various_payment_prepare_head($object)
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->banque->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id;
|
||||
|
||||
@ -2701,7 +2701,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
}
|
||||
|
||||
// Wrapping pour les remises de cheques
|
||||
elseif ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output))
|
||||
elseif ($modulepart == 'remisecheque' && !empty($conf->bank->dir_output))
|
||||
{
|
||||
if ($fuser->rights->banque->{$lire} || preg_match('/^specimen/i', $original_file))
|
||||
{
|
||||
@ -2712,7 +2712,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
}
|
||||
|
||||
// Wrapping for bank
|
||||
elseif ($modulepart == 'bank' && !empty($conf->bank->dir_output))
|
||||
elseif (($modulepart == 'banque' || $modulepart == 'bank') && !empty($conf->bank->dir_output))
|
||||
{
|
||||
if ($fuser->rights->banque->{$lire})
|
||||
{
|
||||
|
||||
@ -3754,6 +3754,11 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
||||
$syslog.="pid=".dol_getmypid();
|
||||
}
|
||||
|
||||
if (! empty($conf->modules))
|
||||
{
|
||||
$out.="<b>".$langs->trans("Modules").":</b> ".join(', ', $conf->modules)."<br>\n";
|
||||
}
|
||||
|
||||
if (is_object($db))
|
||||
{
|
||||
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
||||
@ -6102,6 +6107,7 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
{
|
||||
$substitutionarray['__DOL_MAIN_URL_ROOT__']=DOL_MAIN_URL_ROOT;
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$outputlangs->trans('TranslationOfKey');
|
||||
$substitutionarray['__(AnyTranslationKey|langfile)__']=$outputlangs->trans('TranslationOfKey').' (load also language file before)';
|
||||
$substitutionarray['__[AnyConstantKey]__']=$outputlangs->trans('ValueOfConstantKey');
|
||||
}
|
||||
|
||||
@ -6130,7 +6136,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null)
|
||||
|
||||
if (empty($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
// Make substitution for language keys
|
||||
// Make substitution for language keys: __(AnyTranslationKey)__ or __(AnyTranslationKey|langfile)__
|
||||
if (is_object($outputlangs))
|
||||
{
|
||||
while (preg_match('/__\(([^\)]+)\)__/', $text, $reg))
|
||||
@ -6146,8 +6152,8 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null)
|
||||
}
|
||||
}
|
||||
|
||||
// Make substitution for constant keys. Must be after the substitution of translation, so if text of translation contains a constant,
|
||||
// it is also converted.
|
||||
// Make substitution for constant keys.
|
||||
// Must be after the substitution of translation, so if the text of translation contains a string __[xxx]__, it is also converted.
|
||||
while (preg_match('/__\[([^\]]+)\]__/', $text, $reg))
|
||||
{
|
||||
$msgishtml = 0;
|
||||
|
||||
@ -564,6 +564,28 @@ function isValidUrl($url, $http = 0, $pass = 0, $port = 0, $path = 0, $query = 0
|
||||
return $ValidUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if VAT numero is valid (check done on syntax only, no database or remote access)
|
||||
*
|
||||
* @param Societe $company VAT number
|
||||
* @return int 1=Check is OK, 0=Check is KO
|
||||
*/
|
||||
function isValidVATID($company)
|
||||
{
|
||||
if ($company->isInEEC()) // Syntax check rules for EEC countries
|
||||
{
|
||||
$vatprefix = $company->country_code;
|
||||
if ($vatprefix == 'GR') $vatprefix = '(EL|GR)';
|
||||
else $vatprefix = preg_quote($vatprefix, '/');
|
||||
if (! preg_match('/^'.$vatprefix.'[a-zA-Z0-9\-\.]{5,10}$/', $company->tva_intra))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean an url string
|
||||
*
|
||||
@ -2496,7 +2518,7 @@ function autoOrManual($automaticmanual, $case = 1, $color = 0)
|
||||
|
||||
/**
|
||||
* Convert links to local wrapper to medias files into a string into a public external URL readable on internet
|
||||
*
|
||||
*
|
||||
* @param string $notetoshow Text to convert
|
||||
* @return string String
|
||||
*/
|
||||
@ -2504,7 +2526,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
|
||||
{
|
||||
global $dolibarr_main_url_root;
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
$notetoshow=preg_replace('/src="[a-zA-Z0-9_\/\-\.]*(viewimage\.php\?modulepart=medias[^"]*)"/', 'src="'.$urlwithroot.'/\1"', $notetoshow);
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function get content from an URL (use proxy if proxy defined)
|
||||
* Function to get a content from an URL (use proxy if proxy defined)
|
||||
*
|
||||
* @param string $url URL to call.
|
||||
* @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'DELETE'
|
||||
* @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE'
|
||||
* @param string $param Parameters of URL (x=value1&y=value2) or may be a formated content with PUTALREADYFORMATED
|
||||
* @param integer $followlocation 1=Follow location, 0=Do not follow
|
||||
* @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
|
||||
@ -34,7 +34,7 @@
|
||||
function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = 1, $addheaders = array())
|
||||
{
|
||||
//declaring of global variables
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
$USE_PROXY=empty($conf->global->MAIN_PROXY_USE)?0:$conf->global->MAIN_PROXY_USE;
|
||||
$PROXY_HOST=empty($conf->global->MAIN_PROXY_HOST)?0:$conf->global->MAIN_PROXY_HOST;
|
||||
$PROXY_PORT=empty($conf->global->MAIN_PROXY_PORT)?0:$conf->global->MAIN_PROXY_PORT;
|
||||
@ -85,6 +85,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
||||
}
|
||||
elseif ($postorget == 'PUT')
|
||||
{
|
||||
$array_param=null;
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
|
||||
if (! is_array($param)) parse_str($param, $array_param);
|
||||
else
|
||||
@ -195,6 +196,7 @@ function getRootURLFromURL($url)
|
||||
{
|
||||
$prefix='';
|
||||
$tmpurl = $url;
|
||||
$reg = null;
|
||||
if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) $prefix = $reg[1];
|
||||
$tmpurl = preg_replace('/^https?:\/\//i', '', $tmpurl); // Remove http(s)://
|
||||
$tmpurl = preg_replace('/\/.*$/i', '', $tmpurl); // Remove part after domain
|
||||
|
||||
@ -142,23 +142,32 @@ function showOnlinePaymentUrl($type, $ref)
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
* @param int $mode 0=True url, 1=Url formated with colors
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @param int $amount Amount (required for $type='free' only)
|
||||
* @param string $freetag Free tag
|
||||
* @return string Url string
|
||||
* @param int $mode 0=True url, 1=Url formated with colors
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @param int $amount Amount (required for $type='free' only)
|
||||
* @param string $freetag Free tag
|
||||
* @param string $localorexternal 0=Url for browser, 1=Url for external access
|
||||
* @return string Url string
|
||||
*/
|
||||
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_free_tag')
|
||||
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_free_tag', $localorexternal = 0)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
$ref=str_replace(' ', '', $ref);
|
||||
$out='';
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
$urltouse = DOL_MAIN_URL_ROOT;
|
||||
if ($localorexternal) $urltouse = $urlwithroot;
|
||||
|
||||
if ($type == 'free')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':'');
|
||||
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
||||
@ -167,7 +176,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
}
|
||||
elseif ($type == 'order')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='order_ref';
|
||||
if ($mode == 0) $out.=urlencode($ref);
|
||||
$out.=($mode?'</font>':'');
|
||||
@ -185,7 +194,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
}
|
||||
elseif ($type == 'invoice')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='invoice_ref';
|
||||
if ($mode == 0) $out.=urlencode($ref);
|
||||
$out.=($mode?'</font>':'');
|
||||
@ -203,7 +212,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
}
|
||||
elseif ($type == 'contractline')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='contractline_ref';
|
||||
if ($mode == 0) $out.=urlencode($ref);
|
||||
$out.=($mode?'</font>':'');
|
||||
@ -221,7 +230,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
}
|
||||
elseif ($type == 'member' || $type == 'membersubscription')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='member_ref';
|
||||
if ($mode == 0) $out.=urlencode($ref);
|
||||
$out.=($mode?'</font>':'');
|
||||
@ -239,7 +248,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
}
|
||||
if ($type == 'donation')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':'');
|
||||
$out=$urltouse.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='donation_ref';
|
||||
if ($mode == 0) $out.=urlencode($ref);
|
||||
$out.=($mode?'</font>':'');
|
||||
|
||||
@ -341,14 +341,14 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
|
||||
/**
|
||||
* Return a string with full address formated for output on documents
|
||||
*
|
||||
* @param Translate $outputlangs Output langs object
|
||||
* @param Societe $sourcecompany Source company object
|
||||
* @param Societe|string $targetcompany Target company object
|
||||
* @param Contact|string $targetcontact Target contact object
|
||||
* @param int $usecontact Use contact instead of company
|
||||
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
|
||||
* @param Object $object Object we want to build document for
|
||||
* @return string String with full address
|
||||
* @param Translate $outputlangs Output langs object
|
||||
* @param Societe $sourcecompany Source company object
|
||||
* @param Societe|string|null $targetcompany Target company object
|
||||
* @param Contact|string|null $targetcontact Target contact object
|
||||
* @param int $usecontact Use contact instead of company
|
||||
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
|
||||
* @param Object $object Object we want to build document for
|
||||
* @return string String with full address
|
||||
*/
|
||||
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null)
|
||||
{
|
||||
@ -364,7 +364,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
|
||||
$stringaddress = '';
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters = array('sourcecompany'=>&$sourcecompany,'targetcompany'=>&$targetcompany,'targetcontact'=>$targetcontact,'outputlangs'=>$outputlangs,'mode'=>$mode,'usecontact'=>$usecontact);
|
||||
$parameters = array('sourcecompany'=>&$sourcecompany, 'targetcompany'=>&$targetcompany, 'targetcontact'=>&$targetcontact, 'outputlangs'=>$outputlangs, 'mode'=>$mode, 'usecontact'=>$usecontact);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_build_address', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$stringaddress.=$hookmanager->resPrint;
|
||||
@ -1954,6 +1954,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
|
||||
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
|
||||
if ($object->lines[$i]->situation_percent > 0)
|
||||
{
|
||||
// TODO Remove this. The total should be saved correctly in database instead of being modified here.
|
||||
$prev_progress = 0;
|
||||
$progress = 1;
|
||||
if (method_exists($object->lines[$i], 'get_prev_progress'))
|
||||
@ -1964,7 +1965,9 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
|
||||
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
|
||||
}
|
||||
else
|
||||
$result.=price($sign * $total_ht, 0, $outputlangs);
|
||||
{
|
||||
$result.=price($sign * $total_ht, 0, $outputlangs);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
* @param int $qty Quantity
|
||||
* @param float $pu Unit price (HT or TTC selon price_base_type)
|
||||
* @param float $remise_percent_ligne Discount for line
|
||||
* @param float $txtva 0=do not apply standard tax, Vat rate=apply
|
||||
* @param float $txtva 0=do not apply VAT tax, VAT rate=apply (this is VAT rate only without text code, we don't need text code because we alreaydy have all tax info into $localtaxes_array)
|
||||
* @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
|
||||
* @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
|
||||
* @param float $remise_percent_global 0
|
||||
@ -82,7 +82,7 @@
|
||||
* 25=multicurrency_total_tax1 for total_ht
|
||||
* 26=multicurrency_total_tax2 for total_ht
|
||||
*/
|
||||
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array = '', $progress = 100, $multicurrency_tx = 1, $pu_devise = 0)
|
||||
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_devise=0)
|
||||
{
|
||||
global $conf,$mysoc,$db;
|
||||
|
||||
@ -131,13 +131,14 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
$localtax2_type = $localtaxes_array[2];
|
||||
$localtax2_rate = $localtaxes_array[3];
|
||||
}
|
||||
else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate
|
||||
else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate using the full vat rate (including text code)
|
||||
{
|
||||
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
|
||||
dol_syslog("Price.lib::calcul_price_total search vat information using old deprecated method", LOG_WARNING);
|
||||
|
||||
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv";
|
||||
$sql.= " WHERE cv.taux = ".$txtva;
|
||||
$sql.= " AND cv.fk_pays = ".$countryid;
|
||||
dol_syslog("Price.lib::calcul_price_total search vat information using old deprecated method", LOG_WARNING);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -187,9 +188,9 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
//If input unit price is 'HT', we need to have the totals with main VAT for a correct calculation
|
||||
if ($price_base_type != 'TTC')
|
||||
{
|
||||
$tot_sans_remise_wt = price2num($tot_sans_remise * (1 + ($txtva / 100)), 'MU');
|
||||
$tot_avec_remise_wt = price2num($tot_avec_remise * (1 + ($txtva / 100)), 'MU');
|
||||
$pu_wt = price2num($pu * (1 + ($txtva / 100)), 'MU');
|
||||
$tot_sans_remise_wt = price2num($tot_sans_remise * (1 + ($txtva / 100)),'MU');
|
||||
$tot_avec_remise_wt = price2num($tot_avec_remise * (1 + ($txtva / 100)),'MU');
|
||||
$pu_wt = price2num($pu * (1 + ($txtva / 100)),'MU');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -291,9 +292,9 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
//If input unit price is 'TTC', we need to have the totals without main VAT for a correct calculation
|
||||
if ($price_base_type == 'TTC')
|
||||
{
|
||||
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)), 'MU');
|
||||
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)), 'MU');
|
||||
$pu = price2num($pu / (1 + ($txtva / 100)), 'MU');
|
||||
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
|
||||
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
|
||||
$pu = price2num($pu / (1 + ($txtva / 100)),'MU');
|
||||
}
|
||||
|
||||
$apply_tax = false;
|
||||
@ -410,3 +411,4 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -474,7 +474,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
// Ref of task
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
if ($showlineingray)
|
||||
{
|
||||
print '<i>'.img_object('', 'projecttask').' '.$lines[$i]->ref.'</i>';
|
||||
|
||||
@ -109,7 +109,7 @@ function dol_decode($chain, $key = '1')
|
||||
* @param string $chain String to hash
|
||||
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
|
||||
* @return string Hash of string
|
||||
* @getRandomPassword
|
||||
* @see getRandomPassword()
|
||||
*/
|
||||
function dol_hash($chain, $type = '0')
|
||||
{
|
||||
|
||||
@ -131,8 +131,8 @@ if (! function_exists('dol_loginfunction'))
|
||||
*/
|
||||
function dol_loginfunction($langs, $conf, $mysoc)
|
||||
{
|
||||
global $dolibarr_main_demo,$db;
|
||||
global $smartphone,$hookmanager;
|
||||
global $dolibarr_main_demo, $db;
|
||||
global $hookmanager;
|
||||
|
||||
$langs->loadLangs(array("main","other","help","admin"));
|
||||
|
||||
@ -207,11 +207,7 @@ if (! function_exists('dol_loginfunction'))
|
||||
// Execute hook getLoginPageOptions (for table)
|
||||
$parameters=array('entity' => GETPOST('entity', 'int'));
|
||||
$reshook = $hookmanager->executeHooks('getLoginPageOptions', $parameters); // Note that $action and $object may have been modified by some hooks.
|
||||
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||
} else {
|
||||
$morelogincontent = $hookmanager->resPrint;
|
||||
}
|
||||
$morelogincontent = $hookmanager->resPrint;
|
||||
|
||||
// Execute hook getLoginPageExtraOptions (eg for js)
|
||||
$parameters=array('entity' => GETPOST('entity', 'int'));
|
||||
@ -445,17 +441,17 @@ function encodedecode_dbpassconf($level = 0)
|
||||
*
|
||||
* @param boolean $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module
|
||||
* @param array $replaceambiguouschars Discard ambigous characters. For example array('I').
|
||||
* @return string New value for password
|
||||
* @param int $length Length of random string (Used only if $generic is true)
|
||||
* @return string New value for password
|
||||
* @see dol_hash()
|
||||
*/
|
||||
function getRandomPassword($generic = false, $replaceambiguouschars = null)
|
||||
function getRandomPassword($generic = false, $replaceambiguouschars = null, $length = 32)
|
||||
{
|
||||
global $db,$conf,$langs,$user;
|
||||
|
||||
$generated_password='';
|
||||
if ($generic)
|
||||
{
|
||||
$length = 32;
|
||||
$lowercase = "qwertyuiopasdfghjklzxcvbnm";
|
||||
$uppercase = "ASDFGHJKLZXCVBNMQWERTYUIOP";
|
||||
$numbers = "1234567890";
|
||||
|
||||
@ -51,7 +51,7 @@ function shipping_prepare_head($object)
|
||||
{
|
||||
// delivery link
|
||||
$object->fetchObjectLinked($object->id, $object->element);
|
||||
if (count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
|
||||
if (is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
|
||||
{
|
||||
// Take first one element of array
|
||||
$tmp = reset($object->linkedObjectsIds['delivery']);
|
||||
@ -176,7 +176,7 @@ function delivery_prepare_head($object)
|
||||
*/
|
||||
function show_list_sending_receive($origin, $origin_id, $filter = '')
|
||||
{
|
||||
global $db, $conf, $langs, $bc;
|
||||
global $db, $conf, $langs;
|
||||
global $form;
|
||||
|
||||
$product_static=new Product($db);
|
||||
@ -218,8 +218,8 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td class="left">'.$langs->trans("QtyOrdered").'</td>';
|
||||
print '<td class="left">'.$langs->trans("SendingSheet").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("SendingSheet").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>';
|
||||
|
||||
@ -100,6 +100,7 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0)
|
||||
* @param string $str String to clean
|
||||
* @param string $replacewith String to use as replacement
|
||||
* @return string Result string without php code
|
||||
* @see dolKeepOnlyPhpCode()
|
||||
*/
|
||||
function dolStripPhpCode($str, $replacewith = '')
|
||||
{
|
||||
@ -132,6 +133,44 @@ function dolStripPhpCode($str, $replacewith = '')
|
||||
return $newstr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep only PHP code part from a HTML string page.
|
||||
*
|
||||
* @param string $str String to clean
|
||||
* @return string Result string with php code only
|
||||
* @see dolStripPhpCode()
|
||||
*/
|
||||
function dolKeepOnlyPhpCode($str)
|
||||
{
|
||||
$newstr = '';
|
||||
|
||||
//split on each opening tag
|
||||
$parts = explode('<?php',$str);
|
||||
if (!empty($parts))
|
||||
{
|
||||
$i=0;
|
||||
foreach($parts as $part)
|
||||
{
|
||||
if ($i == 0) // The first part is never php code
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
$newstr.='<?php';
|
||||
//split on closing tag
|
||||
$partlings = explode('?>', $part, 2);
|
||||
if (!empty($partlings))
|
||||
{
|
||||
$newstr .= $partlings[0].'?>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$newstr .= $part.'?>';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $newstr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a string of an HTML content and output it.
|
||||
|
||||
@ -5,16 +5,16 @@
|
||||
|
||||
delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
|
||||
|
||||
--
|
||||
--
|
||||
-- table llx_menu
|
||||
--
|
||||
--
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|assets', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->accounting->assets', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->assets->read', '', 2, 54, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__);
|
||||
@ -238,8 +238,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 1, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 2, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
|
||||
-- Accounting Expert
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
|
||||
-- Accounting (Double entries)
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
|
||||
-- Setup
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__);
|
||||
|
||||
@ -299,10 +299,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
|
||||
-- Assets
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->assets->enabled', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'assets', 10__+MAX_llx_menu__, '/assets/list.php?mainmenu=accountancy&leftmenu=assets', 'MenuAssets', 0, 'assets', '$user->rights->assets->read', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->assets->enabled && $leftmenu=="assets"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'accountancy', '', 3000__+MAX_llx_menu__, '/assets/card.php?mainmenu=accountancy&leftmenu=assets&action=create', 'MenuNewAsset', 1, 'assets', '$user->rights->assets->write', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->assets->enabled && $leftmenu=="assets"', __HANDLER__, 'left', 3002__+MAX_llx_menu__, 'accountancy', '', 3000__+MAX_llx_menu__, '/assets/type.php?mainmenu=accountancy&leftmenu=assets&action=create', 'MenuTypeAssets', 1, 'assets', '$user->rights->assets->write', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->assets->enabled && $leftmenu=="assets"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'accountancy', '', 3000__+MAX_llx_menu__, '/assets/list.php?mainmenu=accountancy&leftmenu=assets', 'MenuListAssets', 1, 'assets', '$user->rights->assets->read', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->rights->asset->read', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&leftmenu=asset&action=create', 'MenuNewAsset', 2, 'assets', '$user->rights->asset->write', '', 0, 21, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 22, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 23, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&action=create', 'MenuNewTypeAssets', 3, 'assets', '$user->rights->asset->configurer', '', 0, 24, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '$user->rights->asset->read', '', 0, 25, __ENTITY__);
|
||||
-- Check deposit
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->lire', '', 2, 0, __ENTITY__);
|
||||
|
||||
@ -87,20 +87,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Members
|
||||
$tmpentry = array(
|
||||
'enabled' => (! empty($conf->adherent->enabled) ) ,
|
||||
'perms' => (! empty($user->rights->adherent->lire) ),
|
||||
'module' => 'adherent'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Members',
|
||||
'link' => '/adherents/index.php?mainmenu=members&leftmenu=',
|
||||
'title' => "MenuMembers",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled' => (! empty($conf->adherent->enabled) ) ,
|
||||
'perms' => (! empty($user->rights->adherent->lire) ),
|
||||
'module' => 'adherent',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "members",
|
||||
'leftmenu' => '',
|
||||
@ -115,24 +112,21 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Third parties
|
||||
$tmpentry = array(
|
||||
'enabled'=> ( ( ! empty($conf->societe->enabled) &&
|
||||
( empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) )
|
||||
)
|
||||
|| ! empty($conf->fournisseur->enabled)
|
||||
),
|
||||
'perms'=> (! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)),
|
||||
'module'=>'societe|fournisseur'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Companies',
|
||||
'link' => '/societe/index.php?mainmenu=companies&leftmenu=',
|
||||
'title' => "ThirdParties",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=> ( ( ! empty($conf->societe->enabled) &&
|
||||
( empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) )
|
||||
)
|
||||
|| ! empty($conf->fournisseur->enabled)
|
||||
),
|
||||
'perms'=> (! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)),
|
||||
'module'=>'societe|fournisseur',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "companies",
|
||||
'leftmenu' => '',
|
||||
@ -147,6 +141,15 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Products-Services
|
||||
$tmpentry = array(
|
||||
'enabled'=> (( ! empty($conf->societe->enabled) &&
|
||||
( empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) )
|
||||
)
|
||||
|| ! empty($conf->fournisseur->enabled)
|
||||
),
|
||||
'perms'=> (! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)),
|
||||
'module'=>'product|service'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Products',
|
||||
'link' => '/product/index.php?mainmenu=products&leftmenu=',
|
||||
@ -154,19 +157,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
? ( array("TMenuProducts" , " | " ,"TMenuServices") )
|
||||
: (! empty($conf->product->enabled)? "TMenuProducts" : "TMenuServices" ),
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=> (( ! empty($conf->societe->enabled) &&
|
||||
( empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) )
|
||||
)
|
||||
|| ! empty($conf->fournisseur->enabled)
|
||||
),
|
||||
'perms'=> (! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)),
|
||||
'module'=>'product|service',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "products",
|
||||
'leftmenu' => '',
|
||||
@ -181,20 +172,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// MRP
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->bom->enabled) || ! empty($conf->mrp->enabled)),
|
||||
'perms'=>(! empty($user->rights->bom->read) || ! empty($user->rights->mrp->read)),
|
||||
'module'=>'bom|mrp'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'TMenuMRP',
|
||||
'link' => '/mrp/index.php?mainmenu=mrp&leftmenu=',
|
||||
'title' => $langs->trans("TMenuMRP"),
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->bom->enabled) || ! empty($conf->mrp->enabled)),
|
||||
'perms'=>(! empty($user->rights->bom->read) || ! empty($user->rights->mrp->read)),
|
||||
'module'=>'bom|mrp',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "mrp",
|
||||
'leftmenu' => '',
|
||||
@ -209,6 +197,11 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Projects
|
||||
$tmpentry = array(
|
||||
'enabled'=> ( ! empty($conf->projet->enabled) ? 1 : 0),
|
||||
'perms'=> (! empty($user->rights->projet->lire) ? 1 : 0),
|
||||
'module'=>'projet'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Projet',
|
||||
'link' => '/projet/index.php?mainmenu=project&leftmenu=',
|
||||
@ -216,15 +209,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
? (($conf->global->PROJECT_USE_OPPORTUNITIES == 2)?"Leads":"Projects")
|
||||
: "LeadsOrProjects",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=> ( ! empty($conf->projet->enabled) ? 1 : 0),
|
||||
'perms'=> (! empty($user->rights->projet->lire) ? 1 : 0),
|
||||
'module'=>'projet',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "project",
|
||||
'leftmenu' => '',
|
||||
@ -239,26 +224,23 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Commercial
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->propal->enabled) ||
|
||||
! empty($conf->commande->enabled) ||
|
||||
! empty($conf->supplier_order->enabled) ||
|
||||
! empty($conf->supplier_proposal->enabled) ||
|
||||
! empty($conf->contrat->enabled) ||
|
||||
! empty($conf->ficheinter->enabled)
|
||||
)?1:0,
|
||||
'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)),
|
||||
'module'=>'propal|commande|supplier_order|contrat|ficheinter'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Commercial',
|
||||
'link' => '/comm/index.php?mainmenu=commercial&leftmenu=',
|
||||
'title' => "Commercial",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->propal->enabled) ||
|
||||
! empty($conf->commande->enabled) ||
|
||||
! empty($conf->supplier_order->enabled) ||
|
||||
! empty($conf->supplier_proposal->enabled) ||
|
||||
! empty($conf->contrat->enabled) ||
|
||||
! empty($conf->ficheinter->enabled)
|
||||
)?1:0,
|
||||
'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)),
|
||||
'module'=>'propal|commande|supplier_order|contrat|ficheinter',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "commercial",
|
||||
'leftmenu' => '',
|
||||
@ -273,28 +255,25 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Billing - Financial
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->facture->enabled) ||
|
||||
! empty($conf->don->enabled) ||
|
||||
! empty($conf->tax->enabled) ||
|
||||
! empty($conf->salaries->enabled) ||
|
||||
! empty($conf->supplier_invoice->enabled) ||
|
||||
! empty($conf->loan->enabled)
|
||||
)?1:0,
|
||||
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->contact->lire)
|
||||
|| ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read)
|
||||
|| ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)),
|
||||
'module'=>'facture|supplier_invoice|don|tax|salaries|loan'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Compta',
|
||||
'link' => '/compta/index.php?mainmenu=billing&leftmenu=',
|
||||
'title' => "MenuFinancial",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->facture->enabled) ||
|
||||
! empty($conf->don->enabled) ||
|
||||
! empty($conf->tax->enabled) ||
|
||||
! empty($conf->salaries->enabled) ||
|
||||
! empty($conf->supplier_invoice->enabled) ||
|
||||
! empty($conf->loan->enabled)
|
||||
)?1:0,
|
||||
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->contact->lire)
|
||||
|| ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read)
|
||||
|| ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)),
|
||||
'module'=>'facture|supplier_invoice|don|tax|salaries|loan',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "billing",
|
||||
'leftmenu' => '',
|
||||
@ -309,20 +288,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Bank
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)),
|
||||
'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)),
|
||||
'module'=>'banque|prelevement'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Bank',
|
||||
'link' => '/compta/bank/list.php?mainmenu=bank&leftmenu=',
|
||||
'title' => "MenuBankCash",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)),
|
||||
'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)),
|
||||
'module'=>'banque|prelevement',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "bank",
|
||||
'leftmenu' => '',
|
||||
@ -339,20 +315,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Accounting
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->asset->enabled)),
|
||||
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)),
|
||||
'comptabilite|accounting|asset'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Accounting',
|
||||
'link' => '/accountancy/index.php?mainmenu=accountancy&leftmenu=',
|
||||
'title' => "MenuAccountancy",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->asset->enabled)),
|
||||
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)),
|
||||
'comptabilite|accounting',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "accountancy",
|
||||
'leftmenu' => '',
|
||||
@ -369,20 +342,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// HRM
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->hrm->enabled) || ! empty($conf->holiday->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled)),
|
||||
'perms'=>(! empty($user->rights->hrm->employee->read) || ! empty($user->rights->holiday->write) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->expensereport->lire)),
|
||||
'module'=>'hrm|holiday|deplacement|expensereport'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'HRM',
|
||||
'link' => '/hrm/index.php?mainmenu=hrm&leftmenu=',
|
||||
'title' => "HRM",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->hrm->enabled) || ! empty($conf->holiday->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled)),
|
||||
'perms'=>(! empty($user->rights->hrm->employee->read) || ! empty($user->rights->holiday->write) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->expensereport->lire)),
|
||||
'module'=>'hrm|holiday|deplacement|expensereport',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "hrm",
|
||||
'leftmenu' => '',
|
||||
@ -399,20 +369,17 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
);
|
||||
|
||||
// Tools
|
||||
$tmpentry = array(
|
||||
'enabled'=>1,
|
||||
'perms'=>1,
|
||||
'module'=>''
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Tools',
|
||||
'link' => '/core/tools.php?mainmenu=tools&leftmenu=',
|
||||
'title' => "Tools",
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = isVisibleToUserType(
|
||||
$type_user,
|
||||
$tmpentry = array(
|
||||
'enabled'=>1,
|
||||
'perms'=>1,
|
||||
'module'=>'',
|
||||
),
|
||||
$listofmodulesforexternal
|
||||
),
|
||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||
'target' => $atarget,
|
||||
'mainmenu' => "tools",
|
||||
'leftmenu' => '',
|
||||
@ -641,7 +608,7 @@ function print_end_menu_array()
|
||||
*/
|
||||
function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc;
|
||||
|
||||
//var_dump($tabMenu);
|
||||
|
||||
@ -1184,7 +1151,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
{
|
||||
$langs->load("companies");
|
||||
|
||||
// Accounting Expert
|
||||
// Accounting (Double entries)
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$langs->load("accountancy");
|
||||
@ -1335,42 +1302,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
}
|
||||
}
|
||||
|
||||
// Accountancy (simple)
|
||||
if (! empty($conf->comptabilite->enabled))
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
// Bilan, resultats
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
||||
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
|
||||
/* On verra ca avec module compabilite expert
|
||||
$newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire);
|
||||
*/
|
||||
$newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire);
|
||||
|
||||
/*
|
||||
$newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire);
|
||||
if (! empty($conf->propal->enabled)) {
|
||||
$newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire);
|
||||
}
|
||||
*/
|
||||
$newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire);
|
||||
|
||||
// Journaux
|
||||
$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50);
|
||||
$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51);
|
||||
}
|
||||
//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
}
|
||||
|
||||
// Configuration
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) {
|
||||
@ -1402,18 +1333,54 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 120);
|
||||
$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 130);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Accountancy (simple)
|
||||
if (! empty($conf->comptabilite->enabled))
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
// Bilan, resultats
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
||||
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
|
||||
/* On verra ca avec module compabilite expert
|
||||
$newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire);
|
||||
*/
|
||||
$newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire);
|
||||
|
||||
/*
|
||||
$newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire);
|
||||
if (! empty($conf->propal->enabled)) {
|
||||
$newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire);
|
||||
}
|
||||
*/
|
||||
$newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire);
|
||||
|
||||
// Journaux
|
||||
$newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50);
|
||||
$newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51);
|
||||
}
|
||||
//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
}
|
||||
|
||||
// Assets
|
||||
if (! empty($conf->asset->enabled))
|
||||
{
|
||||
$langs->load("assets");
|
||||
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset');
|
||||
$newmenu->add("/asset/card.php?action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write);
|
||||
$newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write);
|
||||
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
|
||||
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type');
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) {
|
||||
$newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write);
|
||||
$newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->configurer);
|
||||
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read);
|
||||
}
|
||||
}
|
||||
@ -1638,7 +1605,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$tmpentry = array(
|
||||
'enabled'=>(! empty($conf->projet->enabled)),
|
||||
'perms'=>(! empty($user->rights->projet->lire)),
|
||||
'module'=>'projet',
|
||||
'module'=>'projet'
|
||||
);
|
||||
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -35,7 +36,7 @@ class mod_bom_advanced extends ModeleNumRefboms
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
@ -57,11 +58,11 @@ class mod_bom_advanced extends ModeleNumRefboms
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -31,7 +31,7 @@ class mod_bom_standard extends ModeleNumRefboms
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -32,7 +33,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
@ -51,11 +52,11 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -75,7 +75,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
@ -379,7 +379,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
|
||||
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -31,7 +31,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -35,7 +36,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
@ -57,11 +58,11 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -68,7 +68,7 @@ class pdf_strato extends ModelePDFContract
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -31,7 +32,7 @@ class mod_contract_magre extends ModelNumRefContracts
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
@ -61,11 +62,11 @@ class mod_contract_magre extends ModelNumRefContracts
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$langs, $db;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -54,7 +54,7 @@ class mod_contract_olive extends ModelNumRefContracts
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -31,7 +32,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
@ -59,11 +60,11 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
@ -30,7 +30,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
|
||||
/**
|
||||
* Issuer
|
||||
* @var Company object that emits
|
||||
* @var Societe
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
@ -326,7 +326,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
|
||||
|
||||
|
||||
$tab_top = 95;
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
@ -767,11 +767,10 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$pdf->MultiCell(80, 4, $expense_receiver, 0, 'L');
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient
|
||||
$posy=50;
|
||||
$posx=10;
|
||||
$posx=100;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
@ -1054,18 +1053,18 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$pdf->SetXY($tab3_posx+17, $tab3_top+$y);
|
||||
$pdf->MultiCell(15, 3, price($totalpaid), 0, 'R', 0);
|
||||
$pdf->SetXY($tab3_posx+35, $tab3_top+$y);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->trans("AlreadyPaid"), 0, 'L', 0);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AlreadyPaid"), 0, 'L', 0);
|
||||
$y+=$tab3_height-2;
|
||||
$pdf->SetXY($tab3_posx+17, $tab3_top+$y);
|
||||
$pdf->MultiCell(15, 3, price($object->total_ttc), 0, 'R', 0);
|
||||
$pdf->SetXY($tab3_posx+35, $tab3_top+$y);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->trans("AmountExpected"), 0, 'L', 0);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AmountExpected"), 0, 'L', 0);
|
||||
$y+=$tab3_height-2;
|
||||
$remaintopay = $object->total_ttc - $totalpaid;
|
||||
$pdf->SetXY($tab3_posx+17, $tab3_top+$y);
|
||||
$pdf->MultiCell(15, 3, price($remaintopay), 0, 'R', 0);
|
||||
$pdf->SetXY($tab3_posx+35, $tab3_top+$y);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->trans("RemainderToPay"), 0, 'L', 0);
|
||||
$pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -30,7 +30,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ set_time_limit(0);
|
||||
class ExportCsv extends ModeleExports
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string ID ex: csv, tsv, excel...
|
||||
*/
|
||||
public $id;
|
||||
|
||||
@ -46,7 +46,7 @@ class ExportCsv extends ModeleExports
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
class ExportExcel extends ModeleExports
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
@ -46,7 +46,7 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
class ExportExcel2007 extends ExportExcel
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
@ -47,7 +47,7 @@ class ExportExcel2007 extends ExportExcel
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
class ExportExcel2007new extends ModeleExports
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
@ -48,7 +48,7 @@ class ExportExcel2007new extends ModeleExports
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php';
|
||||
class ExportTsv extends ModeleExports
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
* @var string ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
@ -45,7 +45,7 @@ class ExportTsv extends ModeleExports
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
||||
{
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
* @var string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user