Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
5256229089
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -70,6 +71,10 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_valu
|
||||
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
|
||||
print '<br>';
|
||||
|
||||
$head = ecm_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'ecm', $langs->trans("ECM"), -1, 'ecm');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
|
||||
123
htdocs/admin/ecm_directories_extrafields.php
Normal file
123
htdocs/admin/ecm_directories_extrafields.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/ecm_directories_extrafields.php
|
||||
* \ingroup ecm
|
||||
* \brief Page to setup extra fields of ecm
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'other', 'ecm'));
|
||||
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = array('');
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'ecm_directories'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("ECM");
|
||||
|
||||
llxHeader('', $langs->trans("ECMSetup"));
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = ecm_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM"), -1, 'ecm');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
123
htdocs/admin/ecm_files_extrafields.php
Normal file
123
htdocs/admin/ecm_files_extrafields.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/ecm_files_extrafields.php
|
||||
* \ingroup ecm
|
||||
* \brief Page to setup extra fields of ecm
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'other', 'ecm'));
|
||||
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = array('');
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'ecm_files'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("ECM");
|
||||
|
||||
llxHeader('', $langs->trans("ECMSetup"));
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head = ecm_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1, 'ecm');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -13,6 +13,7 @@
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* 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
|
||||
@ -2361,13 +2362,15 @@ if ($action == 'create')
|
||||
// Form to add new line
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines')
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
} else {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('orders', 'sendings', 'companies'));
|
||||
$langs->loadLangs(array('orders', 'sendings', 'companies', 'bills'));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
@ -37,7 +37,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'other'));
|
||||
$langs->loadLangs(array('companies', 'other', 'bills'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm');
|
||||
|
||||
@ -34,7 +34,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
if (!$user->rights->commande->lire) accessforbidden();
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('orders', 'sendings'));
|
||||
$langs->loadLangs(array('orders', 'sendings', 'bills'));
|
||||
|
||||
$socid = 0;
|
||||
$comid = GETPOST("id", 'int');
|
||||
|
||||
@ -55,6 +55,10 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist';
|
||||
|
||||
$search_datecloture_start = GETPOST('search_datecloture_start', 'int');
|
||||
if (empty($search_datecloture_start)) $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int'));
|
||||
$search_datecloture_end = GETPOST('search_datecloture_end', 'int');
|
||||
if (empty($search_datecloture_end)) $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int'));
|
||||
$search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_startmonth', 'int'), GETPOST('search_dateorder_startday', 'int'), GETPOST('search_dateorder_startyear', 'int'));
|
||||
$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_endmonth', 'int'), GETPOST('search_dateorder_endday', 'int'), GETPOST('search_dateorder_endyear', 'int'));
|
||||
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
|
||||
@ -230,6 +234,8 @@ if (empty($reshook))
|
||||
$toselect = '';
|
||||
$search_array_options = array();
|
||||
$search_categ_cus = 0;
|
||||
$search_datecloture_start = '';
|
||||
$search_datecloture_end = '';
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
|
||||
@ -336,6 +342,8 @@ if ($search_status <> '')
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_datecloture_start) $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
|
||||
if ($search_datecloture_end) $sql .= " AND c.date_cloture <= '".$db->idate($search_datecloture_end)."'";
|
||||
if ($search_dateorder_start) $sql .= " AND c.date_commande >= '".$db->idate($search_dateorder_start)."'";
|
||||
if ($search_dateorder_end) $sql .= " AND c.date_commande <= '".$db->idate($search_dateorder_end)."'";
|
||||
if ($search_datedelivery_start) $sql .= " AND c.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
|
||||
@ -439,6 +447,8 @@ if ($resql)
|
||||
if ($sall) $param .= '&sall='.urlencode($sall);
|
||||
if ($socid > 0) $param .= '&socid='.urlencode($socid);
|
||||
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
|
||||
if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
|
||||
if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
|
||||
if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start);
|
||||
if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end);
|
||||
if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
|
||||
@ -801,7 +811,13 @@ if ($resql)
|
||||
// Date cloture
|
||||
if (!empty($arrayfields['c.date_cloture']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datecloture_start ? $search_datecloture_start : -1, 'search_datecloture_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datecloture_end ? $search_datecloture_end : -1, 'search_datecloture_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Note public
|
||||
|
||||
@ -138,3 +138,38 @@ function ecm_prepare_head_fm($object)
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array head with list of tabs to view object informations.
|
||||
*
|
||||
* @return array head array with tabs
|
||||
*/
|
||||
function ecm_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
$langs->load("ecm");
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ecm.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$head[$h][2] = 'ecm';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsEcmFiles");
|
||||
$head[$h][2] = 'attributes_ecm_files';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories");
|
||||
$head[$h][2] = 'attributes_ecm_directories';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm_admin');
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm_admin', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2019 Lenin Rivas <lenin.rivas@servcom-it.com>
|
||||
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* 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
|
||||
@ -1315,7 +1316,11 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
{
|
||||
$libelleproduitservice = $desc."\n".$libelleproduitservice;
|
||||
} else {
|
||||
$libelleproduitservice .= $desc;
|
||||
if (!empty($conf->global->HIDE_LABEL_VARIANT_PDF) && $prodser->isVariant()) {
|
||||
$libelleproduitservice = $desc;
|
||||
} else {
|
||||
$libelleproduitservice .= $desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* Class to manage ECM directories
|
||||
*/
|
||||
class EcmDirectory // extends CommonObject
|
||||
class EcmDirectory extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
@ -35,7 +35,7 @@ class EcmDirectory // extends CommonObject
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
//public $table_element='ecm_directories';
|
||||
public $table_element='ecm_directories';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
@ -345,6 +345,10 @@ class EcmDirectory // extends CommonObject
|
||||
$this->date_m = $this->db->jdate($obj->date_m);
|
||||
}
|
||||
|
||||
// Retrieve all extrafields for ecm_files
|
||||
// fetch optionals attributes and labels
|
||||
$this->fetch_optionals();
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
return $obj ? 1 : 0;
|
||||
|
||||
@ -403,9 +403,9 @@ class EcmFiles extends CommonObject
|
||||
$this->src_object_id = $obj->src_object_id;
|
||||
}
|
||||
|
||||
// Retrieve all extrafields for invoice
|
||||
// Retrieve all extrafields for ecm_files
|
||||
// fetch optionals attributes and labels
|
||||
// $this->fetch_optionals();
|
||||
$this->fetch_optionals();
|
||||
|
||||
// $this->fetch_lines();
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('ecm', 'companies', 'other'));
|
||||
@ -204,6 +205,16 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha'))
|
||||
// Fetch was already done
|
||||
$ecmdir->label = dol_sanitizeFileName(GETPOST("label"));
|
||||
$ecmdir->description = GETPOST("description");
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $ecmdir);
|
||||
if ($ret < 0) $error++;
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $ecmdir->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$result = $ecmdir->update($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -266,6 +277,10 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha'))
|
||||
$form = new Form($db);
|
||||
|
||||
$object = new EcmDirectory($db); // Need to create a new one instance
|
||||
$extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
|
||||
if ($module == 'ecm')
|
||||
{
|
||||
@ -415,6 +430,7 @@ print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
|
||||
print dol_print_size($totalsize);
|
||||
print '</td></tr>';
|
||||
print $object->showOptionals($extrafields, ($action == 'edit' ? 'edit' : 'view'));
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'edit')
|
||||
|
||||
@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal', 'bills', 'contracts', 'categories'));
|
||||
@ -94,6 +95,10 @@ $filepathtodocument = $relativetodocument.$file->label;
|
||||
|
||||
// Try to load object from index
|
||||
$object = new ECMFiles($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$result = $object->fetch(0, '', $filepathtodocument);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -148,7 +153,6 @@ if ($action == 'update')
|
||||
|
||||
// Now we update index of file
|
||||
$db->begin();
|
||||
|
||||
//print $oldfile.' - '.$newfile;
|
||||
if ($newlabel != $oldlabel)
|
||||
{
|
||||
@ -181,6 +185,16 @@ if ($action == 'update')
|
||||
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
// Call update to set the share key
|
||||
$result = $object->update($user);
|
||||
if ($result < 0)
|
||||
@ -365,8 +379,9 @@ if (!empty($object->share))
|
||||
print '<input type="checkbox" name="shareenabled"'.($object->share ? ' checked="checked"' : '').' /> ';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print $object->showOptionals($extrafields, ($action == 'edit'?'edit':'view'));
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -105,28 +105,28 @@ ALTER TABLE llx_c_incoterms ADD COLUMN label varchar(100) NULL;
|
||||
|
||||
|
||||
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
entity INTEGER DEFAULT 1 NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
qty integer DEFAULT 1 NOT NULL,
|
||||
fk_soc integer,
|
||||
fk_project integer,
|
||||
fk_user_recruiter integer,
|
||||
fk_user_supervisor integer,
|
||||
fk_establishment integer,
|
||||
date_planned date,
|
||||
remuneration_suggested varchar(255),
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
last_main_doc varchar(255),
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
entity INTEGER DEFAULT 1 NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
qty integer DEFAULT 1 NOT NULL,
|
||||
fk_soc integer,
|
||||
fk_project integer,
|
||||
fk_user_recruiter integer,
|
||||
fk_user_supervisor integer,
|
||||
fk_establishment integer,
|
||||
date_planned date,
|
||||
remuneration_suggested varchar(255),
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
last_main_doc varchar(255),
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
status smallint NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -160,24 +160,24 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
fk_recruitmentjobposition INTEGER NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
status smallint NOT NULL,
|
||||
firstname varchar(128),
|
||||
fk_recruitmentjobposition INTEGER NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
status smallint NOT NULL,
|
||||
firstname varchar(128),
|
||||
lastname varchar(128),
|
||||
email varchar(255),
|
||||
phone varchar(64),
|
||||
date_birth date,
|
||||
remuneration_requested integer,
|
||||
remuneration_requested integer,
|
||||
remuneration_proposed integer,
|
||||
email_msgid varchar(255),
|
||||
fk_recruitment_origin INTEGER NULL
|
||||
@ -272,8 +272,8 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitme
|
||||
|
||||
ALTER TABLE llx_product MODIFY COLUMN seuil_stock_alerte float;
|
||||
ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
|
||||
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
|
||||
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
|
||||
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
|
||||
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL;
|
||||
|
||||
@ -331,5 +331,24 @@ ALTER TABLE llx_bank ADD COLUMN import_key varchar(14);
|
||||
|
||||
ALTER TABLE llx_menu MODIFY COLUMN enabled text;
|
||||
|
||||
CREATE TABLE llx_ecm_files_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
|
||||
|
||||
CREATE TABLE llx_ecm_directories_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
|
||||
ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255);
|
||||
ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
|
||||
@ -0,0 +1,26 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
CREATE TABLE llx_ecm_directories_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
|
||||
26
htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
Normal file
26
htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
CREATE TABLE llx_ecm_files_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -50,3 +50,6 @@ ReSyncListOfDir=Resync list of directories
|
||||
HashOfFileContent=Hash of file content
|
||||
NoDirectoriesFound=No directories found
|
||||
FileNotYetIndexedInDatabase=File not yet indexed into database (try to re-upload it)
|
||||
ExtraFieldsEcmFiles=Extrafields Ecm Files
|
||||
ExtraFieldsEcmDirectories=Extrafields Ecm Directories
|
||||
ECMSetup=ECM Setup
|
||||
|
||||
Loading…
Reference in New Issue
Block a user