Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b33e59dd66
@ -193,10 +193,18 @@ function societe_admin_prepare_head($object)
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsContacts");
|
||||
$head[$h][2] = 'attributes_contacts';
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin','remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -226,3 +226,15 @@ ALTER TABLE llx_propaldet MODIFY COLUMN localtax2_type varchar(1);
|
||||
-- END TASK #204
|
||||
|
||||
ALTER TABLE llx_menu MODIFY COLUMN enabled varchar(255) NULL default '1';
|
||||
|
||||
|
||||
create table llx_socpeople_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_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
||||
|
||||
|
||||
20
htdocs/install/mysql/tables/llx_socpeople_extrafields.key.sql
Executable file
20
htdocs/install/mysql/tables/llx_socpeople_extrafields.key.sql
Executable file
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
||||
26
htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
Executable file
26
htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
Executable file
@ -0,0 +1,26 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
create table llx_socpeople_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -895,6 +895,8 @@ MAIN_PROXY_USER=Login to use the proxy server
|
||||
MAIN_PROXY_PASS=Password to use the proxy server
|
||||
DefineHereComplementaryAttributes=Define here all atributes, not already available by default, and that you want to be supported for %s.
|
||||
ExtraFields=Complementary attributes
|
||||
ExtraFieldsThirdParties=Complementary attributes (thirdparty)
|
||||
ExtraFieldsContacts=Complementary attributes (contact/address)
|
||||
ExtraFieldHasWrongValue=Attribut %s has a wrong value.
|
||||
AlphaNumOnlyCharsAndNoSpace=only alphanumericals characters without space
|
||||
SendingMailSetup=Setup of sendings by email
|
||||
|
||||
@ -6,7 +6,7 @@ ErrorSetACountryFirst=Set the country first
|
||||
SelectThirdParty=Select a third party
|
||||
DeleteThirdParty=Delete a third party
|
||||
ConfirmDeleteCompany=Are you sure you want to delete this company and all inherited information ?
|
||||
DeleteContact=Delete a contact
|
||||
DeleteContact=Delete a contact/address
|
||||
ConfirmDeleteContact=Are you sure you want to delete this contact and all inherited information ?
|
||||
MenuNewThirdParty=New third party
|
||||
MenuNewCompany=New company
|
||||
@ -24,10 +24,10 @@ SocGroup=Group of companies
|
||||
IdThirdParty=Id third party
|
||||
IdCompany=Company Id
|
||||
IdContact=Contact Id
|
||||
Contacts=Contacts
|
||||
Contacts=Contacts/Addresses
|
||||
ThirdPartyContacts=Third party contacts
|
||||
ThirdPartyContact=Third party contact
|
||||
StatusContactValidated=Status of contact
|
||||
ThirdPartyContact=Third party contact/address
|
||||
StatusContactValidated=Status of contact/address
|
||||
Company=Company
|
||||
CompanyName=Company name
|
||||
Companies=Companies
|
||||
@ -254,7 +254,7 @@ EditContactAddress=Edit contact/address
|
||||
Contact=Contact
|
||||
ContactsAddresses=Contacts/Addresses
|
||||
NoContactDefined=No contact defined for this third party
|
||||
DefaultContact=Default contact
|
||||
DefaultContact=Default contact/address
|
||||
AddCompany=Add company
|
||||
AddThirdParty=Add third party
|
||||
DeleteACompany=Delete a company
|
||||
|
||||
@ -904,6 +904,8 @@ MAIN_PROXY_USER=Login pour passer le serveur proxy mandataire
|
||||
MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire
|
||||
DefineHereComplementaryAttributes=Définissez ici la liste des attributs supplémentaires, non disponibles en standard, et que vous voulez voir gérer sur les %s.
|
||||
ExtraFields=Attributs suplémentaires
|
||||
ExtraFieldsThirdParties=Attributs suplémentaires (tiers)
|
||||
ExtraFieldsContacts=Attributs suplémentaires (contacts/adresses)
|
||||
ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte.
|
||||
AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace
|
||||
SendingMailSetup=Configuration de l'envoi par mail
|
||||
|
||||
212
htdocs/societe/admin/contact_extrafields.php
Executable file
212
htdocs/societe/admin/contact_extrafields.php
Executable file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/societe/admin/contact_extrafields.php
|
||||
* \ingroup societe
|
||||
* \brief Page to setup extra fields of contact
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("admin");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='contact';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("ContactsAddresses");
|
||||
|
||||
$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers';
|
||||
llxHeader('',$langs->trans("CompanySetup"),$help_url);
|
||||
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = societe_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), 0, 'company');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
foreach($extrafields->attribute_type as $key => $value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||
print "<td>".$key."</td>\n";
|
||||
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans('NewAttribute'));
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table summary="listofattributes" class="border" width="100%">';
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.GETPOST('label').'"></td></tr>';
|
||||
// Code
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')</td><td class="valeur"><input type="text" name="attrname" size="10" value="'.GETPOST('attrname').'"></td></tr>';
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td><td class="valeur">';
|
||||
print $form->selectarray('type',$type2label,GETPOST('type'));
|
||||
print '</td></tr>';
|
||||
// Size
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td><input type="text" name="size" size="5" value="'.(GETPOST('size')?GETPOST('size'):'255').'"></td></tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<center><br><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$attrname.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$attrname.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table summary="listofattributes" class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$attrname].'"></td>';
|
||||
print '</tr>';
|
||||
// Code
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td class="valeur">'.$attrname.' </td>';
|
||||
print '</tr>';
|
||||
// Type
|
||||
$type=$extrafields->attribute_type[$attrname];
|
||||
$size=$extrafields->attribute_size[$attrname];
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $type2label[$type];
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
print '</td></tr>';
|
||||
// Size
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td class="valeur"><input type="text" name="size" size="5" value="'.$size.'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user