diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php new file mode 100644 index 00000000000..8093a2fa883 --- /dev/null +++ b/htdocs/accountancy/admin/closure.php @@ -0,0 +1,137 @@ + + * + * 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 . + * + */ + +/** + * \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").'
'; +print '
'; + +print '
'; +print ''; +print ''; + +// Define main accounts for closure +print ''; + +foreach ($list_account_main as $key) { + + print ''; + // Param + $label = $langs->trans($key); + $keydesc=$key.'_Desc'; + + $htmltext = $langs->trans($keydesc); + print ''; + // Value + print ''; + print ''; +} + +// Journal +print ''; +print ''; +print ''; + +print "
'; + print $form->textwithpicto($label, $htmltext); + print ''; // 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 '
' . $langs->trans("ACCOUNTING_CLOSURE_DEFAULT_JOURNAL") . ''; +$defaultjournal=$conf->global->ACCOUNTING_CLOSURE_DEFAULT_JOURNAL; +print $formaccounting->select_journal($defaultjournal, "ACCOUNTING_CLOSURE_DEFAULT_JOURNAL", 9, 1, 0, 0); +print '
\n"; + +print '
'; + +print '
'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index b3b8a67241b..965b63ba9b9 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -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 ''; + print ''; + print '' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . ''; + if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print ''; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b9a2d15c5cd..9903255e52f 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -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 ''.$langs->trans("Facebook").''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + } + // Birthday print "".$langs->trans("Birthday")."\n"; print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc'); @@ -1281,10 +1290,16 @@ else } // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("Facebook").'facebook).'">'; - } + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Facebook").'facebook).'">'; + } + + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").'linkedin).'">'; + } // Birthday print "".$langs->trans("Birthday")."\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 5c20e827bc2..1d7fb503ea2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -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; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index f723d13d540..8b7c061dc64 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -1,5 +1,6 @@ + * Copyright (C) 2019 Alexandre Spangaro * * 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 '
'; -$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); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index c0034205586..5bbc91ea946 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -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'; diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 134fc940c9d..0b1d55d7584 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -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'); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 41364c59dc8..3ec9695a7e0 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -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 '
'; @@ -482,9 +482,9 @@ while ($i < min($num, $limit)) print ''; 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'; diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index e9db6e05f50..d804ec375cd 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -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; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 70558efcb9b..dff432690be 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -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 ''; print 'facebook).'">'; } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''; + print 'linkedin).'">'; + } } // Visibility @@ -979,11 +987,17 @@ else print 'twitter).'">'; } // Facebook - if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - { - print ''; - print 'facebook).'">'; - } + if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) + { + print ''; + print 'facebook).'">'; + } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''; + print 'linkedin).'">'; + } } // Visibility diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index b2865e8f36f..73f27f8ec1c 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index aa27e43ee71..41ff8061244 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador * * 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 ''; print ''; } +if (! empty($arrayfields['p.no_email']['checked'])) +{ + print ''; + print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); + print ''; +} if (! empty($arrayfields['p.skype']['checked'])) { print ''; @@ -625,6 +641,12 @@ if (! empty($arrayfields['p.facebook']['checked'])) print ''; print ''; } +if (! empty($arrayfields['p.linkedin']['checked'])) +{ + print ''; + print ''; + print ''; +} if (! empty($arrayfields['p.thirdparty']['checked'])) { print ''; @@ -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 ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18).''; if (! $i) $totalarray['nbfield']++; } - + // No EMail + if (! empty($arrayfields['p.no_email']['checked'])) + { + print ''.yn($obj->no_email).''; + 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 ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').''; } - if (! $i) $totalarray['nbfield']++; - } - // Company + if (! empty($arrayfields['p.facebook']['checked'])) + { + if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').''; } + if (! $i) $totalarray['nbfield']++; + } + // LinkedIn + if (! empty($arrayfields['p.linkedin']['checked'])) + { + if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->linkedin, $obj->rowid, $obj->socid, 'linkedin').''; } + if (! $i) $totalarray['nbfield']++; + } + // Company if (! empty($arrayfields['p.thirdparty']['checked'])) { print ''; diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index f08586ba9b0..f03915b7b2a 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -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); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5a166e764b..69d0c49e6e7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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.=''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0ef7f8d295b..c23f40a0283 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -148,7 +148,7 @@ class ExtraFields public $errors = array(); /** - * @var integer DB Error number + * @var string DB Error number */ public $errno; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6eac9761b48..12a1604d84d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4755,7 +4755,7 @@ class Form $out=''; $out.= 'facebook).'">'; - print ''; - } + if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) + { + print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; + print ''; + print 'facebook).'">'; + print ''; + } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; + print ''; + print 'linkedin).'">'; + print ''; + } } // 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 ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; print ''; } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; + print ''; + } } // Phone / Fax diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 36c81216f9c..1aacca2c895 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -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'; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 100a85f6c30..5e2c27dd392 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -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 "\n"; print ''; print ''; print $langs->trans("StripeLiveEnabled").''; -if (!empty($conf->global->STRIPE_LIVE)) -{ - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; -} -else -{ - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; -} + 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 ''; if (empty($conf->stripeconnect->enabled)) @@ -195,9 +186,14 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''; - print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; - print ''; + print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; + print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; + $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForTestWebhook").'
'; + $url = dol_buildpath('/public/stripe/ipn.php?test', 2); + $out.= ''; + $out.= ajax_autoselect("onlinetestwebhookurl", 0); + print '
'.$out; print ''; } else { print ''.$langs->trans("StripeConnect").''; @@ -225,9 +221,14 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''; - print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; - print ''; + print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; + print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; + $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForLiveWebhook").'
'; + $url = dol_buildpath('/public/stripe/ipn.php', 2); + $out.= ''; + $out.= ajax_autoselect("onlinelivewebhookurl", 0); + print '
'.$out; print ''; } else @@ -272,22 +273,42 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? print ''; } -// 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 ''; + print $langs->trans("STRIPE_PAYMENT_REQUEST_API").''; + 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 ''; +} + +// Activate SEPA DIRECT_DEBIT if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code { print ''; - print $langs->trans("STRIPE_MINIMAL_3DSECURE").''; - print ''.$langs->getCurrencySymbol($conf->currency).''; + print $langs->trans("STRIPE_SEPA_DIRECT_DEBIT").''; + 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 ''; } // Warehouse for automatic decrement -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? -{ - print ''; - print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; - print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled); - print ''; -} +//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment +//{ +// print ''; +// print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; +// print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled); +// print ''; +//} print ''; print $langs->trans("CSSUrlForPaymentForm").''; @@ -329,7 +350,12 @@ print ''; print ''; print $langs->trans("SecurityTokenIsUnique").''; -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 ''; print ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 646e5c19b12..fa881a834ea 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -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); } diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css index 87c74c8952d..cac9a23a8d9 100644 --- a/htdocs/takepos/css/pos.css +++ b/htdocs/takepos/css/pos.css @@ -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%; diff --git a/htdocs/takepos/genimg/add.jpg b/htdocs/takepos/genimg/add.jpg deleted file mode 100644 index 976fd10697d..00000000000 Binary files a/htdocs/takepos/genimg/add.jpg and /dev/null differ diff --git a/htdocs/takepos/genimg/empty.jpg b/htdocs/takepos/genimg/empty.jpg deleted file mode 100644 index 8883f7c9957..00000000000 Binary files a/htdocs/takepos/genimg/empty.jpg and /dev/null differ diff --git a/htdocs/takepos/genimg/empty.png b/htdocs/takepos/genimg/empty.png new file mode 100644 index 00000000000..63163e9f869 Binary files /dev/null and b/htdocs/takepos/genimg/empty.png differ diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index d5dee43ffa8..546c5ed6fca 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -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"; diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 4edab6c9bee..fe6bf6b0a19 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -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) { { ?>
id='catdiv'> - width="98%" id='catimg'/> + width="100%" height="85%" id='catimg'/>
+
+
onclick="MoreProducts('less');" onclick="MoreProducts('more');" > - width="95%" id='proimg'/> + width="100%" height="85%" id='proimg'/>
+
+
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')); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 9de64588931..2f91cf9af61 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -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 ''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + print ''; + if (! empty($ldap_linkedin)) + { + print ''; + print $ldap_linkedin; + } + else + { + print ''; + } + print ''; + } + // EMail print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; @@ -2286,7 +2306,7 @@ else print ''; } - // Skype + // Facebook if (! empty($conf->socialnetworks->enabled)) { print ''.$langs->trans("Facebook").''; @@ -2303,6 +2323,23 @@ else print ''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + print ''; + if ($caneditfield && empty($object->ldap_sid)) + { + print ''; + } + else + { + print ''; + print $object->linkedin; + } + print ''; + } + // EMail print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3b26bb8cdfb..e7f927b2f60 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -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}; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 43abb1f9e75..c53193411ff 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -1,7 +1,7 @@ - * Copyright (C) 2017 Laurent Destailleur - * Copyright (C) 2018 Frédéric France +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2018-2019 Frédéric France * * 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);