mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge remote-tracking branch 'upstream/develop' into Squiz.Scope.MethodScope.Missing
This commit is contained in:
commit
5a4ac82880
137
htdocs/accountancy/admin/closure.php
Normal file
137
htdocs/accountancy/admin/closure.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.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/closure.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","admin","accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
|
||||
$list_account_main = array (
|
||||
'ACCOUNTING_RESULT_PROFIT',
|
||||
'ACCOUNTING_RESULT_LOSS'
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
$defaultjournal = GETPOST('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', 'alpha');
|
||||
|
||||
if (! empty($defaultjournal)) {
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', $defaultjournal, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
}
|
||||
|
||||
foreach ($list_account_main as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$linkback = '';
|
||||
print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy');
|
||||
|
||||
print $langs->trans("DefaultClosureDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
// Define main accounts for closure
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
foreach ($list_account_main as $key) {
|
||||
|
||||
print '<tr class="oddeven value">';
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
$keydesc=$key.'_Desc';
|
||||
|
||||
$htmltext = $langs->trans($keydesc);
|
||||
print '<td class="fieldrequired" width="50%">';
|
||||
print $form->textwithpicto($label, $htmltext);
|
||||
print '</td>';
|
||||
// Value
|
||||
print '<td>'; // Do not force align=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Journal
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="50%">' . $langs->trans("ACCOUNTING_CLOSURE_DEFAULT_JOURNAL") . '</td>';
|
||||
print '<td>';
|
||||
$defaultjournal=$conf->global->ACCOUNTING_CLOSURE_DEFAULT_JOURNAL;
|
||||
print $formaccounting->select_journal($defaultjournal, "ACCOUNTING_CLOSURE_DEFAULT_JOURNAL", 9, 1, 0, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
|
|
@ -144,6 +144,18 @@ if ($action == 'setenabledraftexport') {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'setenablesubsidiarylist') {
|
||||
$setenablesubsidiarylist = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
|
@ -251,6 +263,19 @@ if (! empty($user->admin))
|
|||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ if (empty($reshook))
|
|||
$object->skype = trim(GETPOST("skype", 'alpha'));
|
||||
$object->twitter = trim(GETPOST("twitter", 'alpha'));
|
||||
$object->facebook = trim(GETPOST("facebook", 'alpha'));
|
||||
$object->linkedin = trim(GETPOST("linkedin", 'alpha'));
|
||||
$object->birth = $birthdate;
|
||||
|
||||
$object->typeid = GETPOST("typeid", 'int');
|
||||
|
|
@ -450,6 +451,7 @@ if (empty($reshook))
|
|||
$skype=GETPOST("member_skype", 'alpha');
|
||||
$twitter=GETPOST("member_twitter", 'alpha');
|
||||
$facebook=GETPOST("member_facebook", 'alpha');
|
||||
$linkedin=GETPOST("member_linkedin", 'alpha');
|
||||
$email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
||||
$login=GETPOST("member_login", 'alpha');
|
||||
$pass=GETPOST("password", 'alpha');
|
||||
|
|
@ -479,6 +481,7 @@ if (empty($reshook))
|
|||
$object->skype = $skype;
|
||||
$object->twitter = $twitter;
|
||||
$object->facebook = $facebook;
|
||||
$object->linkedin = $linkedin;
|
||||
|
||||
$object->email = $email;
|
||||
$object->login = $login;
|
||||
|
|
@ -1029,6 +1032,12 @@ else
|
|||
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="member_facebook" size="40" value="'.(GETPOST('member_facebook', 'alpha')?GETPOST('member_facebook', 'alpha'):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
|
||||
// LinkedIn
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="member_linkedin" size="40" value="'.(GETPOST('member_linkedin', 'alpha')?GETPOST('member_linkedin', 'alpha'):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
|
||||
|
|
@ -1281,10 +1290,16 @@ else
|
|||
}
|
||||
|
||||
// Facebook
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="facebook" class="minwidth100" value="'.(isset($_POST["facebook"])?GETPOST("facebook"):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="facebook" class="minwidth100" value="'.(isset($_POST["facebook"])?GETPOST("facebook"):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
|
||||
// LinkedIn
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="linkedin" class="minwidth100" value="'.(isset($_POST["linkedin"])?GETPOST("linkedin"):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
|
|
|
|||
|
|
@ -137,6 +137,11 @@ class Adherent extends CommonObject
|
|||
*/
|
||||
public $facebook;
|
||||
|
||||
/**
|
||||
* @var string linkedin account
|
||||
*/
|
||||
public $linkedin;
|
||||
|
||||
/**
|
||||
* @var string Phone number
|
||||
*/
|
||||
|
|
@ -550,6 +555,7 @@ class Adherent extends CommonObject
|
|||
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
|
||||
$sql.= ", twitter = '".$this->db->escape($this->twitter)."'";
|
||||
$sql.= ", facebook = '".$this->db->escape($this->facebook)."'";
|
||||
$sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'";
|
||||
$sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null");
|
||||
$sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||
$sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||
|
|
@ -660,6 +666,7 @@ class Adherent extends CommonObject
|
|||
$luser->skype=$this->skype;
|
||||
$luser->twitter=$this->twitter;
|
||||
$luser->facebook=$this->facebook;
|
||||
$luser->linkedin=$this->linkedin;
|
||||
$luser->office_phone=$this->phone;
|
||||
$luser->user_mobile=$this->phone_mobile;
|
||||
|
||||
|
|
@ -701,6 +708,7 @@ class Adherent extends CommonObject
|
|||
$lthirdparty->skype=$this->skype;
|
||||
$lthirdparty->twitter=$this->twitter;
|
||||
$lthirdparty->facebook=$this->facebook;
|
||||
$lthirdparty->linkedin=$this->linkedin;
|
||||
$lthirdparty->phone=$this->phone;
|
||||
$lthirdparty->state_id=$this->state_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
|
|
@ -1189,7 +1197,7 @@ class Adherent extends CommonObject
|
|||
|
||||
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.gender, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
|
||||
$sql.= " d.note_public,";
|
||||
$sql.= " d.email, d.skype, d.twitter, d.facebook, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
|
||||
$sql.= " d.email, d.skype, d.twitter, d.facebook, d.linkedin, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
|
||||
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
||||
$sql.= " d.datec as datec,";
|
||||
$sql.= " d.tms as datem,";
|
||||
|
|
@ -1266,6 +1274,7 @@ class Adherent extends CommonObject
|
|||
$this->skype = $obj->skype;
|
||||
$this->twitter = $obj->twitter;
|
||||
$this->facebook = $obj->facebook;
|
||||
$this->linkedin = $obj->linkedin;
|
||||
|
||||
$this->photo = $obj->photo;
|
||||
$this->statut = $obj->statut;
|
||||
|
|
@ -2362,6 +2371,7 @@ class Adherent extends CommonObject
|
|||
$this->skype = 'skypepseudo';
|
||||
$this->twitter = 'twitterpseudo';
|
||||
$this->facebook = 'facebookpseudo';
|
||||
$this->linkedin = 'linkedinpseudo';
|
||||
$this->phone = '0999999999';
|
||||
$this->phone_perso = '0999999998';
|
||||
$this->phone_mobile = '0999999997';
|
||||
|
|
@ -2469,8 +2479,9 @@ class Adherent extends CommonObject
|
|||
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
|
||||
if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype;
|
||||
if ($this->twitter && ! empty($conf->global->LDAP_MEMBER_FIELD_TWITTER)) $info[$conf->global->LDAP_MEMBER_FIELD_TWITTER] = $this->twitter;
|
||||
if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook;
|
||||
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
||||
if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook;
|
||||
if ($this->linkedin && ! empty($conf->global->LDAP_MEMBER_FIELD_LINKEDIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LINKEDIN] = $this->linkedin;
|
||||
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
||||
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
|
||||
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
|
||||
if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
|
|
@ -96,7 +97,7 @@ dol_fiche_head($head, 'setup', '', 0, 'user');
|
|||
|
||||
print '<br>';
|
||||
|
||||
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
|
||||
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook', 'linkedin'=>'LinkedIn');
|
||||
|
||||
foreach($arrayofsocialnetworks as $snkey => $snlabel) {
|
||||
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||
$object=new BillOfMaterials($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomcard','globalcard')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
|
@ -88,7 +88,7 @@ $search_all=trim(GETPOST("search_all", 'alpha'));
|
|||
$search=array();
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
|
||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
|
||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ $langs->loadLangs(array("bom@bom","companies","other","mails"));
|
|||
|
||||
|
||||
$action=GETPOST('action', 'aZ09');
|
||||
$confirm=GETPOST('confirm');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ if (! $sortfield) $sortfield="name";
|
|||
$object=new BillOfMaterials($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomdocument','globalcard')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('bom');
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||
dol_include_once('/bom/class/bom.class.php');
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bom@bom","other"));
|
||||
$langs->loadLangs(array("bom@bom", "other"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
|
|
@ -333,7 +333,7 @@ $arrayofmassactions = array(
|
|||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->bom->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
|
@ -482,9 +482,9 @@ while ($i < min($num, $limit))
|
|||
print '<tr class="oddeven">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$cssforfield='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||
$cssforfield='';
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||
elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ function bomPrepareHead($object)
|
|||
//); // to add new tab
|
||||
//$this->tabs = array(
|
||||
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
|
||||
//); // to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@bom');
|
||||
//); // to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@bom');
|
||||
|
||||
return $head;
|
||||
return $head;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ if (empty($reshook))
|
|||
$object->skype = GETPOST("skype", 'alpha');
|
||||
$object->twitter = GETPOST("twitter", 'alpha');
|
||||
$object->facebook = GETPOST("facebook", 'alpha');
|
||||
$object->linkedin = GETPOST("linkedin", 'alpha');
|
||||
$object->email = GETPOST("email", 'alpha');
|
||||
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
||||
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
||||
|
|
@ -362,6 +363,7 @@ if (empty($reshook))
|
|||
$object->skype = GETPOST("skype", 'alpha');
|
||||
$object->twitter = GETPOST("twitter", 'alpha');
|
||||
$object->facebook = GETPOST("facebook", 'alpha');
|
||||
$object->linkedin = GETPOST("linkedin", 'alpha');
|
||||
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
||||
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
||||
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
|
||||
|
|
@ -698,6 +700,12 @@ else
|
|||
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
// LinkedIn
|
||||
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
|
||||
{
|
||||
print '<tr><td><label for="linkedin">'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="linkedin" id="linkedin" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Visibility
|
||||
|
|
@ -979,11 +987,17 @@ else
|
|||
print '<td><input type="text" name="twitter" id="twitter" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("twitter")?GETPOST("twitter", 'alpha'):$object->twitter).'"></td></tr>';
|
||||
}
|
||||
// Facebook
|
||||
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
||||
{
|
||||
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
|
||||
print '<td><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
||||
{
|
||||
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
|
||||
print '<td><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
|
||||
}
|
||||
// LinkedIn
|
||||
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
|
||||
{
|
||||
print '<tr><td><label for="linkedin">'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</label></td>';
|
||||
print '<td><input type="text" name="linkedin" id="linkedin" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Visibility
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ class Contact extends CommonObject
|
|||
$sql .= ", skype='".$this->db->escape($this->skype)."'";
|
||||
$sql .= ", twitter='".$this->db->escape($this->twitter)."'";
|
||||
$sql .= ", facebook='".$this->db->escape($this->facebook)."'";
|
||||
$sql .= ", linkedin='".$this->db->escape($this->linkedin)."'";
|
||||
$sql .= ", photo='".$this->db->escape($this->photo)."'";
|
||||
$sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
|
||||
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
|
||||
|
|
@ -455,6 +456,11 @@ class Contact extends CommonObject
|
|||
$tmpobj->facebook = $this->facebook;
|
||||
$usermustbemodified++;
|
||||
}
|
||||
if ($tmpobj->linkedin != $this->linkedin)
|
||||
{
|
||||
$tmpobj->linkedin = $this->linkedin;
|
||||
$usermustbemodified++;
|
||||
}
|
||||
if ($usermustbemodified)
|
||||
{
|
||||
$result=$tmpobj->update($user, 0, 1, 1, 1);
|
||||
|
|
@ -705,7 +711,7 @@ class Contact extends CommonObject
|
|||
$sql.= " c.fk_pays as country_id,";
|
||||
$sql.= " c.fk_departement,";
|
||||
$sql.= " c.birthday,";
|
||||
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook,";
|
||||
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook, c.linkedin,";
|
||||
$sql.= " c.photo,";
|
||||
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
|
||||
$sql.= " c.import_key,";
|
||||
|
|
@ -779,6 +785,7 @@ class Contact extends CommonObject
|
|||
$this->skype = $obj->skype;
|
||||
$this->twitter = $obj->twitter;
|
||||
$this->facebook = $obj->facebook;
|
||||
$this->linkedin = $obj->linkedin;
|
||||
$this->photo = $obj->photo;
|
||||
$this->priv = $obj->priv;
|
||||
$this->mail = $obj->email;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -68,9 +69,11 @@ $search_phone_pro=GETPOST("search_phone_pro", 'alpha');
|
|||
$search_phone_mobile=GETPOST("search_phone_mobile", 'alpha');
|
||||
$search_fax=GETPOST("search_fax", 'alpha');
|
||||
$search_email=GETPOST("search_email", 'alpha');
|
||||
$search_no_email=GETPOST("search_no_email", 'int');
|
||||
$search_skype=GETPOST("search_skype", 'alpha');
|
||||
$search_twitter=GETPOST("search_twitter", 'alpha');
|
||||
$search_facebook=GETPOST("search_facebook", 'alpha');
|
||||
$search_linkedin=GETPOST("search_linkedin", 'alpha');
|
||||
$search_priv=GETPOST("search_priv", 'alpha');
|
||||
$search_categ=GETPOST("search_categ", 'int');
|
||||
$search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int');
|
||||
|
|
@ -159,10 +162,12 @@ $arrayfields=array(
|
|||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||
'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(! empty($conf->mailing->enabled))),
|
||||
'p.jabberid'=>array('label'=>"Jabber", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.linkedin'=>array('label'=>"LinkedIn", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
|
||||
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
|
||||
|
|
@ -222,9 +227,11 @@ if (empty($reshook))
|
|||
$search_phone_mobile="";
|
||||
$search_fax="";
|
||||
$search_email="";
|
||||
$search_no_email=-1;
|
||||
$search_skype="";
|
||||
$search_twitter="";
|
||||
$search_facebook="";
|
||||
$search_linkedin="";
|
||||
$search_priv="";
|
||||
$search_status=-1;
|
||||
$search_categ='';
|
||||
|
|
@ -258,7 +265,7 @@ $contactstatic=new Contact($db);
|
|||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||
$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.skype,";
|
||||
$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email, p.skype,";
|
||||
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
|
||||
$sql.= " co.code as country_code";
|
||||
// Add fields from extrafields
|
||||
|
|
@ -321,10 +328,12 @@ if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
|
|||
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
|
||||
if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_twitter);
|
||||
if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook);
|
||||
if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_linkedin);
|
||||
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
|
||||
if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip);
|
||||
if (strlen($search_town)) $sql.= natural_search("p.town", $search_town);
|
||||
|
||||
if ($search_no_email != '' && $search_no_email >= 0) $sql.= " AND p.no_email = ".$db->escape($search_no_email);
|
||||
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
|
||||
if ($search_import_key) $sql.= natural_search("p.import_key", $search_import_key);
|
||||
if ($type == "o") // filtre sur type
|
||||
|
|
@ -422,6 +431,7 @@ if ($search_phone_perso != '') $param.='&search_phone_perso='.urlencode($sea
|
|||
if ($search_phone_mobile != '') $param.='&search_phone_mobile='.urlencode($search_phone_mobile);
|
||||
if ($search_fax != '') $param.='&search_fax='.urlencode($search_fax);
|
||||
if ($search_email != '') $param.='&search_email='.urlencode($search_email);
|
||||
if ($search_no_email != '') $param.='&search_no_email='.urlencode($search_no_email);
|
||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
|
||||
if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
|
||||
|
|
@ -607,6 +617,12 @@ if (! empty($arrayfields['p.email']['checked']))
|
|||
print '<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.no_email']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.skype']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
|
|
@ -625,6 +641,12 @@ if (! empty($arrayfields['p.facebook']['checked']))
|
|||
print '<input class="flat" type="text" name="search_facebook" size="6" value="'.dol_escape_htmltag($search_facebook).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.linkedin']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_linkedin" size="6" value="'.dol_escape_htmltag($search_linkedin).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
|
|
@ -696,9 +718,11 @@ if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field
|
|||
if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'],$_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'], $_SERVER["PHP_SELF"], "p.skype", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.linkedin']['checked'])) print_liste_field_titre($arrayfields['p.linkedin']['label'], $_SERVER["PHP_SELF"], "p.linkedin", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||
// Extra fields
|
||||
|
|
@ -839,7 +863,12 @@ while ($i < min($num, $limit))
|
|||
print '<td>'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// No EMail
|
||||
if (! empty($arrayfields['p.no_email']['checked']))
|
||||
{
|
||||
print '<td align="center">'.yn($obj->no_email).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Skype
|
||||
if (! empty($arrayfields['p.skype']['checked']))
|
||||
{
|
||||
|
|
@ -859,12 +888,18 @@ while ($i < min($num, $limit))
|
|||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Facebook
|
||||
if (! empty($arrayfields['p.facebook']['checked']))
|
||||
{
|
||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').'</td>'; }
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Company
|
||||
if (! empty($arrayfields['p.facebook']['checked']))
|
||||
{
|
||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').'</td>'; }
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// LinkedIn
|
||||
if (! empty($arrayfields['p.linkedin']['checked']))
|
||||
{
|
||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->linkedin, $obj->rowid, $obj->socid, 'linkedin').'</td>'; }
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Company
|
||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
|
|
|
|||
|
|
@ -89,21 +89,17 @@ class box_project extends ModeleBoxes
|
|||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$projectstatic = new Project($this->db);
|
||||
|
||||
$socid=$user->societe_id;
|
||||
$socid=0;
|
||||
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
|
||||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
$projectsListId='';
|
||||
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project').')';
|
||||
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
|
||||
if ($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
|
||||
$sql.= " WHERE p.fk_statut = 1"; // Only open projects
|
||||
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
|
||||
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
//$sql.= $db->plimit($max, 0);
|
||||
|
|
|
|||
|
|
@ -672,6 +672,8 @@ abstract class CommonObject
|
|||
$outdone++;
|
||||
if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook');
|
||||
$outdone++;
|
||||
if ($this->linkedin) $out.=dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
|
||||
$outdone++;
|
||||
}
|
||||
$out.='</div>';
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class ExtraFields
|
|||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var integer DB Error number
|
||||
* @var string DB Error number
|
||||
*/
|
||||
public $errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -4755,7 +4755,7 @@ class Form
|
|||
|
||||
$out='';
|
||||
$out.= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if ($useempty) $out .= '<option value=""></option>';
|
||||
if ($useempty) $out .= '<option value=""> </option>';
|
||||
// If company current currency not in table, we add it into list. Should always be available.
|
||||
if (! in_array($conf->currency, $TCurrency))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class FormAccounting extends Form
|
|||
$sql.= " FROM " . MAIN_DB_PREFIX . "accounting_journal";
|
||||
$sql.= " WHERE active = 1";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
//if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature;
|
||||
if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature;
|
||||
$sql.= " ORDER BY code";
|
||||
|
||||
dol_syslog(get_class($this) . "::select_journal", LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) - 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
/* Copyright (C) 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.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
|
||||
|
|
@ -291,17 +292,17 @@ class FormTicket
|
|||
|
||||
// Type
|
||||
print '<tr><td class="titlefield"><span class="fieldrequired"><label for="selecttype_code">' . $langs->trans("TicketTypeRequest") . '</span></label></td><td>';
|
||||
print $this->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $this->type_code), 'type_code', '', '2');
|
||||
$this->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $this->type_code), 'type_code', '', '2');
|
||||
print '</td></tr>';
|
||||
|
||||
// Severity
|
||||
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">' . $langs->trans("TicketSeverity") . '</span></label></td><td>';
|
||||
print $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2');
|
||||
$this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2');
|
||||
print '</td></tr>';
|
||||
|
||||
// Group
|
||||
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">' . $langs->trans("TicketGroup") . '</span></label></td><td>';
|
||||
print $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
|
||||
$this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
|
||||
print '</td></tr>';
|
||||
|
||||
// Notify thirdparty at creation
|
||||
|
|
|
|||
|
|
@ -2981,7 +2981,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||
if (empty($srconly) && in_array($pictowithoutext, array(
|
||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
|
||||
'jabber','skype','twitter','facebook'
|
||||
'jabber','skype','twitter','facebook','linkedin'
|
||||
)
|
||||
)) {
|
||||
$fa='fa';
|
||||
|
|
|
|||
|
|
@ -257,7 +257,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->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
|
||||
-- Accounting period
|
||||
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 && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
|
||||
-- Binding
|
||||
|
|
|
|||
|
|
@ -1077,6 +1077,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||
}
|
||||
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
|
||||
$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
|
||||
$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 70);
|
||||
|
||||
// Fiscal year
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class modBom extends DolibarrModules
|
|||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||
|
||||
// Module label (no space allowed), used if translation string 'ModuleBomName' not found (Bom is name of module).
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||
// Module description, used if translation string 'ModuleBomDesc' not found (Bom is name of module).
|
||||
$this->description = "Bill of Materials (BOM) definitions for Manufacturing Resource Planning";
|
||||
// Used only if file README.md and README-LL.md not found.
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
|
|||
$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
|
||||
print '<td';
|
||||
if ($align) print ' class="'.$align.'"';
|
||||
print '>';
|
||||
$tmpkey='options_'.$key;
|
||||
print ' data-key="'.$key.'"';
|
||||
print '>';
|
||||
$tmpkey='options_'.$key;
|
||||
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey))
|
||||
{
|
||||
$datenotinstring = $obj->$tmpkey;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
|
|||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) $sortonfield='';
|
||||
if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') print '<th class="liste_titre thseparator"></th>';
|
||||
else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
|
||||
else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder)."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,44 +219,46 @@ Class DataPolicy
|
|||
*/
|
||||
function sendMailDataPolicyCompany($societe)
|
||||
{
|
||||
global $langs, $conf, $db, $user;
|
||||
global $langs, $conf, $db, $user;
|
||||
|
||||
$error = 0;
|
||||
$error = 0;
|
||||
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
|
||||
$sendto = $societe->email;
|
||||
$sendto = $societe->email;
|
||||
|
||||
$code= md5($societe->email);
|
||||
if (!empty($societe->default_lang)) {
|
||||
$l = $societe->default_lang;
|
||||
} else {
|
||||
$l = $langs->defaultlang;
|
||||
}
|
||||
$s = "DATAPOLICIESSUBJECT_" . $l;
|
||||
$ma = "DATAPOLICIESCONTENT_" . $l;
|
||||
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
|
||||
$code= md5($societe->email);
|
||||
if (!empty($societe->default_lang)) {
|
||||
$l = $societe->default_lang;
|
||||
} else {
|
||||
$l = $langs->defaultlang;
|
||||
}
|
||||
$s = "DATAPOLICIESSUBJECT_" . $l;
|
||||
$ma = "DATAPOLICIESCONTENT_" . $l;
|
||||
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
|
||||
|
||||
$subject = $conf->global->$s;
|
||||
$message = $conf->global->$ma;
|
||||
$linka = $conf->global->$la;
|
||||
$linkr = $conf->global->$lr;
|
||||
$sendtocc = $sendtobcc = '';
|
||||
$filepath = $mimetype = $filename = array();
|
||||
$deliveryreceipt = 0;
|
||||
$subject = $conf->global->$s;
|
||||
$message = $conf->global->$ma;
|
||||
$linka = $conf->global->$la;
|
||||
$linkr = $conf->global->$lr;
|
||||
$sendtocc = $sendtobcc = '';
|
||||
$filepath = $mimetype = $filename = array();
|
||||
$deliveryreceipt = 0;
|
||||
|
||||
$substitutionarray = array(
|
||||
$substitutionarray = array(
|
||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
|
||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
|
||||
);
|
||||
$subject = make_substitutions($subject, $substitutionarray);
|
||||
$message = make_substitutions($message, $substitutionarray);
|
||||
);
|
||||
$subject = make_substitutions($subject, $substitutionarray);
|
||||
$message = make_substitutions($message, $substitutionarray);
|
||||
|
||||
$actiontypecode = 'AC_EMAIL';
|
||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||
if ($message) {
|
||||
if ($sendtocc) {
|
||||
$actiontypecode = 'AC_EMAIL';
|
||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc)
|
||||
{
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
}
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
|
|
@ -264,23 +266,23 @@ Class DataPolicy
|
|||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
|
||||
// Send mail
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
|
||||
} else {
|
||||
$result4 = $mailfile->sendfile();
|
||||
// Send mail
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
|
||||
} else {
|
||||
$result4 = $mailfile->sendfile();
|
||||
|
||||
if (!$error) {
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$societe->update($societe->id);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
setEventMessage($resultmasssend);
|
||||
if (!$error) {
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$societe->update($societe->id);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
setEventMessage($resultmasssend);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ if ($action == 'add')
|
|||
|
||||
if (! $error)
|
||||
{
|
||||
$object->fk_soc = GETPOST("fk_soc", 'int');
|
||||
$object->socid = GETPOST("socid", 'int');
|
||||
$object->firstname = GETPOST("firstname", 'alpha');
|
||||
$object->lastname = GETPOST("lastname", 'alpha');
|
||||
$object->societe = GETPOST("societe", 'alpha');
|
||||
|
|
@ -164,7 +164,7 @@ if ($action == 'add')
|
|||
$object->town = GETPOST("town", 'alpha');
|
||||
$object->country_id = GETPOST('country_id', 'int');
|
||||
$object->email = GETPOST('email', 'alpha');
|
||||
$object->date = $donation_date;
|
||||
$object->date = $donation_date;
|
||||
$object->note_private = GETPOST("note_private", 'none');
|
||||
$object->note_public = GETPOST("note_public", 'none');
|
||||
$object->public = GETPOST("public", 'alpha');
|
||||
|
|
@ -531,10 +531,10 @@ if (! empty($id) && $action == 'edit')
|
|||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) {
|
||||
if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) {
|
||||
|
||||
$company=new Societe($db);
|
||||
$result=$company->fetch($object->fk_soc);
|
||||
$result=$company->fetch($object->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
|
||||
} else {
|
||||
|
|
@ -693,10 +693,10 @@ if (! empty($id) && $action != 'edit')
|
|||
print yn($object->public);
|
||||
print '</td></tr>';
|
||||
|
||||
if ($object->fk_soc) {
|
||||
if ($object->socid) {
|
||||
|
||||
$company=new Societe($db);
|
||||
$result=$company->fetch($object->fk_soc);
|
||||
$result=$company->fetch($object->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class Donations extends DolibarrApi
|
|||
throw new RestException(404, 'Donation not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) {
|
||||
if( ! DolibarrApi::_checkAccessToResource('don', $this->don->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ class Don extends CommonObject
|
|||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".price2num($this->amount);
|
||||
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null");
|
||||
$sql.= ", '".$this->db->escape($this->fk_soc)."'";
|
||||
$sql.= ", '".$this->db->escape($this->socid)."'";
|
||||
$sql.= ", '".$this->db->escape($this->firstname)."'";
|
||||
$sql.= ", '".$this->db->escape($this->lastname)."'";
|
||||
$sql.= ", '".$this->db->escape($this->societe)."'";
|
||||
|
|
@ -645,7 +645,7 @@ class Don extends CommonObject
|
|||
global $conf;
|
||||
|
||||
$sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
|
||||
$sql.= " d.fk_soc,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
|
||||
$sql.= " d.fk_soc as socid,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
|
||||
$sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, ";
|
||||
$sql.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
|
||||
$sql.= " p.ref as project_ref,";
|
||||
|
|
@ -673,40 +673,42 @@ class Don extends CommonObject
|
|||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->date_valid = $this->db->jdate($obj->date_valid);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
$this->date = $this->db->jdate($obj->datedon);
|
||||
$this->fk_soc = $obj->fk_soc;
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->societe = $obj->societe;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->address = $obj->address;
|
||||
$this->town = $obj->town;
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->country_id = $obj->fk_country;
|
||||
$this->country_code = $obj->country_code;
|
||||
$this->country = $obj->country;
|
||||
$this->country_olddata= $obj->country_olddata; // deprecated
|
||||
$this->email = $obj->email;
|
||||
$this->phone = $obj->phone;
|
||||
$this->phone_mobile = $obj->phone_mobile;
|
||||
$this->project = $obj->project_ref;
|
||||
$this->fk_projet = $obj->fk_project; // deprecated
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->public = $obj->public;
|
||||
$this->modepaymentid = $obj->fk_payment;
|
||||
$this->modepaymentcode = $obj->payment_code;
|
||||
$this->modepayment = $obj->payment_label;
|
||||
$this->paid = $obj->paid;
|
||||
$this->amount = $obj->amount;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->date_validation = $this->db->jdate($obj->date_valid);
|
||||
$this->date_modification = $this->db->jdate($obj->datem);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
$this->date = $this->db->jdate($obj->datedon);
|
||||
$this->socid = $obj->socid;
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->societe = $obj->societe;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->address = $obj->address;
|
||||
$this->town = $obj->town;
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->country_id = $obj->fk_country;
|
||||
$this->country_code = $obj->country_code;
|
||||
$this->country = $obj->country;
|
||||
$this->country_olddata = $obj->country_olddata; // deprecated
|
||||
$this->email = $obj->email;
|
||||
$this->phone = $obj->phone;
|
||||
$this->phone_mobile = $obj->phone_mobile;
|
||||
$this->project = $obj->project_ref;
|
||||
$this->fk_projet = $obj->fk_project; // deprecated
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->public = $obj->public;
|
||||
$this->mode_reglement_id = $obj->fk_payment;
|
||||
$this->mode_reglement_code= $obj->payment_code;
|
||||
$this->mode_reglement = $obj->payment_label;
|
||||
$this->paid = $obj->paid;
|
||||
$this->amount = $obj->amount;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
|
||||
// Retreive all extrafield
|
||||
// fetch optionals attributes and labels
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ if (! $search_all)
|
|||
$sql.= " typent.code,";
|
||||
$sql.= " state.code_departement, state.nom,";
|
||||
$sql.= ' country.code,';
|
||||
$sql.= " p.rowid, p.ref";
|
||||
$sql.= " p.rowid, p.ref, p.title";
|
||||
|
||||
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
|
||||
{
|
||||
|
|
|
|||
|
|
@ -267,8 +267,12 @@ CREATE TABLE llx_pos_cash_fence(
|
|||
UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END';
|
||||
UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD';
|
||||
|
||||
-- Delete duplicate accounting account not used
|
||||
|
||||
-- Delete duplicate accounting account, but only if not used
|
||||
DROP TABLE tmp_llx_accouting_account;
|
||||
CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version;
|
||||
--SELECT * from tmp_llx_accouting_account;
|
||||
DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det));
|
||||
|
||||
|
||||
ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ ALTER TABLE llx_don ADD COLUMN fk_soc integer NULL;
|
|||
|
||||
ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32);
|
||||
|
||||
|
||||
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN entity integer(11);
|
||||
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN sourcetype varchar(32);
|
||||
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN ext_payment_id varchar(128) NULL;
|
||||
|
|
@ -166,6 +165,11 @@ ALTER TABLE llx_commande ADD COLUMN module_source varchar(32);
|
|||
ALTER TABLE llx_commande ADD COLUMN pos_source varchar(32);
|
||||
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||
ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||
ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -376,6 +376,16 @@ update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_ur
|
|||
drop table tmp_bank_url_expense_user;
|
||||
|
||||
|
||||
-- Delete duplicate accounting account, but only if not used
|
||||
DROP TABLE tmp_llx_accouting_account;
|
||||
CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version;
|
||||
--SELECT * from tmp_llx_accouting_account;
|
||||
DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det));
|
||||
|
||||
ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account;
|
||||
ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version);
|
||||
|
||||
|
||||
-- VMYSQL4.1 update llx_projet_task_time set task_datehour = task_date where task_datehour < task_date or task_datehour > DATE_ADD(task_date, interval 1 day);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ create table llx_adherent
|
|||
skype varchar(255),
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
linkedin varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
googleplus varchar(255), --
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ create table llx_societe
|
|||
skype varchar(255), --
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
linkedin varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
googleplus varchar(255), --
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ create table llx_socpeople
|
|||
skype varchar(255),
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
linkedin varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
googleplus varchar(255), --
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ create table llx_user
|
|||
skype varchar(255),
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
linkedin varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
googleplus varchar(255), --
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ MenuTaxAccounts=Tax accounts
|
|||
MenuExpenseReportAccounts=Expense report accounts
|
||||
MenuLoanAccounts=Loan accounts
|
||||
MenuProductsAccounts=Product accounts
|
||||
MenuClosureAccounts=Closure accounts
|
||||
ProductsBinding=Products accounts
|
||||
Ventilation=Binding to accounts
|
||||
Binding=Binding to accounts
|
||||
|
|
@ -142,6 +143,7 @@ ACCOUNTING_LENGTH_AACCOUNT=Length of the third-party accounting accounts (If you
|
|||
ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account. Needed by some countries (like Switzerland). If set to off (default), you can set the following two parameters to ask the application to add virtual zeros.
|
||||
BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account
|
||||
ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Enable draft export on journal
|
||||
ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow if you have a lot of third parties)
|
||||
|
||||
ACCOUNTING_SELL_JOURNAL=Sell journal
|
||||
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
|
||||
|
|
@ -150,7 +152,12 @@ ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal
|
|||
ACCOUNTING_SOCIAL_JOURNAL=Social journal
|
||||
ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal
|
||||
|
||||
ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit)
|
||||
ACCOUNTING_RESULT_LOSS=Result accounting account (Loss)
|
||||
ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure
|
||||
|
||||
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer
|
||||
|
||||
ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait
|
||||
DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations
|
||||
ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions
|
||||
|
|
@ -288,6 +295,7 @@ ChartofaccountsId=Chart of accounts Id
|
|||
InitAccountancy=Init accountancy
|
||||
InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases.
|
||||
DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set.
|
||||
DefaultClosureDesc=This page can be used to set parameters to use to enclose a balance sheet.
|
||||
Options=Options
|
||||
OptionModeProductSell=Mode sales
|
||||
OptionModeProductBuy=Mode purchases
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ while ($i < min($num, $limit))
|
|||
$userAccess = $projectstatic->restrictedProjectArea($user); // why this ?
|
||||
if ($userAccess >= 0)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
|
||||
// Ref
|
||||
if (! empty($arrayfields['t.ref']['checked']))
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ if (empty($reshook))
|
|||
$object->client = $object->client | $soc_origin->client;
|
||||
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
||||
$listofproperties=array(
|
||||
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'url', 'barcode',
|
||||
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'url', 'barcode',
|
||||
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
|
||||
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'remise_supplier_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
|
||||
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
|
||||
|
|
@ -407,6 +407,7 @@ if (empty($reshook))
|
|||
$object->skype = GETPOST('skype', 'alpha');
|
||||
$object->twitter = GETPOST('twitter', 'alpha');
|
||||
$object->facebook = GETPOST('facebook', 'alpha');
|
||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||
$object->phone = GETPOST('phone', 'alpha');
|
||||
$object->fax = GETPOST('fax', 'alpha');
|
||||
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
|
||||
|
|
@ -970,6 +971,7 @@ else
|
|||
$object->skype = GETPOST('skype', 'alpha');
|
||||
$object->twitter = GETPOST('twitter', 'alpha');
|
||||
$object->facebook = GETPOST('facebook', 'alpha');
|
||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||
$object->phone = GETPOST('phone', 'alpha');
|
||||
$object->fax = GETPOST('fax', 'alpha');
|
||||
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
||||
|
|
@ -1304,13 +1306,21 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
// Facebook
|
||||
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
||||
{
|
||||
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<input type="text" name="facebook" class="minwidth100" maxlength="80" id="facebook" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
||||
{
|
||||
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<input type="text" name="facebook" class="minwidth100" maxlength="80" id="facebook" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
// LinkedIn
|
||||
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
|
||||
{
|
||||
print '<tr><td>'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<input type="text" name="linkedin" class="minwidth100" maxlength="80" id="linkedin" value="'.dol_escape_htmltag(GETPOSTISSET("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Phone / Fax
|
||||
|
|
@ -1591,6 +1601,7 @@ else
|
|||
$object->skype = GETPOST('skype', 'alpha');
|
||||
$object->twitter = GETPOST('twitter', 'alpha');
|
||||
$object->facebook = GETPOST('facebook', 'alpha');
|
||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||
$object->phone = GETPOST('phone', 'alpha');
|
||||
$object->fax = GETPOST('fax', 'alpha');
|
||||
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
||||
|
|
@ -1916,6 +1927,12 @@ else
|
|||
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
|
||||
print '<td colspan="3"><input type="text" name="facebook" id="facebook" value="'.$object->facebook.'"></td></tr>';
|
||||
}
|
||||
// LinkedIn
|
||||
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
|
||||
{
|
||||
print '<tr><td>'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</td>';
|
||||
print '<td colspan="3"><input type="text" name="linkedin" id="linkedin" value="'.$object->linkedin.'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Phone / Fax
|
||||
|
|
|
|||
|
|
@ -203,6 +203,11 @@ class Societe extends CommonObject
|
|||
* @var string
|
||||
*/
|
||||
public $facebook;
|
||||
/**
|
||||
* LinkedIn username
|
||||
* @var string
|
||||
*/
|
||||
public $linkedin;
|
||||
/**
|
||||
* Webpage
|
||||
* @var string
|
||||
|
|
@ -848,6 +853,7 @@ class Societe extends CommonObject
|
|||
$this->skype = trim($this->skype);
|
||||
$this->twitter = trim($this->twitter);
|
||||
$this->facebook = trim($this->facebook);
|
||||
$this->linkedin = trim($this->linkedin);
|
||||
$this->url = $this->url?clean_url($this->url, 0):'';
|
||||
$this->note_private = trim($this->note_private);
|
||||
$this->note_public = trim($this->note_public);
|
||||
|
|
@ -991,6 +997,7 @@ class Societe extends CommonObject
|
|||
$sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null");
|
||||
$sql .= ",twitter = ".(! empty($this->twitter)?"'".$this->db->escape($this->twitter)."'":"null");
|
||||
$sql .= ",facebook = ".(! empty($this->facebook)?"'".$this->db->escape($this->facebook)."'":"null");
|
||||
$sql .= ",linkedin = ".(! empty($this->linkedin)?"'".$this->db->escape($this->linkedin)."'":"null");
|
||||
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
|
||||
|
||||
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
|
||||
|
|
@ -1132,6 +1139,7 @@ class Societe extends CommonObject
|
|||
$lmember->skype=$this->skype;
|
||||
$lmember->twitter=$this->twitter;
|
||||
$lmember->facebook=$this->facebook;
|
||||
$lmember->linkedin=$this->linkedin;
|
||||
$lmember->phone=$this->phone;
|
||||
|
||||
$result=$lmember->update($user, 0, 1, 1, 1); // Use nosync to 1 to avoid cyclic updates
|
||||
|
|
@ -1235,7 +1243,7 @@ class Societe extends CommonObject
|
|||
$sql .= ', s.status';
|
||||
$sql .= ', s.price_level';
|
||||
$sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif';
|
||||
$sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
|
||||
$sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.linkedin, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
|
||||
$sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
|
||||
$sql .= ', s.capital, s.tva_intra';
|
||||
$sql .= ', s.fk_typent as typent_id';
|
||||
|
|
@ -1332,6 +1340,7 @@ class Societe extends CommonObject
|
|||
$this->skype = $obj->skype;
|
||||
$this->twitter = $obj->twitter;
|
||||
$this->facebook = $obj->facebook;
|
||||
$this->linkedin = $obj->linkedin;
|
||||
$this->url = $obj->url;
|
||||
$this->phone = $obj->phone;
|
||||
$this->fax = $obj->fax;
|
||||
|
|
@ -3337,6 +3346,7 @@ class Societe extends CommonObject
|
|||
$this->skype=$member->skype;
|
||||
$this->twitter=$member->twitter;
|
||||
$this->facebook=$member->facebook;
|
||||
$this->linkedin=$member->linkedin;
|
||||
|
||||
$this->client = 1; // A member is a customer by default
|
||||
$this->code_client = ($customercode?$customercode:-1);
|
||||
|
|
@ -3480,6 +3490,7 @@ class Societe extends CommonObject
|
|||
$this->skype='tom.hanson';
|
||||
$this->twitter='tomhanson';
|
||||
$this->facebook='tomhanson';
|
||||
$this->linkedin='tomhanson';
|
||||
$this->url='http://www.specimen.com';
|
||||
|
||||
$this->phone='0909090901';
|
||||
|
|
|
|||
|
|
@ -78,9 +78,6 @@ if ($action == 'setvalue' && $user->admin)
|
|||
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
if (! $result > 0)
|
||||
$error ++;
|
||||
$result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
if (! $result > 0)
|
||||
$error ++;
|
||||
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (! $result > 0)
|
||||
$error ++;
|
||||
|
|
@ -97,9 +94,9 @@ if ($action == 'setvalue' && $user->admin)
|
|||
if (! $result > 0)
|
||||
$error ++;
|
||||
// Stock decrement
|
||||
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
if (! $result > 0)
|
||||
$error ++;
|
||||
//$result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
//if (! $result > 0)
|
||||
// $error ++;
|
||||
|
||||
// Payment token for URL
|
||||
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
|
@ -166,18 +163,12 @@ print "</tr>\n";
|
|||
print '<tr class="oddeven">';
|
||||
print '<td class="titlefield">';
|
||||
print $langs->trans("StripeLiveEnabled").'</td><td>';
|
||||
if (!empty($conf->global->STRIPE_LIVE))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setlive&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STRIPE_LIVE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (empty($conf->stripeconnect->enabled))
|
||||
|
|
@ -195,9 +186,14 @@ if (empty($conf->stripeconnect->enabled))
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span>'.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").'</span></td><td>';
|
||||
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.$conf->global->STRIPE_TEST_WEBHOOK_KEY.'">';
|
||||
print '<span class="titlefield fieldrequired">'.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").'</span></td><td>';
|
||||
print '<input class="minwidth500" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.$conf->global->STRIPE_TEST_WEBHOOK_KEY.'">';
|
||||
print ' '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx';
|
||||
$out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForTestWebhook").'<br>';
|
||||
$url = dol_buildpath('/public/stripe/ipn.php?test', 2);
|
||||
$out.= '<input type="text" id="onlinetestwebhookurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out.= ajax_autoselect("onlinetestwebhookurl", 0);
|
||||
print '<br>'.$out;
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("StripeConnect").'</td>';
|
||||
|
|
@ -225,9 +221,14 @@ if (empty($conf->stripeconnect->enabled))
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<span>'.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").'</span></td><td>';
|
||||
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_KEY.'">';
|
||||
print '<span class="titlefield fieldrequired">'.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").'</span></td><td>';
|
||||
print '<input class="minwidth500" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_KEY.'">';
|
||||
print ' '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx';
|
||||
$out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForLiveWebhook").'<br>';
|
||||
$url = dol_buildpath('/public/stripe/ipn.php', 2);
|
||||
$out.= '<input type="text" id="onlinelivewebhookurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out.= ajax_autoselect("onlinelivewebhookurl", 0);
|
||||
print '<br>'.$out;
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
|
|
@ -272,22 +273,42 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ?
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Minimal amount for force 3Dsecure if it's optionnal
|
||||
// Activate Payment Request API
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("STRIPE_PAYMENT_REQUEST_API").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Activate SEPA DIRECT_DEBIT
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("STRIPE_MINIMAL_3DSECURE").'</td><td>';
|
||||
print '<input class="flat" name="STRIPE_MINIMAL_3DSECURE" size="3" value="' .$conf->global->STRIPE_MINIMAL_3DSECURE . '">'.$langs->getCurrencySymbol($conf->currency).'</td></tr>';
|
||||
print $langs->trans("STRIPE_SEPA_DIRECT_DEBIT").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STRIPE_SEPA_DIRECT_DEBIT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Warehouse for automatic decrement
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ?
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").'</td><td>';
|
||||
print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled);
|
||||
print '</td></tr>';
|
||||
}
|
||||
//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment
|
||||
//{
|
||||
// print '<tr class="oddeven"><td>';
|
||||
// print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").'</td><td>';
|
||||
// print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled);
|
||||
// print '</td></tr>';
|
||||
//}
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("CSSUrlForPaymentForm").'</td><td>';
|
||||
|
|
@ -329,7 +350,12 @@ print '</td></tr>';
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("SecurityTokenIsUnique").'</td><td>';
|
||||
print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN)?0:$conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -309,7 +309,10 @@ class Stripe extends CommonObject
|
|||
else $stripeamount = $object->multicurrency_total_ttc;
|
||||
|
||||
$fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
|
||||
if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
||||
if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
|
||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
|
||||
}
|
||||
elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
|
||||
}
|
||||
|
||||
|
|
@ -584,9 +587,11 @@ class Stripe extends CommonObject
|
|||
$charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$ref"));
|
||||
}
|
||||
} else {
|
||||
|
||||
$fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
|
||||
if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
||||
$fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
|
||||
if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
|
||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
|
||||
}
|
||||
elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,18 @@ div.description{
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
div.catwatermark{
|
||||
position:absolute;
|
||||
top:3%;
|
||||
left:3%;
|
||||
width:20%;
|
||||
background-color:black;
|
||||
color:white;
|
||||
text-align:center;
|
||||
font-size: 20px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (max-aspect-ratio: 6/4) {
|
||||
div.description{
|
||||
min-height:20%;
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB |
BIN
htdocs/takepos/genimg/empty.png
Normal file
BIN
htdocs/takepos/genimg/empty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 156 B |
|
|
@ -27,10 +27,10 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
|||
|
||||
require '../../main.inc.php'; // Load $user and permissions
|
||||
|
||||
$id= GETPOST('id');
|
||||
$w= GETPOST('w');
|
||||
$h= GETPOST('h');
|
||||
$query= GETPOST('query');
|
||||
$id = GETPOST('id', 'int');
|
||||
$w = GETPOST('w', 'int');
|
||||
$h = GETPOST('h', 'int');
|
||||
$query= GETPOST('query', 'alpha');
|
||||
|
||||
|
||||
|
||||
|
|
@ -38,7 +38,6 @@ $query= GETPOST('query');
|
|||
* View
|
||||
*/
|
||||
|
||||
header('Content-Type: image/jpeg');
|
||||
header('Cache-Control: max-age=604800, public, must-revalidate');
|
||||
header('Pragma: cache');
|
||||
|
||||
|
|
@ -49,39 +48,26 @@ if ($query=="cat")
|
|||
|
||||
$object = new Categorie($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
||||
$pdir = get_exdir($object->id, 2, 0, 0, $object, 'category') . $object->id ."/photos/";
|
||||
$dir = $upload_dir.'/'.$pdir;
|
||||
|
||||
foreach ($object->liste_photos($dir) as $key => $obj)
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
|
||||
// The file
|
||||
$filename = $dir.$filename;
|
||||
if (!file_exists($filename)) $filename="empty.jpg";
|
||||
|
||||
// Dimensions
|
||||
list($width, $height) = getimagesize($filename);
|
||||
$new_width = $w;
|
||||
$new_height = $h;
|
||||
|
||||
// Resample
|
||||
$image_p = imagecreatetruecolor($new_width, $new_height);
|
||||
$image = imagecreatefromjpeg($filename);
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
|
||||
// Add icon
|
||||
$icon = imagecreatefromjpeg('add.jpg');
|
||||
list($width, $height) = getimagesize('add.jpg');
|
||||
$new_width = $w*0.3;
|
||||
$new_height = $h*0.3;
|
||||
$icon_p = imagecreatetruecolor($new_width, $new_height);
|
||||
imagecopyresampled($icon_p, $icon, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
imagecopymerge($image_p, $icon_p, 0, 0, 0, 0, $new_width, $new_height, 100);
|
||||
|
||||
// Output
|
||||
imagejpeg($image_p, null, 100);
|
||||
{
|
||||
if ($obj['photo_vignette'])
|
||||
{
|
||||
$filename=$obj['photo_vignette'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
$file=DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
|
||||
header('Location: '.$file);
|
||||
exit;
|
||||
}
|
||||
header('Location: ../../public/theme/common/nophoto.png');
|
||||
}
|
||||
elseif ($query=="pro")
|
||||
{
|
||||
|
|
@ -89,42 +75,18 @@ elseif ($query=="pro")
|
|||
|
||||
$objProd = new Product($db);
|
||||
$objProd->fetch($id);
|
||||
$image=$objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1);
|
||||
|
||||
$dir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/';
|
||||
$pdir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/';
|
||||
preg_match('@src="([^"]+)"@', $image, $match);
|
||||
$file = array_pop($match);
|
||||
if ($file=="") header('Location: ../../public/theme/common/nophoto.png');
|
||||
else header('Location: '.$file);
|
||||
|
||||
foreach ($objProd->liste_photos($dir) as $key => $obj)
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
$filename = $dir.$filename;
|
||||
|
||||
if (!file_exists($filename)){
|
||||
$dir = $conf->product->multidir_output[$objProd->entity].'/'.$pdir;
|
||||
foreach ($objProd->liste_photos($dir) as $key => $obj)
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
$filename = $dir.$filename;
|
||||
}
|
||||
|
||||
if (!file_exists($filename)) $filename="empty.jpg";
|
||||
|
||||
// Dimensions
|
||||
list($width, $height) = getimagesize($filename);
|
||||
$new_width = $w;
|
||||
$new_height = $h;
|
||||
|
||||
// Resample
|
||||
$image_p = imagecreatetruecolor($new_width, $new_height);
|
||||
$image = imagecreatefromjpeg($filename);
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
|
||||
// Output
|
||||
imagejpeg($image_p, null, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
|
||||
|
||||
// The file
|
||||
$filename = $query.".jpg";
|
||||
|
||||
|
|
|
|||
|
|
@ -93,8 +93,9 @@ function PrintCategories(first){
|
|||
for (i = 0; i < 14; i++) {
|
||||
if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") break;
|
||||
$("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']);
|
||||
$("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[parseInt(i)+parseInt(first)]['rowid']);
|
||||
$("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']);
|
||||
$("#catdiv"+i).data("rowid",categories[parseInt(i)+parseInt(first)]['rowid']);
|
||||
$("#catwatermark"+i).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -117,12 +118,14 @@ function MoreCategories(moreorless){
|
|||
for (i = 0; i < 14; i++) {
|
||||
if (typeof (categories[i+(14*pagecategories)]) == "undefined"){
|
||||
$("#catdesc"+i).text("");
|
||||
$("#catimg"+i).attr("src","");
|
||||
$("#catimg"+i).attr("src","genimg/empty.png");
|
||||
$("#catwatermark"+i).hide();
|
||||
continue;
|
||||
}
|
||||
$("#catdesc"+i).text(categories[i+(14*pagecategories)]['label']);
|
||||
$("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[i+(14*pagecategories)]['rowid']);
|
||||
$("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[i+(14*pagecategories)]['rowid']);
|
||||
$("#catdiv"+i).data("rowid",categories[i+(14*pagecategories)]['rowid']);
|
||||
$("#catwatermark"+i).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,16 +134,17 @@ function LoadProducts(position, issubcat=false){
|
|||
$('#catimg'+position).animate({opacity: '1'}, 100);
|
||||
if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid');
|
||||
else currentcat=$('#catdiv'+position).data('rowid');
|
||||
if (currentcat=="") return;
|
||||
if (currentcat==undefined) return;
|
||||
pageproducts=0;
|
||||
ishow=0; //product to show counter
|
||||
|
||||
jQuery.each(subcategories, function(i, val) {
|
||||
if (currentcat==val.fk_parent){
|
||||
$("#prodesc"+ishow).text(val.label);
|
||||
$("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid);
|
||||
$("#proimg"+ishow).attr("src","genimg/index.php?query=cat&id="+val.rowid);
|
||||
$("#prodiv"+ishow).data("rowid",val.rowid);
|
||||
$("#prodiv"+ishow).data("iscat",1);
|
||||
$("#prowatermark"+ishow).show();
|
||||
ishow++;
|
||||
}
|
||||
});
|
||||
|
|
@ -150,18 +154,19 @@ function LoadProducts(position, issubcat=false){
|
|||
while (idata < 30 && ishow < 30) {
|
||||
if (typeof (data[idata]) == "undefined") {
|
||||
$("#prodesc"+ishow).text("");
|
||||
$("#proimg"+ishow).attr("src","");
|
||||
$("#proimg"+ishow).attr("src","genimg/empty.png");
|
||||
$("#prodiv"+ishow).data("rowid","");
|
||||
ishow++; //Next product to show after print data product
|
||||
}
|
||||
else if ((data[idata]['status']) == "1") {
|
||||
//Only show products with status=1 (for sell)
|
||||
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
|
||||
$("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
|
||||
$("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']);
|
||||
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
|
||||
$("#prodiv"+ishow).data("iscat",0);
|
||||
ishow++; //Next product to show after print data product
|
||||
}
|
||||
$("#prowatermark"+ishow).hide();
|
||||
idata++; //Next data everytime
|
||||
}
|
||||
});
|
||||
|
|
@ -189,18 +194,19 @@ function MoreProducts(moreorless){
|
|||
while (idata < (30*pageproducts)+30) {
|
||||
if (typeof (data[idata]) == "undefined") {
|
||||
$("#prodesc"+ishow).text("");
|
||||
$("#proimg"+ishow).attr("src","");
|
||||
$("#proimg"+ishow).attr("src","genimg/empty.png");
|
||||
$("#prodiv"+ishow).data("rowid","");
|
||||
ishow++; //Next product to show after print data product
|
||||
}
|
||||
else if ((data[idata]['status']) == "1") {
|
||||
//Only show products with status=1 (for sell)
|
||||
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
|
||||
$("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
|
||||
$("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']);
|
||||
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
|
||||
$("#prodiv"+ishow).data("iscat",0);
|
||||
ishow++; //Next product to show after print data product
|
||||
}
|
||||
$("#prowatermark"+ishow).hide();
|
||||
idata++; //Next data everytime
|
||||
}
|
||||
});
|
||||
|
|
@ -261,12 +267,12 @@ function Search2(){
|
|||
for (i = 0; i < 30; i++) {
|
||||
if (typeof (data[i]) == "undefined"){
|
||||
$("#prodesc"+i).text("");
|
||||
$("#proimg"+i).attr("src","");
|
||||
$("#proimg"+i).attr("src","genimg/empty.png");
|
||||
$("#prodiv"+i).data("rowid","");
|
||||
continue;
|
||||
}
|
||||
$("#prodesc"+i).text(data[parseInt(i)]['label']);
|
||||
$("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']);
|
||||
$("#proimg"+i).attr("src","genimg/?query=pro&id="+data[i]['rowid']);
|
||||
$("#prodiv"+i).data("rowid",data[i]['rowid']);
|
||||
$("#prodiv"+i).data("iscat",0);
|
||||
}
|
||||
|
|
@ -491,10 +497,11 @@ foreach($menus as $menu) {
|
|||
{
|
||||
?>
|
||||
<div class='wrapper' <?php if ($count==14) echo 'onclick="MoreCategories(\'less\');"'; elseif ($count==15) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id='catdiv<?php echo $count;?>'>
|
||||
<img class='imgwrapper' <?php if ($count==14) echo 'src="img/arrow-prev-top.png"'; if ($count==15) echo 'src="img/arrow-next-top.png"';?> width="98%" id='catimg<?php echo $count;?>'/>
|
||||
<img class='imgwrapper' <?php if ($count==14) echo 'src="img/arrow-prev-top.png"'; if ($count==15) echo 'src="img/arrow-next-top.png"';?> width="100%" height="85%" id='catimg<?php echo $count;?>'/>
|
||||
<div class='description'>
|
||||
<div class='description_content' id='catdesc<?php echo $count;?>'></div>
|
||||
</div>
|
||||
<div class="catwatermark" id='catwatermark<?php echo $count;?>'>+</div>
|
||||
</div>
|
||||
<?php
|
||||
$count++;
|
||||
|
|
@ -509,10 +516,11 @@ while ($count<32)
|
|||
{
|
||||
?>
|
||||
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
|
||||
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="95%" id='proimg<?php echo $count;?>'/>
|
||||
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="100%" height="85%" id='proimg<?php echo $count;?>'/>
|
||||
<div class='description'>
|
||||
<div class='description_content' id='prodesc<?php echo $count;?>'></div>
|
||||
</div>
|
||||
<div class="catwatermark" id='prowatermark<?php echo $count;?>'>+</div>
|
||||
</div>
|
||||
<?php
|
||||
$count++;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($object->table_element,
|
|||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
if (GETPOST('search_fk_status','alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
|
||||
if (GETPOST('search_fk_status', 'alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all=trim(GETPOST("search_all", 'alpha'));
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ if (empty($reshook)) {
|
|||
$object->skype = GETPOST("skype", 'alphanohtml');
|
||||
$object->twitter = GETPOST("twitter", 'alphanohtml');
|
||||
$object->facebook = GETPOST("facebook", 'alphanohtml');
|
||||
$object->linkedin = GETPOST("linkedin", 'alphanohtml');
|
||||
|
||||
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
|
||||
$object->job = GETPOST("job", 'alpha');
|
||||
|
|
@ -364,6 +365,7 @@ if (empty($reshook)) {
|
|||
$object->skype = GETPOST("skype", 'alpha');
|
||||
$object->twitter = GETPOST("twitter", 'alpha');
|
||||
$object->facebook = GETPOST("facebook", 'alpha');
|
||||
$object->linkedin = GETPOST("linkedin", 'alpha');
|
||||
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
|
||||
$object->job = GETPOST("job", 'alpha');
|
||||
$object->signature = GETPOST("signature", 'none');
|
||||
|
|
@ -606,6 +608,7 @@ if (empty($reshook)) {
|
|||
$ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE];
|
||||
$ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER];
|
||||
$ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK];
|
||||
$ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN];
|
||||
$ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL];
|
||||
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
|
||||
}
|
||||
|
|
@ -1067,6 +1070,23 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// LinkedIn
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
|
||||
print '<td>';
|
||||
if (! empty($ldap_linkedin))
|
||||
{
|
||||
print '<input type="hidden" name="linkedin" value="'.$ldap_linkedin.'">';
|
||||
print $ldap_linkedin;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input class="maxwidth200" type="text" name="linkedin" value="'.GETPOST('linkedin', 'alpha').'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// EMail
|
||||
print '<tr><td'.(! empty($conf->global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -2286,7 +2306,7 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Skype
|
||||
// Facebook
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Facebook").'</td>';
|
||||
|
|
@ -2303,6 +2323,23 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// LinkedIn
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield && empty($object->ldap_sid))
|
||||
{
|
||||
print '<input size="40" type="text" name="linkedin" class="flat" value="'.$object->linkedin.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="linkedin" value="'.$object->linkedin.'">';
|
||||
print $object->linkedin;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// EMail
|
||||
print "<tr>".'<td'.(! empty($conf->global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'</td>';
|
||||
print '<td>';
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class User extends CommonObject
|
|||
public $skype;
|
||||
public $twitter;
|
||||
public $facebook;
|
||||
public $linkedin;
|
||||
|
||||
public $job; // job position
|
||||
public $signature;
|
||||
|
|
@ -227,7 +228,7 @@ class User extends CommonObject
|
|||
$login=trim($login);
|
||||
|
||||
// Get user
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook,";
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,";
|
||||
$sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile,";
|
||||
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
|
||||
$sql.= " u.admin, u.login, u.note,";
|
||||
|
|
@ -335,6 +336,7 @@ class User extends CommonObject
|
|||
$this->skype = $obj->skype;
|
||||
$this->twitter = $obj->twitter;
|
||||
$this->facebook = $obj->facebook;
|
||||
$this->linkedin = $obj->linkedin;
|
||||
$this->job = $obj->job;
|
||||
$this->signature = $obj->signature;
|
||||
$this->admin = $obj->admin;
|
||||
|
|
@ -1250,6 +1252,7 @@ class User extends CommonObject
|
|||
$this->skype = $contact->skype;
|
||||
$this->twitter = $contact->twitter;
|
||||
$this->facebook = $contact->facebook;
|
||||
$this->linkedin = $contact->linkedin;
|
||||
$this->office_phone = $contact->phone_pro;
|
||||
$this->office_fax = $contact->fax;
|
||||
$this->user_mobile = $contact->phone_mobile;
|
||||
|
|
@ -1467,6 +1470,7 @@ class User extends CommonObject
|
|||
$this->skype = trim($this->skype);
|
||||
$this->twitter = trim($this->twitter);
|
||||
$this->facebook = trim($this->facebook);
|
||||
$this->linkedin = trim($this->linkedin);
|
||||
|
||||
$this->job = trim($this->job);
|
||||
$this->signature = trim($this->signature);
|
||||
|
|
@ -1519,6 +1523,7 @@ class User extends CommonObject
|
|||
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
|
||||
$sql.= ", twitter = '".$this->db->escape($this->twitter)."'";
|
||||
$sql.= ", facebook = '".$this->db->escape($this->facebook)."'";
|
||||
$sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'";
|
||||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||
|
|
@ -1607,6 +1612,7 @@ class User extends CommonObject
|
|||
$adh->skype=$this->skype;
|
||||
$adh->twitter=$this->twitter;
|
||||
$adh->facebook=$this->facebook;
|
||||
$adh->linkedin=$this->linkedin;
|
||||
|
||||
$adh->phone=$this->office_phone;
|
||||
$adh->phone_mobile=$this->user_mobile;
|
||||
|
|
@ -1659,6 +1665,7 @@ class User extends CommonObject
|
|||
$tmpobj->skype=$this->skype;
|
||||
$tmpobj->twitter=$this->twitter;
|
||||
$tmpobj->facebook=$this->facebook;
|
||||
$tmpobj->linkedin=$this->linkedin;
|
||||
|
||||
$tmpobj->phone_pro=$this->office_phone;
|
||||
$tmpobj->phone_mobile=$this->user_mobile;
|
||||
|
|
@ -2426,15 +2433,15 @@ class User extends CommonObject
|
|||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($statut, $mode = 0)
|
||||
{
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($statut, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('users');
|
||||
|
|
@ -2526,7 +2533,8 @@ class User extends CommonObject
|
|||
'LDAP_FIELD_SID' => 'ldap_sid',
|
||||
'LDAP_FIELD_SKYPE' => 'skype',
|
||||
'LDAP_FIELD_TWITTER' => 'twitter',
|
||||
'LDAP_FIELD_FACEBOOK' => 'facebook'
|
||||
'LDAP_FIELD_FACEBOOK' => 'facebook',
|
||||
'LDAP_FIELD_LINKEDIN' => 'linkedin'
|
||||
);
|
||||
|
||||
// Champs
|
||||
|
|
@ -2640,6 +2648,7 @@ class User extends CommonObject
|
|||
$this->skype='skypepseudo';
|
||||
$this->twitter='twitterpseudo';
|
||||
$this->facebook='facebookpseudo';
|
||||
$this->linkedin='linkedinpseudo';
|
||||
$this->office_phone='0999999999';
|
||||
$this->office_fax='0999999998';
|
||||
$this->user_mobile='0999999997';
|
||||
|
|
@ -2794,6 +2803,7 @@ class User extends CommonObject
|
|||
$this->skype=$ldapuser->{$conf->global->LDAP_FIELD_SKYPE};
|
||||
$this->twitter=$ldapuser->{$conf->global->LDAP_FIELD_TWITTER};
|
||||
$this->facebook=$ldapuser->{$conf->global->LDAP_FIELD_FACEBOOK};
|
||||
$this->linkedin=$ldapuser->{$conf->global->LDAP_FIELD_LINKEDIN};
|
||||
$this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID};
|
||||
|
||||
$this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-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
|
||||
|
|
@ -29,9 +29,9 @@ $langs->loadLangs(array("products", "other"));
|
|||
|
||||
$id = GETPOST('id', 'int');
|
||||
$valueid = GETPOST('valueid', 'int');
|
||||
$ref = GETPOST('ref');
|
||||
$weight_impact = (float) GETPOST('weight_impact');
|
||||
$price_impact = (float) GETPOST('price_impact');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$weight_impact = GETPOST('weight_impact', 'alpha');
|
||||
$price_impact = GETPOST('price_impact', 'alpha');
|
||||
$price_impact_percent = (bool) GETPOST('price_impact_percent');
|
||||
$form = new Form($db);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user