diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 33fdb675ac0..c777c36dca0 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -388,13 +388,13 @@ else if ($id > 0 || $ref) { if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Modify') . ''; } else { - print '' . $langs->trans('Modify') . ''; + print '' . $langs->trans('Modify') . ''; } if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Delete') . ''; } else { - print '' . $langs->trans('Delete') . ''; + print '' . $langs->trans('Delete') . ''; } print ''; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 62eda456fe7..443bbfa4961 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -117,7 +117,7 @@ if ($result) } else { - $addbutton = '' . $langs->trans("NewFiscalYear") . ''; + $addbutton = '' . $langs->trans("NewFiscalYear") . ''; } $title = $langs->trans('AccountingPeriods'); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index ebe88712949..7d506c6c72c 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -102,7 +102,7 @@ if (! empty($id)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 4f4932fe08f..ca75aaac15e 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -180,7 +180,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; $sql .= " AND f.fk_statut > 0"; -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND aa.account_number IS NULL"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -255,7 +255,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factu $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -332,7 +332,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -384,7 +384,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 06a1f11dcbc..f13344c936b 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -184,7 +184,7 @@ $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factur $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays "; $sql.= " WHERE fd.fk_code_ventilation > 0"; -$sql.= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql.= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql.= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -245,7 +245,7 @@ if (strlen(trim($search_country))) { if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); } -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index fdaeb606bb0..9f95c6857b0 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -288,7 +288,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { } else { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")"; } -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy // Add where from hooks $parameters=array(); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index f09db4b1cf7..1c13cfea1e1 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -917,7 +917,7 @@ if (empty($action) || $action == 'view') { print '
'; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; if ($in_bookkeeping == 'notyet') print ''; - else print '' . $langs->trans("WriteBookKeeping") . ''; + else print '' . $langs->trans("WriteBookKeeping") . ''; print '
'; // TODO Avoid using js. We can use a direct link with $param diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index a767d469120..3147339601c 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -561,11 +561,11 @@ if (empty($action) || $action == 'view') { } print '
'; if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { - print ''; + print ''; } else { if ($in_bookkeeping == 'notyet') print ''; - else print '' . $langs->trans("WriteBookKeeping") . ''; + else print '' . $langs->trans("WriteBookKeeping") . ''; } //print ''; print '
'; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 1b71b288c6b..bec5ce67609 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -748,11 +748,11 @@ if (empty($action) || $action == 'view') { print '
'; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { - print ''; + print ''; } else { if ($in_bookkeeping == 'notyet') print ''; - else print '' . $langs->trans("WriteBookKeeping") . ''; + else print '' . $langs->trans("WriteBookKeeping") . ''; } print '
'; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 3e718796b24..243c9fb943c 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -107,7 +107,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = $sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " WHERE fd.fk_code_ventilation > 0"; -$sql .= " AND f.entity IN (".getEntity('facture', 0).')'; // We don't share object for accountancy, we use source object sharing +$sql .= " AND f.entity IN (".getEntity('invoice', 0).')'; // We don't share object for accountancy, we use source object sharing $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Non common setup $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -686,11 +686,11 @@ if (empty($action) || $action == 'view') { print '
'; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { - print ''; + print ''; } else { if ($in_bookkeeping == 'notyet') print ''; - else print '' . $langs->trans("WriteBookKeeping") . ''; + else print '' . $langs->trans("WriteBookKeeping") . ''; } print '
'; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b77759b98a3..732504ed923 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2018 Philippe Grand - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -23,9 +23,9 @@ */ /** - * \file htdocs/adherents/card.php - * \ingroup member - * \brief Page of member + * \file htdocs/adherents/card.php + * \ingroup member + * \brief Page of member */ require '../main.inc.php'; @@ -249,6 +249,7 @@ if (empty($reshook)) } $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; + $gender = $_POST["gender"]; $societe=$_POST["societe"]; $morphy=$_POST["morphy"]; $login=$_POST["login"]; @@ -284,6 +285,7 @@ if (empty($reshook)) $object->civility_id = trim(GETPOST("civility_id",'alpha')); $object->firstname = trim(GETPOST("firstname",'alpha')); $object->lastname = trim(GETPOST("lastname",'alpha')); + $object->gender = trim(GETPOST("gender",'alpha')); $object->login = trim(GETPOST("login",'alpha')); $object->pass = trim(GETPOST("pass",'alpha')); @@ -434,6 +436,7 @@ if (empty($reshook)) $civility_id=GETPOST("civility_id",'int'); $lastname=GETPOST("lastname",'alpha'); $firstname=GETPOST("firstname",'alpha'); + $gender=GETPOST("gender",'alpha'); $societe=GETPOST("societe",'alpha'); $address=GETPOST("address",'alpha'); $zip=GETPOST("zipcode",'alpha'); @@ -462,6 +465,7 @@ if (empty($reshook)) $object->civility_id = $civility_id; $object->firstname = $firstname; $object->lastname = $lastname; + $object->gender = $gender; $object->societe = $societe; $object->address = $address; $object->zip = $zip; @@ -954,6 +958,13 @@ else print ''.$langs->trans("Firstname").''; print ''; + // Gender + print ''.$langs->trans("Gender").''; + print ''; + $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1); + print ''; + // EMail print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').''; @@ -1031,7 +1042,7 @@ else // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print '' . fieldLabel('Categories', 'memcars') . ''; + print '' .$form->editfieldkey("Categories", 'memcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%'); print ""; @@ -1154,7 +1165,7 @@ else print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; } - // Password + // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Password").'pass).'">'; @@ -1196,6 +1207,13 @@ else print ''.$langs->trans("Firstname").'firstname).'">'; print ''; + // Gender + print ''.$langs->trans("Gender").''; + print ''; + $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1); + print ''; + // Photo print ''.$langs->trans("Photo").''; print ''; @@ -1281,7 +1299,7 @@ else // Categories if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) { - print '' . fieldLabel('Categories', 'memcats') . ''; + print '' . $form->editfieldkey("Categories", 'memcats', '', $object, 0) . ''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); $c = new Categorie($db); @@ -1583,6 +1601,12 @@ else print ''.$langs->trans("Nature").''.$object->getmorphylib().''; print ''; + // Gender + print ''.$langs->trans("Gender").''; + print ''; + if ($object->gender) print $langs->trans("Gender".$object->gender); + print ''; + // Company print ''.$langs->trans("Company").''.$object->societe.''; @@ -1637,11 +1661,8 @@ else if (! empty($conf->societe->enabled)) { print ''; - print ''; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; - print '
'; - print $langs->trans("LinkedToDolibarrThirdParty"); - print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; + $editenable = $user->rights->adherent->creer; + print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable); print ''; if ($action == 'editthirdparty') { @@ -1675,19 +1696,8 @@ else // Login Dolibarr print ''; - print ''; - if ($action != 'editlogin' && $user->rights->adherent->creer) - { - print ''; - } - print '
'; - print $langs->trans("LinkedToDolibarrUser"); - print ''; - if ($user->rights->user->user->creer) - { - print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).''; - } - print '
'; + $editenable = $user->rights->adherent->creer && $user->rights->user->user->creer; + print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable); print ''; if ($action == 'editlogin') { @@ -1760,16 +1770,16 @@ else if ($object->statut >= 1) { if ($object->email) print '\n"; - else print '\n"; + else print '\n"; } else { - print '
'.$langs->trans("SendCardByMail")."
"; + print '
'.$langs->trans("SendCardByMail")."
"; } } else { - print '
'.$langs->trans("SendCardByMail")."
"; + print '
'.$langs->trans("SendCardByMail")."
"; }*/ // Modify @@ -1779,7 +1789,7 @@ else } else { - print '
'.$langs->trans("Modify").'
'; + print '
'.$langs->trans("Modify").'
'; } // Validate @@ -1791,7 +1801,7 @@ else } else { - print '
'.$langs->trans("Validate").'
'; + print '
'.$langs->trans("Validate").'
'; } } @@ -1804,7 +1814,7 @@ else } else { - print '
'.$langs->trans("Reenable")."
"; + print '
'.$langs->trans("Reenable")."
"; } } @@ -1817,7 +1827,7 @@ else } else { - print '
'.$langs->trans("Resiliate")."
"; + print '
'.$langs->trans("Resiliate")."
"; } } @@ -1827,11 +1837,11 @@ else if ($user->rights->societe->creer) { if ($object->statut != -1) print ''; - else print ''; + else print ''; } else { - print '
'.$langs->trans("CreateDolibarrThirdParty")."
"; + print '
'.$langs->trans("CreateDolibarrThirdParty")."
"; } } @@ -1841,11 +1851,11 @@ else if ($user->rights->user->user->creer) { if ($object->statut != -1) print ''; - else print ''; + else print ''; } else { - print '
'.$langs->trans("CreateDolibarrLogin")."
"; + print '
'.$langs->trans("CreateDolibarrLogin")."
"; } } @@ -1856,7 +1866,7 @@ else } else { - print '
'.$langs->trans("Delete")."
"; + print '
'.$langs->trans("Delete")."
"; } // Action SPIP diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index cee9ce36edd..c094ad23f3a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2017 Regis Houssin - * Copyright (C) 2014-2016 Alexandre Spangaro + * Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud @@ -175,6 +175,7 @@ class Adherent extends CommonObject public $datem; public $datevalid; + public $gender; public $birth; /** @@ -507,17 +508,18 @@ class Adherent extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".$this->email); // Clean parameters - $this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname); - $this->firstname=trim($this->firstname)?trim($this->firstname):trim($this->firstname); - $this->address=($this->address?$this->address:$this->address); - $this->zip=($this->zip?$this->zip:$this->zip); - $this->town=($this->town?$this->town:$this->town); - $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); - $this->state_id=($this->state_id > 0?$this->state_id:$this->state_id); + $this->lastname = trim($this->lastname)?trim($this->lastname):trim($this->lastname); + $this->firstname = trim($this->firstname)?trim($this->firstname):trim($this->firstname); + $this->gender = trim($this->gender); + $this->address = ($this->address?$this->address:$this->address); + $this->zip = ($this->zip?$this->zip:$this->zip); + $this->town = ($this->town?$this->town:$this->town); + $this->country_id = ($this->country_id > 0?$this->country_id:$this->country_id); + $this->state_id = ($this->state_id > 0?$this->state_id:$this->state_id); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname)); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname)); - $this->note_public=($this->note_public?$this->note_public:$this->note_public); - $this->note_private=($this->note_private?$this->note_private:$this->note_private); + $this->note_public = ($this->note_public?$this->note_public:$this->note_public); + $this->note_private = ($this->note_private?$this->note_private:$this->note_private); // Check parameters if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -533,6 +535,7 @@ class Adherent extends CommonObject $sql.= " civility = ".($this->civility_id?"'".$this->db->escape($this->civility_id)."'":"null"); $sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null"); $sql.= ", lastname = ".($this->lastname?"'".$this->db->escape($this->lastname)."'":"null"); + $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' $sql.= ", login = ".($this->login?"'".$this->db->escape($this->login)."'":"null"); $sql.= ", societe = ".($this->societe?"'".$this->db->escape($this->societe)."'":"null"); $sql.= ", fk_soc = ".($this->fk_soc > 0?$this->db->escape($this->fk_soc):"null"); @@ -639,15 +642,17 @@ class Adherent extends CommonObject $luser->civility_id=$this->civility_id; $luser->firstname=$this->firstname; $luser->lastname=$this->lastname; + $luser->gender=$this->gender; $luser->pass=$this->pass; $luser->societe_id=$this->societe; $luser->birth=$this->birth; - $luser->address=$this->address; - $luser->zip=$this->zip; - $luser->town=$this->town; - $luser->country_id=$this->country_id; - $luser->state_id=$this->state_id; + + $luser->address=$this->address; + $luser->zip=$this->zip; + $luser->town=$this->town; + $luser->country_id=$this->country_id; + $luser->state_id=$this->state_id; $luser->email=$this->email; $luser->skype=$this->skype; @@ -1179,7 +1184,7 @@ class Adherent extends CommonObject { global $langs; - $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, 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 = "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.photo, d.fk_adherent_type, d.morphy, d.entity,"; @@ -1226,6 +1231,7 @@ class Adherent extends CommonObject $this->civility_id = $obj->civility_id; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; + $this->gender = $obj->gender; $this->login = $obj->login; $this->societe = $obj->company; $this->company = $obj->company; @@ -2338,6 +2344,7 @@ class Adherent extends CommonObject $this->civility_id = 0; $this->lastname = 'DOLIBARR'; $this->firstname = 'SPECIMEN'; + $this->gender='man'; $this->login='dolibspec'; $this->pass='dolibspec'; $this->societe = 'Societe ABC'; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 8eb7109d9ed..b2b75010802 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2018 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 @@ -20,9 +21,9 @@ */ /** - * \file htdocs/adherents/list.php - * \ingroup member - * \brief Page to list all members of foundation + * \file htdocs/adherents/list.php + * \ingroup member + * \brief Page to list all members of foundation */ require '../main.inc.php'; @@ -48,6 +49,7 @@ $search=GETPOST("search",'alpha'); $search_ref=GETPOST("search_ref",'alpha'); $search_lastname=GETPOST("search_lastname",'alpha'); $search_firstname=GETPOST("search_firstname",'alpha'); +$search_gender=GETPOST("search_gender",'alpha'); $search_civility=GETPOST("search_civility",'alpha'); $search_login=GETPOST("search_login",'alpha'); $search_address=GETPOST("search_address",'alpha'); @@ -110,6 +112,7 @@ $arrayfields=array( 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'd.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), 'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), 'd.morphy'=>array('label'=>$langs->trans("MorPhy"), 'checked'=>1), @@ -163,6 +166,7 @@ if (empty($reshook)) $search_ref=""; $search_lastname=""; $search_firstname=""; + $search_gender=""; $search_civility=""; $search_login=""; $search_company=""; @@ -206,7 +210,7 @@ $memberstatic=new Adherent($db); $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,"; +$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,"; $sql.= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; $sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; @@ -241,6 +245,7 @@ if ($search_ref) if ($search_civility) $sql.= natural_search("d.civility", $search_civility); if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname); if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname); +if ($search_gender != '' && $search_gender != '-1') $sql.= " AND d.gender = '".$search_gender."'"; if ($search_login) $sql.= natural_search("d.login", $search_login); if ($search_email) $sql.= natural_search("d.email", $search_email); if ($search_town) $sql.= natural_search("d.town",$search_town); @@ -330,6 +335,7 @@ if ($search_nom) $param.="&search_nom=".urlencode($search_nom); if ($search_civility) $param.="&search_civility=".urlencode($search_civility); if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); +if ($search_gender) $param.="&search_gender=".urlencode($search_gender); if ($search_login) $param.="&search_login=".urlencode($search_login); if ($search_email) $param.="&search_email=".urlencode($search_email); if ($search_company) $param.="&search_company=".urlencode($search_company); @@ -448,6 +454,13 @@ if (! empty($arrayfields['d.lastname']['checked'])) print ''; print ''; } +if (! empty($arrayfields['d.gender']['checked'])) +{ + print ''; + $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('search_gender', $arraygender, $search_gender, 1); + print ''; +} if (! empty($arrayfields['d.company']['checked'])) { print ''; @@ -576,6 +589,7 @@ if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titr if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['d.gender']['checked'])) print_liste_field_titre($arrayfields['d.gender']['label'],$_SERVER['PHP_SELF'],'d.gender',$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder); @@ -615,6 +629,7 @@ while ($i < min($num, $limit)) $memberstatic->civility_id=$obj->civility; $memberstatic->lastname=$obj->lastname; $memberstatic->firstname=$obj->firstname; + $memberstatic->gender=$obj->gender; $memberstatic->statut=$obj->statut; $memberstatic->datefin= $datefin; $memberstatic->socid = $obj->fk_soc; @@ -668,6 +683,14 @@ while ($i < min($num, $limit)) print "\n"; if (! $i) $totalarray['nbfield']++; } + // Gender + if (! empty($arrayfields['d.gender']['checked'])) + { + print ''; + if ($obj->gender) print $langs->trans("Gender".$obj->gender); + print ''; + if (! $i) $totalarray['nbfield']++; + } // Company if (! empty($arrayfields['d.company']['checked'])) { diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 5f7abe63253..04d175efa21 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -654,7 +654,7 @@ if ($rowid > 0) print '
'; if ($object->statut > 0) print '"; - else print ''; + else print ''; print '
'; } diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index e458bf093f6..c951f36db6e 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -368,7 +368,7 @@ if ($rowid && $action != 'edit') } else { - print '"; + print '"; } } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 46a11e363fd..683453023b9 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -241,17 +241,17 @@ if ($action == 'setforcedate') if ($action == 'setDefaultPDFModulesByType') { $invoicetypemodels = GETPOST('invoicetypemodels'); - + if(!empty($invoicetypemodels) && is_array($invoicetypemodels)) { $error = 0; - + foreach ($invoicetypemodels as $type => $value) { $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; } - + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -621,7 +621,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print ''.$langs->trans("Name").''; print ''; print "\n"; - + $listtype=array( Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), @@ -632,7 +632,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); } - + foreach ($listtype as $type => $trans) { $thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type; @@ -642,7 +642,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print ''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).''; print "\n"; } - + print ''; print ""; } @@ -698,7 +698,7 @@ if (! empty($conf->banque->enabled)) } else { - print "".$langs->trans("NoActiveBankAccountDefined").""; + print ''.$langs->trans("NoActiveBankAccountDefined").''; } } } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 3c6e6a14e6c..33b6d83e0da 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -735,7 +735,7 @@ else } else { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } print ''.$langs->trans("DoTestSend").''; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 7ce5add09a3..b8a4a85026b 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -509,7 +509,7 @@ else } else { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } print ''.$langs->trans("DoTestSend").''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 9fc4f46e54f..6d67cab60f9 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -432,7 +432,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) $sql = "SELECT u.rowid, u.lastname, u.firstname, u.fk_soc, u.email"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE entity IN (".getEntity('facture').")"; + $sql.= " WHERE entity IN (".getEntity('invoice').")"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 84570e75e2a..24a49f5d17d 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -258,7 +258,7 @@ else } else { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; }*/ if (count($listofmethods) && ! empty($conf->global->MAIN_SMS_SENDMODE)) @@ -267,7 +267,7 @@ else } else { - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; } print ''; diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 40b2a9365db..d8b8f3aa056 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -287,7 +287,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } if ($user->rights->asset->delete) @@ -296,7 +296,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 72356b1e97e..233fc6e6a22 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -189,7 +189,7 @@ if ($object->id) } else { - print ''; + print ''; print $langs->trans("AddPhoto").''; } } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 22648189f99..8d9e6c7d34f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1658,7 +1658,7 @@ if ($id > 0) } else { - print ''; + print ''; } if ($user->rights->agenda->allactions->create || @@ -1668,7 +1668,7 @@ if ($id > 0) } else { - print ''; + print ''; } if ($user->rights->agenda->allactions->delete || @@ -1678,7 +1678,7 @@ if ($id > 0) } else { - print ''; + print ''; } } } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4fba6aeec84..6f0848d0008 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1242,7 +1242,7 @@ if ($object->id > 0) { if ($object->status != 1) { - print ''; + print ''; } if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1) @@ -1282,7 +1282,7 @@ if ($object->id > 0) { if (empty($user->rights->facture->creer)) { - print ''; + print ''; } else { @@ -1294,13 +1294,13 @@ if ($object->id > 0) if ($object->client != 0 && $object->client != 2) { if (! empty($orders2invoice) && $orders2invoice > 0) print ''; - else print ''; + else print ''; } - else print ''; + else print ''; } if ($object->client != 0 && $object->client != 2) print ''; - else print ''; + else print ''; } } } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index a2a6f743db8..233f32d26be 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -995,7 +995,7 @@ else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) { - print ''.$langs->trans("TestMailing").''; + print ''.$langs->trans("TestMailing").''; } else { @@ -1006,11 +1006,11 @@ else { if ($object->nbemail <= 0) { - print ''.$langs->trans("ValidMailing").''; + print ''.$langs->trans("ValidMailing").''; } else if (empty($user->rights->mailing->valider)) { - print ''.$langs->trans("ValidMailing").''; + print ''.$langs->trans("ValidMailing").''; } else { @@ -1022,11 +1022,11 @@ else { if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { - print ''.$langs->trans("SendMailing").''; + print ''.$langs->trans("SendMailing").''; } else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) { - print ''.$langs->trans("SendMailing").''; + print ''.$langs->trans("SendMailing").''; } else { @@ -1043,7 +1043,7 @@ else { if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) { - print ''.$langs->trans("ResetMailing").''; + print ''.$langs->trans("ResetMailing").''; } else { @@ -1055,7 +1055,7 @@ else { if ($object->statut > 0 && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->delete)) { - print ''.$langs->trans("DeleteMailing").''; + print ''.$langs->trans("DeleteMailing").''; } else { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 0bd4bb3d0d7..326f133ecbb 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -10,8 +10,8 @@ * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2016 Marcos García + * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -696,6 +696,88 @@ if (empty($reshook)) } } } + + // add lines from objectlinked + elseif($action == 'import_lines_from_object' + && $user->rights->propal->creer + && $object->statut == Propal::STATUS_DRAFT + ) + { + $fromElement = GETPOST('fromelement'); + $fromElementid = GETPOST('fromelementid'); + $importLines = GETPOST('line_checkbox'); + + if(!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) + { + if($fromElement == 'commande') + { + dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); + $lineClassName = 'OrderLine'; + } + elseif($fromElement == 'propal') + { + dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); + $lineClassName = 'PropaleLigne'; + } + $nextRang = count($object->lines) + 1; + $importCount = 0; + $error = 0; + foreach($importLines as $lineId) + { + $lineId = intval($lineId); + $originLine = new $lineClassName($db); + if(intval($fromElementid) > 0 && $originLine->fetch( $lineId ) > 0) + { + $originLine->fetch_optionals($lineId); + $desc = $originLine->desc; + $pu_ht = $originLine->subprice; + $qty = $originLine->qty; + $txtva = $originLine->tva_tx; + $txlocaltax1 = $originLine->localtax1_tx; + $txlocaltax2 = $originLine->localtax2_tx; + $fk_product = $originLine->fk_product; + $remise_percent = $originLine->remise_percent; + $date_start = $originLine->date_start; + $date_end = $originLine->date_end; + $ventil = 0; + $info_bits = $originLine->info_bits; + $fk_remise_except = $originLine->fk_remise_except; + $price_base_type='HT'; + $pu_ttc=0; + $type = $originLine->product_type; + $rang=$nextRang++; + $special_code = $originLine->special_code; + $origin = $originLine->element; + $origin_id = $originLine->id; + $fk_parent_line=0; + $fk_fournprice=$originLine->fk_fournprice; + $pa_ht = $originLine->pa_ht; + $label = $originLine->label; + $array_options = $originLine->array_options; + $situation_percent = 100; + $fk_prev_id = ''; + $fk_unit = $originLine->fk_unit; + $pu_ht_devise = $originLine->multicurrency_subprice; + + $res = $object->addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, $rang, $special_code, $fk_parent_line, $fk_fournprice, $pa_ht, $label,$date_start, $date_end,$array_options, $fk_unit, $origin, $origin_id, $pu_ht_devise, $fk_remise_except); + + if($res > 0){ + $importCount++; + }else{ + $error++; + } + } + else{ + $error++; + } + } + + if($error) + { + setEventMessages($langs->trans('ErrorsOnXLines',$error), null, 'errors'); + } + } + } include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; @@ -959,7 +1041,7 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc); + $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add dimensions into product description /*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM)) @@ -1627,7 +1709,7 @@ if ($action == 'create') if (! empty($conf->multicurrency->enabled)) { print ''; - print ''.fieldLabel('Currency','multicurrency_code').''; + print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0); print ''; @@ -2118,7 +2200,7 @@ if ($action == 'create') print ''; print ''; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon) && $usercancreate) print ''; @@ -2135,7 +2217,7 @@ if ($action == 'create') print ''; print '"; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f123dd35eb5..d355fcc4900 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -417,7 +417,7 @@ if (empty($numref)) if ($user->rights->banque->consolidate) { print ''.$langs->trans("Conciliate").''; } else { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 0f417777417..d2adc857ec7 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -256,32 +256,32 @@ if ($action == 'create') // Date payment print ''; // Date value for bank print ''; // Label print ''; // Sens print ''; // Amount print ''; @@ -289,14 +289,14 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { print ''; } // Type payment print ''; @@ -489,12 +489,12 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; } diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 897f21422c8..eb875248488 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' restrictedArea($user,'banque'); -$langs->load("companies"); +$langs->load("accountancy"); if (! empty($conf->facture->enabled)) $langs->load("bills"); $date_start =GETPOST('date_start','alpha'); $date_startDay= GETPOST('date_startday','int'); @@ -218,98 +218,103 @@ if($result & $action=="dl"){ /* * View */ + + +llxHeader('',$title,$help_url); + +$h=0; +$head[$h][0] = $_SERVER["PHP_SELF"].$varlink; +$head[$h][1] = $langs->trans("AccountantFiles"); +$head[$h][2] = 'AccountantFiles'; +dol_fiche_head($head, 'AccountantFiles'); $form = new Form($db); $userstatic=new User($db); $title=$langs->trans("ComptaFiles").' - '.$langs->trans("List"); -//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Symmary"); -$help_url='EN:Module_Accounting|FR:Module_Compatibilite'; //FIXME -llxHeader('',$title,$help_url); print ''."\n\t\t"; -if (!empty($date_start) && !empty($date_stop))echo dol_print_date($date_start)." - ".dol_print_date($date_stop); -print '
'; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate) print ''; @@ -2243,17 +2325,17 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -2381,7 +2463,7 @@ if ($action == 'create') print ''; } else - print ''; + print ''; } // Create event /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. @@ -2404,7 +2486,7 @@ if ($action == 'create') if ($usercansend) { print ''; } else - print ''; + print ''; } // Create an order @@ -2488,7 +2570,13 @@ if ($action == 'create') // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('propal')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + $compatibleImportElementsList = false; + if($user->rights->propal->creer && $object->statut == Propal::STATUS_DRAFT) + { + $compatibleImportElementsList = array('commande','propal'); // import from linked elements + } + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); // Show online signature link $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 98ff1c45194..52a3a1562d3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -329,45 +329,9 @@ if ($viewstatut != '' && $viewstatut != '-1') { $sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; } -if ($search_month > 0) -{ - if ($search_year > 0 && empty($search_day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; - else if ($search_year > 0 && ! empty($search_day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; - else - $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($search_month)."'"; -} -else if ($search_year > 0) -{ - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; -} -if ($search_month_end > 0) -{ - if ($search_yearfin > 0 && empty($search_dayfin)) - $sql.= " AND p.fin_validite BETWEEN '".$db->idate(dol_get_first_day($search_yearfin,$search_month_end,false))."' AND '".$db->idate(dol_get_last_day($search_yearfin,$search_month_end,false))."'"; - else if ($search_yearfin > 0 && ! empty($search_dayfin)) - $sql.= " AND p.fin_validite BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_end, $search_dayfin, $search_yearfin))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_end, $search_dayfin, $search_yearfin))."'"; - else - $sql.= " AND date_format(p.fin_validite, '%m') = '".$db->escape($search_month_end)."'"; -} -else if ($search_yearfin > 0) -{ - $sql.= " AND p.fin_validite BETWEEN '".$db->idate(dol_get_first_day($search_yearfin,1,false))."' AND '".$db->idate(dol_get_last_day($search_yearfin,12,false))."'"; -} -if ($search_monthdelivery > 0) -{ - if ($search_yeardelivery > 0 && empty($search_daydelivery)) - $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_yeardelivery,$search_monthdelivery,false))."' AND '".$db->idate(dol_get_last_day($search_yeardelivery,$search_monthdelivery,false))."'"; - else if ($search_yeardelivery > 0 && ! empty($search_daydelivery)) - $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_monthdelivery, $search_daydelivery, $search_yeardelivery))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_monthdelivery, $search_daydelivery, $search_yeardelivery))."'"; - else - $sql.= " AND date_format(p.date_livraison, '%m') = '".$db->escape($search_monthdelivery)."'"; -} -else if ($search_yeardelivery > 0) -{ - $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_yeardelivery,1,false))."' AND '".$db->idate(dol_get_last_day($search_yeardelivery,12,false))."'"; -} +$sql.= dolSqlDateFilter("p.datep", $search_day, $search_month, $search_year); +$sql.= dolSqlDateFilter("p.fin_validite", $search_dayfin, $search_month_end, $search_yearfin); +$sql.= dolSqlDateFilter("p.date_livraison", $search_daydelivery, $search_monthdelivery, $search_yeardelivery); if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale); if ($search_user > 0) { @@ -462,6 +426,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 978bc5aa04a..400970f8eba 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -106,7 +106,8 @@ $permissionedit = $user->rights->commande->creer; // Used by the include of ac */ $parameters = array('socid' => $socid); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +// Note that $action and $object may be modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -419,10 +420,11 @@ if (empty($reshook)) // Hooks $parameters = array('objFrom' => $srcobject); - $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook - if ($reshook < 0) + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); + if ($reshook < 0) { $error++; + } } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -866,7 +868,7 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc); + $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -1318,6 +1320,88 @@ if (empty($reshook)) exit(); } + // add lines from objectlinked + if($action == 'import_lines_from_object' + && $user->rights->commande->creer + && $object->statut == Commande::STATUS_DRAFT + ) + { + $fromElement = GETPOST('fromelement'); + $fromElementid = GETPOST('fromelementid'); + $importLines = GETPOST('line_checkbox'); + + if(!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) + { + if($fromElement == 'commande') + { + dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); + $lineClassName = 'OrderLine'; + } + elseif($fromElement == 'propal') + { + dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); + $lineClassName = 'PropaleLigne'; + } + $nextRang = count($object->lines) + 1; + $importCount = 0; + $error = 0; + foreach($importLines as $lineId) + { + $lineId = intval($lineId); + $originLine = new $lineClassName($db); + if(intval($fromElementid) > 0 && $originLine->fetch( $lineId ) > 0) + { + $originLine->fetch_optionals($lineId); + $desc = $originLine->desc; + $pu_ht = $originLine->subprice; + $qty = $originLine->qty; + $txtva = $originLine->tva_tx; + $txlocaltax1 = $originLine->localtax1_tx; + $txlocaltax2 = $originLine->localtax2_tx; + $fk_product = $originLine->fk_product; + $remise_percent = $originLine->remise_percent; + $date_start = $originLine->date_start; + $date_end = $originLine->date_end; + $ventil = 0; + $info_bits = $originLine->info_bits; + $fk_remise_except = $originLine->fk_remise_except; + $price_base_type='HT'; + $pu_ttc=0; + $type = $originLine->product_type; + $rang=$nextRang++; + $special_code = $originLine->special_code; + $origin = $originLine->element; + $origin_id = $originLine->id; + $fk_parent_line=0; + $fk_fournprice=$originLine->fk_fournprice; + $pa_ht = $originLine->pa_ht; + $label = $originLine->label; + $array_options = $originLine->array_options; + $situation_percent = 100; + $fk_prev_id = ''; + $fk_unit = $originLine->fk_unit; + $pu_ht_devise = $originLine->multicurrency_subprice; + + $res = $object->addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $info_bits, $fk_remise_except, $price_base_type, $pu_ttc, $date_start, $date_end, $type, $rang, $special_code, $fk_parent_line, $fk_fournprice, $pa_ht, $label,$array_options, $fk_unit, $origin, $origin_id, $pu_ht_devise); + + if($res > 0){ + $importCount++; + }else{ + $error++; + } + } + else{ + $error++; + } + } + + if($error) + { + setEventMessages($langs->trans('ErrorsOnXLines',$error), null, 'errors'); + } + } + } + // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; @@ -1669,7 +1753,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Other attributes $parameters = array('objectsrc' => $objectsrc, 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); print $hookmanager->resPrint; if (empty($reshook)) { print $object->showOptionals($extrafields, 'edit'); @@ -1687,7 +1772,7 @@ if ($action == 'create' && $user->rights->commande->creer) if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1969,7 +2054,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Call Hook formConfirm $parameters = array('lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; @@ -2074,13 +2160,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Date print ''; print ''; print ''; // Source reason (why we have an ordrer) - print ''; print ''; } - if ($totalVolume) - { + if ($totalVolume) { print ''; print ''; print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -2446,12 +2476,11 @@ if ($action == 'create' && $user->rights->commande->creer) */ $result = $object->getLinesArray(); - print ' + print ' - - '; + '; if (! empty($conf->use_javascript_ajax) && $object->statut == Commande::STATUS_DRAFT) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; @@ -2477,7 +2506,8 @@ if ($action == 'create' && $user->rights->commande->creer) $object->formAddObjectLine(1, $mysoc, $soc); $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); } } print '
'; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
'; - print ''; - - if ($action != 'editdate' && $object->brouillon) - print ''; - print '
'; - print $langs->trans('Date'); - print 'id . '">' . img_edit($langs->trans('SetDate'), 1) . '
'; + $editenable = $user->rights->commande->creer && $object->statut == Commande::STATUS_DRAFT; + print $form->editfieldkey("Date", 'date', '', $object, $editenable); print '
'; if ($action == 'editdate') { print '
'; @@ -2100,12 +2181,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Delivery date planed print '
'; - print ''; - if ($action != 'editdate_livraison') - print ''; - print '
'; - print $langs->trans('DateDeliveryPlanned'); - print 'id . '">' . img_edit($langs->trans('SetDeliveryDate'), 1) . '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("DateDeliveryPlanned", 'date_livraison', '', $object, $editenable); print '
'; if ($action == 'editdate_livraison') { print ''; @@ -2125,13 +2202,9 @@ if ($action == 'create' && $user->rights->commande->creer) // Shipping Method if (! empty($conf->expedition->enabled)) { - print '
'; - print ''; - if ($action != 'editshippingmethod' && $user->rights->commande->creer) - print ''; - print '
'; - print $langs->trans('SendingMethod'); - print 'id.'">'.img_edit($langs->trans('SetShippingMode'),1).'
'; + print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable); print ''; if ($action == 'editshippingmethod') { $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1); @@ -2144,15 +2217,12 @@ if ($action == 'create' && $user->rights->commande->creer) // Warehouse if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + $langs->load('stocks'); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct=new FormProduct($db); print '
'; - print ''; - if ($action != 'editwarehouse' && $user->rights->commande->creer) - print ''; - print '
'; - print $langs->trans('Warehouse'); - print 'id.'">'.img_edit($langs->trans('SetWarehouse'),1).'
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable); print '
'; if ($action == 'editwarehouse') { $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1); @@ -2165,12 +2235,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Terms of payment print '
'; - print ''; - if ($action != 'editconditions') - print ''; - print '
'; - print $langs->trans('PaymentConditionsShort'); - print 'id . '">' . img_edit($langs->trans('SetConditions'), 1) . '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("PaymentConditionsShort", 'conditions', '', $object, $editenable); print '
'; if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id', 1); @@ -2183,12 +2249,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Mode of payment print '
'; - print ''; - if ($action != 'editmode') - print ''; - print '
'; - print $langs->trans('PaymentMode'); - print 'id . '">' . img_edit($langs->trans('SetMode'), 1) . '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("PaymentMode", 'mode', '', $object, $editenable); print '
'; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT'); @@ -2203,12 +2265,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Multicurrency code print '
'; - print ''; - if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) - print ''; - print '
'; - print fieldLabel('Currency','multicurrency_code'); - print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; + $editenable = $user->rights->commande->creer && $object->statut == Commande::STATUS_DRAFT; + print $form->editfieldkey("Currency", 'multicurrencycode', '', $object, $editenable); print '
'; if ($action == 'editmulticurrencycode') { $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'multicurrency_code'); @@ -2220,12 +2278,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Multicurrency rate print '
'; - print ''; - if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) - print ''; - print '
'; - print fieldLabel('CurrencyRate','multicurrency_tx'); - print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; + $editenable = $user->rights->commande->creer && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $object->statut == Commande::STATUS_DRAFT; + print $form->editfieldkey("CurrencyRate", 'multicurrencyrate', '', $object, $editenable); print '
'; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { if($action == 'actualizemulticurrencyrate') { @@ -2244,13 +2298,9 @@ if ($action == 'create' && $user->rights->commande->creer) } // Delivery delay - print '
'; - print ''; - if ($action != 'editavailability') - print ''; - print '
'; - print $langs->trans('AvailabilityPeriod'); - print 'id . '">' . img_edit($langs->trans('SetAvailability'), 1) . '
'; + print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, $editenable); print ''; if ($action == 'editavailability') { $form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->availability_id, 'availability_id', 1); @@ -2260,13 +2310,9 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'; - print ''; - if ($action != 'editdemandreason') - print ''; - print '
'; - print $langs->trans('Channel'); - print 'id . '">' . img_edit($langs->trans('SetDemandReason'), 1) . '
'; + print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("Channel", 'demandreason', '', $object, $editenable); print ''; if ($action == 'editdemandreason') { $form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->demand_reason_id, 'demand_reason_id', 1); @@ -2277,13 +2323,9 @@ if ($action == 'create' && $user->rights->commande->creer) // TODO Order mode (how we receive order). Not yet implemented /* - print '
'; - print ''; - if ($action != 'editinputmode') - print ''; - print '
'; - print $langs->trans('SourceMode'); - print 'id . '">' . img_edit($langs->trans('SetInputMode'), 1) . '
'; + print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("SourceMode", 'inputmode', '', $object, $editenable); print ''; if ($action == 'editinputmode') { $form->formInputMode($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->source, 'input_mode_id', 1); @@ -2296,15 +2338,13 @@ if ($action == 'create' && $user->rights->commande->creer) $tmparray=$object->getTotalWeightVolume(); $totalWeight=$tmparray['weight']; $totalVolume=$tmparray['volume']; - if ($totalWeight) - { + if ($totalWeight) { print '
'.$langs->trans("CalculatedWeight").''; print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); print '
'.$langs->trans("CalculatedVolume").''; print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); @@ -2314,15 +2354,10 @@ if ($action == 'create' && $user->rights->commande->creer) // TODO How record was recorded OrderMode (llx_c_input_method) // Incoterms - if (!empty($conf->incoterm->enabled)) - { + if (!empty($conf->incoterm->enabled)) { print '
'; - print '
'; - print $langs->trans('IncotermLabel'); - print ''; - if ($user->rights->commande->creer) print ''.img_edit().''; - else print ' '; - print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("IncotermLabel", 'incoterm', '', $object, $editenable); print '
'; if ($action != 'editincoterm') @@ -2337,15 +2372,10 @@ if ($action == 'create' && $user->rights->commande->creer) } // Bank Account - if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) - { - print '
'; - print ''; - print '
'; - print $langs->trans('BankAccount'); - print ''; - if ($action != 'editbankaccount' && $user->rights->commande->creer) - print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) { + print '
'; + $editenable = $user->rights->commande->creer; + print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable); print ''; if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); @@ -2371,17 +2401,17 @@ if ($action == 'create' && $user->rights->commande->creer) if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'; @@ -2494,15 +2524,15 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'; $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { // Send if ($object->statut > Commande::STATUS_DRAFT) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { print ''; } else - print ''; + print ''; } // Valid @@ -2518,10 +2548,11 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a - // "workflow" action so should appears somewhere else on - // page. + /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) { + // Add hidden condition because this is not a + // "workflow" action so should appears somewhere else on + // page. print '' . $langs->trans("AddAction") . ''; }*/ @@ -2533,7 +2564,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($user->rights->ficheinter->creer) { print ''; } else { - print ''; + print ''; } } } @@ -2557,11 +2588,11 @@ if ($action == 'create' && $user->rights->commande->creer) if ($user->rights->expedition->creer) { print ''; } else { - print ''; + print ''; } } else { $langs->load("errors"); - print ''; + print ''; } } } @@ -2610,7 +2641,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($numshipping == 0) { print ''; } else { - print ''; + print ''; } } } @@ -2638,7 +2669,14 @@ if ($action == 'create' && $user->rights->commande->creer) // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + $compatibleImportElementsList = false; + if($user->rights->commande->creer + && $object->statut == Commande::STATUS_DRAFT) + { + $compatibleImportElementsList = array('commande','propal'); // import from linked elements + } + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem,$compatibleImportElementsList); // Show online payment link $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5b3f8006345..3292d8fc3e6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4023,9 +4023,9 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 si ko, >0 si ok */ - function delete($user=null, $notrigger=0) + function delete(User $user, $notrigger=0) { - global $conf, $user, $langs; + global $conf, $langs; $error=0; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f26d7b86b44..a5ff8bf0dc8 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -10,6 +10,8 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2018 Charlene Benke + * * 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 @@ -301,32 +303,8 @@ if ($viewstatut <> '') $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed } } -if ($search_ordermonth > 0) -{ - if ($search_orderyear > 0 && empty($search_orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,$search_ordermonth,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,$search_ordermonth,false))."'"; - else if ($search_orderyear > 0 && ! empty($search_orderday)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_ordermonth, $search_orderday, $search_orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_ordermonth, $search_orderday, $search_orderyear))."'"; - else - $sql.= " AND date_format(c.date_commande, '%m') = '".$search_ordermonth."'"; -} -else if ($search_orderyear > 0) -{ - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,12,false))."'"; -} -if ($search_deliverymonth > 0) -{ - if ($search_deliveryyear > 0 && empty($search_deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,$search_deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,$search_deliverymonth,false))."'"; - else if ($search_deliveryyear > 0 && ! empty($search_deliveryday)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."'"; - else - $sql.= " AND date_format(c.date_livraison, '%m') = '".$search_deliverymonth."'"; -} -else if ($search_deliveryyear > 0) -{ - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,12,false))."'"; -} +$sql.= dolSqlDateFilter("c.date_commande", $search_orderday, $search_ordermonth, $search_orderyear); +$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); @@ -449,6 +427,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), 'cancelorders'=>$langs->trans("Cancel"), diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 4b9f55f025f..c77f99ba667 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -596,7 +596,7 @@ if ($result) $langs->load('categories'); // Bank line - print '
' . fieldLabel('RubriquesTransactions', 'custcats') . ''; + print '
' . $form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%"); print "
'; - print fieldLabel('DatePayment','datep',1).''; + print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; print $form->selectDate((empty($datep)?-1:$datep),"datep",'','','','add',1,1); print '
'; - print fieldLabel('DateValue','datev',0).''; + print $form->editfieldkey('DateValue', 'datev', '', $object, 0).''; print $form->selectDate((empty($datev)?-1:$datev),"datev",'','','','add',1,1); print '
'; - print fieldLabel('Label','label',1).''; + print $form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).''; print ''; print '
'; - print fieldLabel('Sens','sens',1).''; + print $form->editfieldkey('Sens', 'sens', '', $object, 0, 'string', '', 1).''; $sensarray=array( '0' => $langs->trans("Debit"), '1' => $langs->trans("Credit")); print $form->selectarray('sens',$sensarray,$sens); print '
'; - print fieldLabel('Amount','amount',1).''; + print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; print ''; print '
'; - print fieldLabel('BankAccount','selectaccountid',1).''; + print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; $form->select_comptes($accountid,"accountid",0,'',1); // Affiche liste des comptes courant print '
'; - print fieldLabel('PaymentMode','selectpaymenttype',1).''; + print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; $form->select_types_paiements($paymenttype, "paymenttype"); print '
'; -print ''; -//if (! empty($arrayfields['f.datef']['checked'])) -print_liste_field_titre($arrayfields['date']['label'],$_SERVER["PHP_SELF"],"date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -if ($result) -{ - $TData = dol_sort_array($filesarray, 'date', 'ASC'); - if(empty($TData)) { - print ''; - } else { - // Sort array by date ASC to calucalte balance +print ''.$langs->trans("ReportPeriod").': '.$form->select_date($date_start,'date_start',0,0,0,"",1,1,1); +print ' - '.$form->select_date($date_stop,'date_stop',0,0,0,"",1,1,1)."\n"; +print ''."\n\t\t"; +if (!empty($date_start) && !empty($date_stop)){ + echo dol_print_date($date_start)." - ".dol_print_date($date_stop); + print '
'.$langs->trans("Type").''.$langs->trans("Ref").''.$langs->trans("File").''.$langs->trans("Paid").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").'
'.$langs->trans("NoItem").'
'; + print ''; + print_liste_field_titre($arrayfields['date']['label'],$_SERVER["PHP_SELF"],"date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($result) + { + $TData = dol_sort_array($filesarray, 'date', 'ASC'); + if(empty($TData)) { + print ''; + } else { + // Sort array by date ASC to calucalte balance - $totalDebit = 0; - $totalCredit = 0; - // Balance calculation - $balance = 0; - foreach($TData as &$data1) { - if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){ - $data1['amount']=-$data1['amount']; - } - if ($data1['amount']>0){ - }else{ - } - $balance += $data1['amount']; - $data1['balance'] = $balance; - } - // Display array - foreach($TData as $data) { - $html_class = ''; - //if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture']; - //elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement']; - print ''; - print "\n"; - print ''; - print ''; - print '\n"; - print ''; - print '\n"; - $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; - print '\n"; - $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); - // Balance - print '\n"; - print "\n"; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - } -print "
'.$langs->trans("Type").''.$langs->trans("Ref").''.$langs->trans("File").''.$langs->trans("Paid").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").'
'.$langs->trans("NoItem").'
"; - print dol_print_date($data['date'],'day'); - print "'.$data['item'].''.$data['ref'].' ".$data['name']."'.$data['paid'].''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.price($data['balance'])."
 '.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).'
"; -print '
'."\n\t\t\t"; + $totalDebit = 0; + $totalCredit = 0; + // Balance calculation + $balance = 0; + foreach($TData as &$data1) { + if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){ + $data1['amount']=-$data1['amount']; + } + if ($data1['amount']>0){ + }else{ + } + $balance += $data1['amount']; + $data1['balance'] = $balance; + } + // Display array + foreach($TData as $data) { + $html_class = ''; + //if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture']; + //elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement']; + print ''; + print ""; + print dol_print_date($data['date'],'day'); + print "\n"; + print ''.$data['item'].''; + print ''.$data['ref'].''; + print ' ".$data['name']."\n"; + print ''.$data['paid'].''; + print ''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."\n"; + $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; + print ''.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."\n"; + $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); + // Balance + print ''.price($data['balance'])."\n"; + print "\n"; + } + print ''; + print ' '; + print ''.price($totalDebit).''; + print ''.price($totalCredit).''; + print ''.price(price2num($totalDebit - $totalCredit, 'MT')).''; + print ''; + print "\n"; + } + } + print ""; + print ''."\n\t\t\t"; -print ''; -print ''; + print ''; + print ''; -//print ''; -//print ''; -//print ''; + //print ''; + //print ''; + //print ''; -//print ''; -//print ''; -//print ''; - - -print '
'."\n\t\t\n\t\t\n\t\t\t"; + //print ''; + //print ''; + //print ''; + print ''."\n\t\t\n\t\t\n\t\t\t"; +} llxFooter(); diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index b213bd25061..922df54c147 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -531,7 +531,7 @@ else if ($id) } else { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } } @@ -543,7 +543,7 @@ else if ($id) } else { - print ''.$langs->trans('Validate').''; + print ''.$langs->trans('Validate').''; } } @@ -555,7 +555,7 @@ else if ($id) } else { - print ''.$langs->trans('ClassifyRefunded').''; + print ''.$langs->trans('ClassifyRefunded').''; } } @@ -565,7 +565,7 @@ else if ($id) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 3dfbac0e726..d6d599d7ece 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 charlene Benke * * 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 @@ -55,6 +56,7 @@ if (! $sortfield) $sortfield="d.dated"; $year=GETPOST("year"); $month=GETPOST("month"); +$day=GETPOST("day"); if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers { @@ -64,6 +66,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','a // $search_amount=""; $year=""; $month=""; + $day=""; } /* @@ -102,20 +105,7 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } -// if ($search_amount) $sql.=" AND d.km='".$db->escape(price2num(trim($search_amount)))."'"; -if ($month > 0) -{ - if ($year > 0 && empty($day)) - $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND d.dated BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; - else - $sql.= " AND date_format(d.dated, '%m') = '".$month."'"; -} -else if ($year > 0) -{ - $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; -} +$sql.= dolSqlDateFilter("d.dated", $day, $month, $year); $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f8dd8e377f7..c803046724e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -133,7 +133,6 @@ if ($user->societe_id) $socid = $user->societe_id; $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); - /* * Actions */ @@ -739,7 +738,7 @@ if (empty($reshook)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; $sql.= ' WHERE pf.fk_facture = '.$object->id; $sql.= ' AND pf.fk_paiement = p.rowid'; - $sql.= ' AND p.entity IN (' . getEntity('facture').')'; + $sql.= ' AND p.entity IN (' . getEntity('invoice').')'; $resql = $db->query($sql); if (! $resql) dol_print_error($db); @@ -1916,7 +1915,7 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc); + $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -3213,7 +3212,7 @@ if ($action == 'create') if (! empty($conf->multicurrency->enabled)) { print ''; - print ''.fieldLabel('Currency','multicurrency_code').''; + print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print ''; @@ -3915,7 +3914,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -3928,7 +3927,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print '
'; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print ''; if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -4014,17 +4013,17 @@ else if ($id > 0 || ! empty($ref)) if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -4281,7 +4280,7 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND pf.fk_paiement = p.rowid'; - $sql .= ' AND p.entity IN (' . getEntity('facture').')'; + $sql .= ' AND p.entity IN (' . getEntity('invoice').')'; $sql .= ' ORDER BY p.datep, p.tms'; $result = $db->query($sql); @@ -4628,18 +4627,18 @@ else if ($id > 0 || ! empty($ref)) { print ''; } else { - print '
' . $langs->trans('Modify') . '
'; + print '
' . $langs->trans('Modify') . '
'; } } else if (!$object->is_last_in_cycle()) { - print '
' . $langs->trans('Modify') . '
'; + print '
' . $langs->trans('Modify') . '
'; } else { - print '
' . $langs->trans('Modify') . '
'; + print '
' . $langs->trans('Modify') . '
'; } } } else { - print '
' . $langs->trans('Modify') . '
'; + print '
' . $langs->trans('Modify') . '
'; } } @@ -4657,7 +4656,7 @@ else if ($id > 0 || ! empty($ref)) { print ''; } else { - print '
' . $langs->trans('ReOpen') . '
'; + print '
' . $langs->trans('ReOpen') . '
'; } } @@ -4672,12 +4671,12 @@ else if ($id > 0 || ! empty($ref)) // Send by mail if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || ! empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($objectidnext) { - print '
' . $langs->trans('SendMail') . '
'; + print '
' . $langs->trans('SendMail') . '
'; } else { if ($usercansend) { print ''; } else - print ''; + print ''; } } @@ -4692,27 +4691,27 @@ else if ($id > 0 || ! empty($ref)) { print ''.$langs->trans("MakeWithdrawRequest").''; } else { - print '
' . $langs->trans('MakeWithdrawRequest') . '
'; + print '
' . $langs->trans('MakeWithdrawRequest') . '
'; } } else { - //print ''.$langs->trans("MakeWithdrawRequest").''; + //print ''.$langs->trans("MakeWithdrawRequest").''; } } else { - //print ''.$langs->trans("MakeWithdrawRequest").''; + //print ''.$langs->trans("MakeWithdrawRequest").''; } } // Create payment if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercanissuepayment) { if ($objectidnext) { - print '
' . $langs->trans('DoPayment') . '
'; + print '
' . $langs->trans('DoPayment') . '
'; } else { //if ($resteapayer == 0) { // Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done) - // print '
' . $langs->trans('DoPayment') . '
'; + // print '
' . $langs->trans('DoPayment') . '
'; //} else { print ''; //} @@ -4726,7 +4725,7 @@ else if ($id > 0 || ! empty($ref)) { if ($resteapayer == 0) { - print '
'.$langs->trans('DoPaymentBack').'
'; + print '
'.$langs->trans('DoPaymentBack').'
'; } else { @@ -4773,7 +4772,7 @@ else if ($id > 0 || ! empty($ref)) { if ($objectidnext) { - print '
' . $langs->trans('ClassifyCanceled') . '
'; + print '
' . $langs->trans('ClassifyCanceled') . '
'; } else { @@ -4820,7 +4819,7 @@ else if ($id > 0 || ! empty($ref)) { print ''; } else { - print '
' . $langs->trans("CreateCreditNote") . '
'; + print '
' . $langs->trans("CreateCreditNote") . '
'; } } @@ -4840,7 +4839,7 @@ else if ($id > 0 || ! empty($ref)) } else { - print ''; + print ''; } } @@ -4849,9 +4848,9 @@ else if ($id > 0 || ! empty($ref)) if ($object->is_last_in_cycle() && $object->situation_final != 1) { print ''; } else if (!$object->is_last_in_cycle()) { - print ''; + print ''; } else { - print ''; + print ''; } } @@ -4861,31 +4860,31 @@ else if ($id > 0 || ! empty($ref)) { //var_dump($isErasable); if ($isErasable == -4) { - print ''; + print ''; } elseif ($isErasable == -3) { - print ''; + print ''; } elseif ($isErasable == -2) { - print ''; + print ''; } elseif ($isErasable == -1) { - print ''; + print ''; } elseif ($isErasable <= 0) // Any other cases { - print ''; + print ''; } elseif ($objectidnext) { - print ''; + print ''; } else { print ''; } } else { - print ''; + print ''; } } print ''; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 5075d9d8cb7..1e6b1d35a8e 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -123,7 +123,7 @@ class Invoices extends DolibarrApi if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale - $sql.= ' WHERE t.entity IN ('.getEntity('facture').')'; + $sql.= ' WHERE t.entity IN ('.getEntity('invoice').')'; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 56f87d2eac3..5090132632e 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -340,7 +340,7 @@ class FactureRec extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; - $sql.= ' WHERE f.entity IN ('.getEntity('facture').')'; + $sql.= ' WHERE f.entity IN ('.getEntity('invoice').')'; if ($rowid) $sql.= ' AND f.rowid='.$rowid; elseif ($ref) $sql.= " AND f.titre='".$this->db->escape($ref)."'"; /* This field are not used for template invoice @@ -998,26 +998,25 @@ class FactureRec extends CommonInvoice * * WARNING: This method change temporarly context $conf->entity to be in correct context for each recurring invoice found. * - * @param int $restictoninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID + * @param int $restrictioninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID * @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag. * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function createRecurringInvoices($restictoninvoiceid=0, $forcevalidation=0) + function createRecurringInvoices($restrictioninvoiceid=0, $forcevalidation=0) { - global $conf, $langs, $db, $user; + global $conf, $langs, $db, $user, $hookmanager; $error=0; + $nb_create=0; // Load translation files required by the page - $langs->loadLangs(array("main","bills")); - - $nb_create=0; + $langs->loadLangs(array("main","bills")); $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day - dol_syslog("createRecurringInvoices restictoninvoiceid=".$restictoninvoiceid." forcevalidation=".$forcevalidation); + dol_syslog("createRecurringInvoices restrictioninvoiceid=".$restrictioninvoiceid." forcevalidation=".$forcevalidation); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; $sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency @@ -1025,30 +1024,39 @@ class FactureRec extends CommonInvoice $sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; $sql.= ' AND suspended = 0'; $sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here - if ($restictoninvoiceid > 0) $sql.=' AND rowid = '.$restictoninvoiceid; + if ($restrictioninvoiceid > 0) + $sql.=' AND rowid = '.$restrictioninvoiceid; $sql.= $db->order('entity', 'ASC'); //print $sql;exit; + $parameters = array( + 'restrictioninvoiceid' => $restrictioninvoiceid, + 'forcevalidation' => $forcevalidation, + ); + $reshook = $hookmanager->executeHooks('beforeCreationOfRecurringInvoices', $parameters, $sql); // note that $sql might be modified by hooks $resql = $db->query($sql); if ($resql) { - $i=0; - $num = $db->num_rows($resql); + $i=0; + $num = $db->num_rows($resql); - if ($num) $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; - else $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); + if ($num) + $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; + else + $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); - $saventity = $conf->entity; + $saventity = $conf->entity; - while ($i < $num) // Loop on each template invoice. If $num = 0, test is false at first pass. + while ($i < $num) // Loop on each template invoice. If $num = 0, test is false at first pass. { $line = $db->fetch_object($resql); - $db->begin(); + $db->begin(); - $invoiceidgenerated = 0; + $invoiceidgenerated = 0; - $facturerec = new FactureRec($db); + $facture = null; + $facturerec = new FactureRec($db); $facturerec->fetch($line->rowid); if ($facturerec->id > 0) @@ -1058,44 +1066,44 @@ class FactureRec extends CommonInvoice dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); - $facture = new Facture($db); + $facture = new Facture($db); $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice - $facture->type = self::TYPE_STANDARD; - $facture->brouillon = 1; - $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. - $facture->socid = $facturerec->socid; + $facture->type = self::TYPE_STANDARD; + $facture->brouillon = 1; + $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. + $facture->socid = $facturerec->socid; - $invoiceidgenerated = $facture->create($user); - if ($invoiceidgenerated <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - if (! $error && ($facturerec->auto_validate || $forcevalidation)) - { - $result = $facture->validate($user); - if ($result <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - } - if (! $error && $facturerec->generate_pdf) - { - // We refresh the object in order to have all necessary data (like date_lim_reglement) - $facture->fetch($facture->id); - $result = $facture->generateDocument($facturerec->modelpdf, $langs); - if ($result <= 0) - { - $this->errors = $facture->errors; - $this->error = $facture->error; - $error++; - } - } + $invoiceidgenerated = $facture->create($user); + if ($invoiceidgenerated <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + if (! $error && ($facturerec->auto_validate || $forcevalidation)) + { + $result = $facture->validate($user); + if ($result <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + } + if (! $error && $facturerec->generate_pdf) + { + // We refresh the object in order to have all necessary data (like date_lim_reglement) + $facture->fetch($facture->id); + $result = $facture->generateDocument($facturerec->modelpdf, $langs); + if ($result <= 0) + { + $this->errors = $facture->errors; + $this->error = $facture->error; + $error++; + } + } } else { @@ -1114,9 +1122,19 @@ class FactureRec extends CommonInvoice } else { - $db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); + $db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); } + $parameters = array( + 'cpt' => $i, + 'total' => $num, + 'errorCount' => $error, + 'invoiceidgenerated' => $invoiceidgenerated, + 'facturerec' => $facturerec, // it's an object which PHP passes by "reference", so modifiable by hooks. + 'this' => $this, // it's an object which PHP passes by "reference", so modifiable by hooks. + ); + $reshook = $hookmanager->executeHooks('afterCreationOfRecurringInvoice', $parameters, $facture); // note: $facture can be modified by hooks (warning: $facture can be null) + $i++; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1bd942cfa89..c81ea34bb24 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1334,7 +1334,7 @@ class Facture extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON f.fk_incoterms = i.rowid'; if ($rowid) $sql.= " WHERE f.rowid=".$rowid; - else $sql.= ' WHERE f.entity IN ('.getEntity('facture').')'; // Dont't use entity if you use rowid + else $sql.= ' WHERE f.entity IN ('.getEntity('invoice').')'; // Dont't use entity if you use rowid if ($ref) $sql.= " AND f.ref='".$this->db->escape($ref)."'"; if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; @@ -4144,7 +4144,7 @@ class Facture extends CommonInvoice function newCycle() { $sql = 'SELECT max(situation_cycle_ref) FROM ' . MAIN_DB_PREFIX . 'facture as f'; - $sql.= " WHERE f.entity in (".getEntity('facture', 0).")"; + $sql.= " WHERE f.entity in (".getEntity('invoice', 0).")"; $resql = $this->db->query($sql); if ($resql) { if ($resql->num_rows > 0) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 856433173ad..ab5dda7186f 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1674,7 +1674,7 @@ else { if (! empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { - print ''; + print ''; } else { @@ -1684,13 +1684,13 @@ else } else { - print ''; + print ''; } } } else { - print ''; + print ''; } } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index c0a80c86b74..c28b0917e1e 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -222,7 +222,7 @@ if (! $user->rights->societe->client->voir && ! $socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; if (! $user->rights->societe->client->voir && ! $socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2a50103e062..235f7a75dbd 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador + * Copyright (C) 2018 Charlene Benke * * 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 @@ -88,7 +89,7 @@ $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_user = GETPOST('search_user','int'); $search_sale = GETPOST('search_sale','int'); -$search_day = GETPOST('search_day','int'); +$search_day = GETPOST('search_day','int'); $search_month = GETPOST('search_month','int'); $search_year = GETPOST('search_year','int'); $search_day_lim = GETPOST('search_day_lim','int'); @@ -358,7 +359,7 @@ $thirdpartystatic=new Societe($db); $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; -$sql.= ' f.rowid as id, f.ref as ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,'; +$sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,'; $sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.paye as paye, f.fk_statut,'; @@ -399,7 +400,7 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } $sql.= ' WHERE f.fk_soc = s.rowid'; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$db->escape($search_product_category); if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; @@ -450,34 +451,10 @@ if ($search_status != '-1' && $search_status != '') } } if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode); -if ($search_month > 0) -{ - if ($search_year > 0 && empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; - else if ($search_year > 0 && ! empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; - else - $sql.= " AND date_format(f.datef, '%m') = '".$search_month."'"; -} -else if ($search_year > 0) -{ - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; -} -if ($search_month_lim > 0) -{ - if ($search_year_lim > 0 && empty($search_day_lim)) - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,$search_month_lim,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,$search_month_lim,false))."'"; - else if ($search_year_lim > 0 && ! empty($search_day_lim)) - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_lim, $search_day_lim, $search_year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_lim, $search_day_lim, $search_year_lim))."'"; - else - $sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$db->escape($search_month_lim)."'"; -} -else if ($search_year_lim > 0) -{ - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,12,false))."'"; -} +$sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year); +$sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim); if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; -if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; +if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) { $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user; @@ -595,6 +572,7 @@ if ($resql) $arrayofmassactions=array( 'validate'=>$langs->trans("Validate"), + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 3fe5d777878..907d2357950 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 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 @@ -402,17 +403,17 @@ if ($object->id > 0) if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -542,22 +543,22 @@ if ($object->id > 0) } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + print ''.$langs->trans("MakeWithdrawRequest").''; } } else { - print ''.$langs->trans("MakeWithdrawRequest").''; + print ''.$langs->trans("MakeWithdrawRequest").''; } } else { if ($num == 0) { - if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; - else print ''.$langs->trans("MakeWithdrawRequest").''; + if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; + else print ''.$langs->trans("MakeWithdrawRequest").''; } - else print ''.$langs->trans("MakeWithdrawRequest").''; + else print ''.$langs->trans("MakeWithdrawRequest").''; } print "
\n"; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 222423b7c67..0582c4b14b3 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -295,7 +295,7 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 9c96f68246d..51435433aa4 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -528,7 +528,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $sql = 'SELECT f.rowid as facid, f.ref, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,'; $sql.= ' f.datef as df, f.fk_soc as socid, f.date_lim_reglement as dlr'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')'; + $sql.= ' WHERE f.entity IN ('.getEntity('invoice', $conf->entity).')'; $sql.= ' AND (f.fk_soc = '.$facture->socid; // Can pay invoices of all child of parent company if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) { @@ -849,7 +849,7 @@ if (! GETPOST('action','aZ09')) $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; $sql.= ', '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' WHERE p.fk_facture = f.rowid'; - $sql.= ' AND f.entity IN (' . getEntity('facture').')'; + $sql.= ' AND f.entity IN (' . getEntity('invoice').')'; if ($socid) { $sql.= ' AND f.fk_soc = '.$socid; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 839b6c89294..96e94351ad4 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -438,7 +438,7 @@ if ($user->societe_id == 0 && $action == '') } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 9a21ff3dee8..c19d51b5891 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -546,7 +546,7 @@ if ($action == 'new') } else { - print ''.$langs->trans('NewCheckDepositOn',$account_label).''; + print ''.$langs->trans('NewCheckDepositOn',$account_label).''; } print '
'; print ''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index a712d90b29c..53f17aeef67 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -165,7 +165,7 @@ class Paiement extends CommonObject $sql.= ' b.fk_account'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql.= ' WHERE p.entity IN (' . getEntity('facture').')'; + $sql.= ' WHERE p.entity IN (' . getEntity('invoice').')'; if ($id > 0) $sql.= ' AND p.rowid = '.$id; else if ($ref) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 4536cb98520..12669947cff 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Charlene Benke * * 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 @@ -120,7 +121,7 @@ if (GETPOST("orphelins")) $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; - $sql.= " WHERE p.entity IN (" . getEntity('facture').")"; + $sql.= " WHERE p.entity IN (" . getEntity('invoice').")"; $sql.= " AND pf.fk_facture IS NULL"; // Add where from hooks $parameters=array(); @@ -151,7 +152,7 @@ else { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } - $sql.= " WHERE p.entity IN (" . getEntity('facture') . ")"; + $sql.= " WHERE p.entity IN (" . getEntity('invoice') . ")"; if (! $user->rights->societe->client->voir && ! $socid) { $sql.= " AND sc.fk_user = " .$user->id; @@ -163,19 +164,7 @@ else else $sql.= " AND f.fk_user_author = ".$userid; } // Search criteria - if ($month > 0) - { - if ($year > 0 && empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; - else - $sql.= " AND date_format(p.datep, '%m') = '".$month."'"; - } - else if ($year > 0) - { - $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; - } + $sql.= dolSqlDateFilter("p.datep", $day, $month, $year); if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 9fea9afa5df..a037326d9b1 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -71,7 +71,7 @@ if ($socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; } -$sql.= " WHERE p.entity IN (" . getEntity('facture') . ')'; +$sql.= " WHERE p.entity IN (" . getEntity('invoice') . ')'; if ($socid) { $sql.= " AND f.fk_soc = ".$socid; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index f645edf4563..d1e0fe8e4e9 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -319,7 +319,7 @@ if ($action == '') } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index e4fb8bc0757..cfe2e2a942c 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -74,7 +74,7 @@ llxHeader('',$langs->trans("WithdrawalsReceipts")); $sql = "SELECT p.rowid, p.ref, p.amount, p.statut, p.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; -$sql.= " WHERE p.entity IN (".getEntity('facture').")"; +$sql.= " WHERE p.entity IN (".getEntity('invoice').")"; if ($search_ref) $sql.=natural_search("p.ref", $search_ref); if ($search_amount) $sql.=natural_search("p.amount", $search_amount, 1); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index ccbdbb4fda7..e45afce9a8b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -288,7 +288,7 @@ class BonPrelevement extends CommonObject $sql.= ", p.fk_user_credit"; $sql.= ", p.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; - $sql.= " WHERE p.entity IN (".getEntity('facture').")"; + $sql.= " WHERE p.entity IN (".getEntity('invoice').")"; if ($rowid > 0) $sql.= " AND p.rowid = ".$rowid; else $sql.= " AND p.ref = '".$this->db->escape($ref)."'"; @@ -820,7 +820,7 @@ class BonPrelevement extends CommonObject $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE f.rowid = pfd.fk_facture"; - $sql.= " AND f.entity IN (".getEntity('facture').')'; + $sql.= " AND f.entity IN (".getEntity('invoice').')'; $sql.= " AND s.rowid = f.fk_soc"; //if ($banque || $agence) $sql.= " AND s.rowid = sr.fk_soc"; $sql.= " AND f.fk_statut = 1"; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 8a313f1968c..9004418b5d4 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -166,18 +166,18 @@ if ($nb) { { if ($mysoc->isInEEC()) { - print ''.$langs->trans("CreateForSepaFRST")."\n"; - print ''.$langs->trans("CreateForSepaRCUR")."\n"; + print ''.$langs->trans("CreateForSepaFRST")."\n"; + print ''.$langs->trans("CreateForSepaRCUR")."\n"; } else { - print ''.$langs->trans("CreateAll")."\n"; + print ''.$langs->trans("CreateAll")."\n"; } } } else { - print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; + print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } print "\n"; @@ -303,7 +303,7 @@ print load_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'',''); $sql = "SELECT p.rowid, p.ref, p.amount, p.statut"; $sql.= ", p.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; -$sql.= " WHERE p.entity IN (".getEntity('facture').")"; +$sql.= " WHERE p.entity IN (".getEntity('invoice').")"; $sql.= " ORDER BY datec DESC"; $sql.=$db->plimit($limit); diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 85e503bfe7b..f63cb7761de 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -235,12 +235,12 @@ if ($id) } else { - print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; + print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; } } else { - print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; + print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; } } diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 2e48802a554..474fcd0a6cb 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,8 +1,8 @@ - * Copyright (C) 2014 Laurent Destailleur - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Charlie BENKE +/* Copyright (C) 2011-2018 Alexandre Spangaro + * Copyright (C) 2014 Laurent Destailleur + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Charlie BENKE * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -255,44 +255,44 @@ if ($action == 'create') // Date payment print ''; // Date value for bank print ''; // Employee print ''; // Label print ''; // Date start period print ''; // Date end period print ''; // Amount print ''; @@ -312,14 +312,14 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { print ''; } // Type payment print ''; @@ -477,12 +477,12 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 99d6bb8b49d..e4fecab5060 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -281,7 +281,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { } else { $sql.= " AND f.type IN (0,1,2,3,5)"; } -$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label "; dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index cd015e96c11..d5779266661 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -389,12 +389,12 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 4691b577368..517f15c81f3 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -562,12 +562,11 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL)) print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation - $sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm"; + $sql1 = "SELECT SUM(amount) as mm"; $sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f"; $sql1 .= " WHERE f.entity = " . $conf->entity; $sql1 .= " AND f.datev >= '" . $db->idate($date_start) . "'"; $sql1 .= " AND f.datev <= '" . $db->idate($date_end) . "'"; - $sql1 .= " GROUP BY dm ORDER BY dm ASC"; $result = $db->query($sql1); if ($result) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3ca9c4ae6bc..c40710ceb56 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -226,7 +226,7 @@ if (empty($reshook)) $action = 'create'; } else { // Categories association - $contcats = GETPOST( 'contcats', 'array'); + $contcats = GETPOST('contcats', 'array'); $object->setCategories($contcats); } } @@ -381,10 +381,10 @@ if (empty($reshook)) // First we delete all categories association $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_contact'; $sql .= ' WHERE fk_socpeople = ' . $object->id; - $db->query( $sql ); + $db->query($sql); // Then we add the associated categories - $categories = GETPOST( 'contcats', 'array'); + $categories = GETPOST('contcats', 'array'); $object->setCategories($categories); $object->old_lastname=''; @@ -407,6 +407,12 @@ if (empty($reshook)) } } } + + // Actions to send emails + $trigger_name='CONTACT_SENTBYMAIL'; + $paramname='id'; + $mode='emailfromcontact'; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -682,19 +688,19 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; + print ''; print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; + print ''; print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; + print ''; print ''; } } @@ -707,10 +713,9 @@ else // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print '"; } @@ -969,19 +974,19 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; + print ''; print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; + print ''; print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; + print ''; print ''; } } @@ -1011,16 +1016,16 @@ else print ''; // Categories - if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) { - print ''; + if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + print ''; print '"; } @@ -1132,10 +1137,10 @@ else $password=$generated_password; // Create a form array - $formquestion=array( - array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), - array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password), - //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) + $formquestion = array( + array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), + array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password), + //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) ); $text=$langs->trans("ConfirmCreateContact").'
'; if (! empty($conf->societe->enabled)) @@ -1219,7 +1224,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { print ''; print ''; } @@ -1293,9 +1298,20 @@ else $parameters=array(); $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) + if (empty($reshook) && $action!='presend') { - if ($user->rights->societe->contact->creer) + if (! empty($object->email)) + { + $langs->load("mails"); + print ''; + } + else + { + $langs->load("mails"); + print ''; + } + + if ($user->rights->societe->contact->creer) { print ''.$langs->trans('Modify').''; } @@ -1324,6 +1340,14 @@ else } print ""; + + // Presend form + $modelmail='contact'; + $defaulttopic='Information'; + $diroutput = $conf->contact->dir_output; + $trackid = 'con'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5d2671ee129..6ab3544a385 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -540,7 +540,7 @@ if (empty($reshook)) } $desc=$prod->description; - $desc=dol_concatdesc($desc,$product_desc); + $desc=dol_concatdesc($desc,$product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); $fk_unit = $prod->fk_unit; } else @@ -2101,32 +2101,32 @@ else if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { print ''; } else - print ''; + print ''; } if ($object->statut == 0 && $nbofservices) { if ($user->rights->contrat->creer) print ''; - else print ''; + else print ''; } if ($object->statut == 1) { if ($user->rights->contrat->creer) print ''; - else print ''; + else print ''; } if (! empty($conf->facture->enabled) && $object->statut > 0) { $langs->load("bills"); if ($user->rights->facture->creer) print ''; - else print ''; + else print ''; } if (! empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("orders"); if ($user->rights->commande->creer) print ''; - else print ''; + else print ''; } // Clone @@ -2142,7 +2142,7 @@ else } else { - print ''; + print ''; } } if ($object->nbofservicesclosed < $nbofservices) @@ -2153,7 +2153,7 @@ else } else { - print ''; + print ''; } //if (! $numactive) @@ -2161,7 +2161,7 @@ else //} //else //{ - // print ''; + // print ''; //} } @@ -2174,7 +2174,7 @@ else } else { - print ''; + print ''; } } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 056362bb2d2..07c18ad42f9 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -364,6 +364,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b56f40c269d..a71629e947d 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1169,6 +1169,67 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == //var_dump($listofobjectthirdparties);exit; } +// Generate document foreach object according to model linked to object +// @TODO : propose model selection +if (! $error && $massaction == 'generate_doc' && $permtoread) +{ + $db->begin(); + + $objecttmp=new $objectclass($db); + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + $outputlangs = $langs; + $newlang=''; + + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) $newlang=$objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->default_lang)) $newlang=$objecttmp->default_lang; // for thirdparty + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + // To be sure vars is defined + if (empty($hidedetails)) $hidedetails=0; + if (empty($hidedesc)) $hidedesc=0; + if (empty($hideref)) $hideref=0; + if (empty($moreparams)) $moreparams=null; + + $result= $objecttmp->generateDocument($objecttmp->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + + if ($result <= 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsGenerated", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordGenerated", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } +} + $parameters['toselect']=$toselect; $parameters['uploaddir']=$uploaddir; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 9ffaceadb26..429529a15ac 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -113,7 +113,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $result=$object->fetch($id); $sendtosocid=0; // Thirdparty on object - if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport'))) + if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport', 'contact'))) { $result=$object->fetch_thirdparty(); if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok @@ -130,6 +130,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $thirdparty=$object; if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; } + else if ($object->element == 'contact') + { + $contact=$object; + if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id; + } else dol_print_error('','Use actions_sendmails.in.php for an element/object that is not supported'); if (is_object($hookmanager)) @@ -171,6 +176,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO { $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; } + // Recipient was provided from combo list + elseif ($val == 'contact') // Id of contact + { + $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; + } elseif ($val) // Id du contact { $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); @@ -215,6 +225,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO { $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; } + // Recipient was provided from combo list + elseif ($val == 'contact') // Id of contact + { + $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; + } elseif ($val) // Id du contact { $tmparray[] = $thirdparty->contact_get_property((int) $val,'email'); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index bd3163268ac..413dc43d8b2 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -289,7 +289,7 @@ class box_activity extends ModeleBoxes $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; - $sql.= " WHERE f.entity IN (".getEntity('facture').')'; + $sql.= " WHERE f.entity IN (".getEntity('invoice').')'; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " AND f.fk_soc = s.rowid"; @@ -371,7 +371,7 @@ class box_activity extends ModeleBoxes if ($refresh) { $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.entity IN (".getEntity('facture').')'; + $sql.= " WHERE f.entity IN (".getEntity('invoice').')'; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND f.paye=0"; $sql.= " GROUP BY f.fk_statut"; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index b731eb77169..332f7e115ef 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -357,7 +357,7 @@ class Comment extends CommonObject } $db->free($resql); } else { - $error++; $this->errors[]="Error ".$this->db->lasterror(); + $this->errors[]="Error ".$this->db->lasterror(); return -1; } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4f2d32292cf..b7b4f79300f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6118,13 +6118,13 @@ abstract class CommonObject { $value_arr=explode(',',$value); $value=''; - if (is_array($value_arr)) + if (is_array($value_arr) && count($value_arr)>0) { foreach ($value_arr as $keyval=>$valueval) { $toprint[]='
  • '.$param['options'][$valueval].'
  • '; } + $value='
      '.implode(' ', $toprint).'
    '; } - $value='
      '.implode(' ', $toprint).'
    '; } elseif ($type == 'chkbxlst') { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a52a759f841..3fcc8532af6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1333,7 +1333,58 @@ class ExtraFields // current object id can be use into filter if (strpos($InfoFieldList[4], '$ID$')!==false && !empty($objectid)) { $InfoFieldList[4]=str_replace('$ID$',$objectid,$InfoFieldList[4]); - } else { + } else if (preg_match("#^.*list.php$#",$_SERVER["DOCUMENT_URI"])) { + // Pattern for word=$ID$ + $word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$'; + + // Removing space arount =, ( and ) + $InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#','$1', $InfoFieldList[4]); + + $nbPreg = 1; + // While we have parenthesis + while ($nbPreg!=0) { + // Init des compteurs + $nbPregRepl = $nbPregSel = 0; + // On retire toutes les parenthèses sans = avant + $InfoFieldList[4]=preg_replace( '#([^=])(\([^)^(]*(' . $word . ')[^)^(]*\))#','$1 $3 ',$InfoFieldList[4],-1,$nbPregRepl); + // On retire les espaces autour des = et parenthèses + $InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#','$1', $InfoFieldList[4]); + // On retire toutes les parenthèses avec = avant + $InfoFieldList[4]=preg_replace( '#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*(' . $word . ')[^)^(]*\)#','$1 ',$InfoFieldList[4], -1, $nbPregSel); + // On retire les espaces autour des = et parenthèses + $InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#','$1', $InfoFieldList[4]); + + // Calcul du compteur général pour la boucle + $nbPreg = $nbPregRepl + $nbPregSel; + } + + // Si l'on a un AND ou un OR, avant ou après + preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#',$InfoFieldList[4],$matchCondition); + while(!empty($matchCondition[0])) { + // If the two sides differ but are not empty + if (! empty($matchCondition[1]) && ! empty($matchCondition[3]) && $matchCondition[1] != $matchCondition[3] ) { + // Nobody sain would do that without parentheses + $InfoFieldList[4]=str_replace('$ID$','0',$InfoFieldList[4]); + } + else { + if (! empty($matchCondition[1])) { + $boolCond =(( $matchCondition[1] == "AND" )?' AND 1 ':' OR 0 '); + $InfoFieldList[4]=str_replace($matchCondition[0],$boolCond.$matchCondition[3],$InfoFieldList[4]); + } + else if (! empty($matchCondition[3])) { + $boolCond =(( $matchCondition[3] == "AND" )?' 1 AND ':' 0 OR'); + $InfoFieldList[4]=str_replace($matchCondition[0],$boolCond,$InfoFieldList[4]); + } + else { + $InfoFieldList[4] = 1; + } + } + + // Si l'on a un AND ou un OR, avant ou après + preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#',$InfoFieldList[4],$matchCondition); + } + } + else { $InfoFieldList[4]=str_replace('$ID$','0',$InfoFieldList[4]); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98bfd2af726..8c17f189502 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -18,7 +18,8 @@ * Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador * * This program is free software; you can redistribute it and/or modify @@ -1391,6 +1392,8 @@ class Form * Return HTML code of the SELECT of list of all contacts (for a third party or all). * This also set the number of contacts found into $this->num * + * @since 9.0 Add afterSelectContactOptions hook + * * @param int $socid Id ot third party or 0 for all or -1 for empty list * @param array|int $selected Array of ID of pre-selected contact id * @param string $htmlname Name of HTML field ('none' for a not editable field) @@ -1410,7 +1413,7 @@ class Form */ function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $multiple=false) { - global $conf,$langs; + global $conf,$langs,$hookmanager,$action; $langs->load('companies'); @@ -1418,9 +1421,15 @@ class Form if ($selected === '') $selected = array(); else if (!is_array($selected)) $selected = array($selected); - $out=''; + $out=''; - // On recherche les societes + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + + // We search third parties $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; if ($showsoc > 0) $sql.= " , s.nom as company"; $sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp"; @@ -1505,6 +1514,18 @@ class Form $out.= ($socid != -1) ? ($langs->trans($socid?"NoContactDefinedForThirdParty":"NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); $out.= ''; } + + $parameters = array( + 'socid'=>$socid, + 'htmlname'=>$htmlname, + 'resql'=>$resql, + 'out'=>&$out, + 'showfunction'=>$showfunction, + 'showsoc'=>$showsoc, + ); + + $reshook = $hookmanager->executeHooks( 'afterSelectContactOptions', $parameters, $this, $action ); // Note that $action and $object may have been modified by some hooks + if ($htmlname != 'none' || $options_only) { $out.= ''; @@ -2037,20 +2058,20 @@ class Form $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock"; - + $sql = "SELECT "; $sql.= $selectFields . $selectFieldsGrouped; - + if (! empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) { //Product category $sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_product - WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid + WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid LIMIT 1 ) AS categorie_product_id "; } - + //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { @@ -2143,6 +2164,11 @@ class Form if ($i > 0) $sql.=" AND "; $sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'"; + if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) + { + $sql.=" OR p.description LIKE '".$db->escape($prefix.$crit)."%'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.description LIKE '".$db->escape($prefix.$crit)."%'"; + } if (! empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) $sql.=" OR pfp.ref_fourn LIKE '".$db->escape($prefix.$crit)."%'"; $sql.=")"; $i++; @@ -2155,7 +2181,7 @@ class Form { $sql.= ' GROUP BY'.$selectFields; } - + //Sort by category if(! empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) { @@ -2169,7 +2195,7 @@ class Form } $sql.= $db->plimit($limit, 0); - + // Build output string dol_syslog(get_class($this)."::select_produits_list search product", LOG_DEBUG); $result=$this->db->query($sql); @@ -3559,7 +3585,7 @@ class Form * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param string $moreattrib To add more attribute on select * @param int $showcurrency Show currency in label - * @return void + * @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...) */ function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0) { @@ -3567,6 +3593,7 @@ class Form global $langs, $conf; $langs->load("admin"); + $num = 0; $sql = "SELECT rowid, label, bank, clos as status, currency_code"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; @@ -3610,13 +3637,15 @@ class Form } else { - if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined"); - else print $langs->trans("NoBankAccountFound"); + if ($statut == 0) print ''.$langs->trans("NoActiveBankAccountDefined").''; + else print ''.$langs->trans("NoBankAccountFound").''; } } else { dol_print_error($this->db); } + + return $num; } /** @@ -3635,8 +3664,8 @@ class Form print '
    '; print ''; print ''; - $this->select_comptes($selected, $htmlname, 0, '', $addempty); - print ''; + $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); + if ($nbaccountfound > 0) print ''; print ''; } else { @@ -6443,8 +6472,8 @@ class Form $possiblelinks=array( 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal').')'), 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande').')'), - 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture').')'), - 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture').')'), + 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), + 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'), @@ -6712,8 +6741,22 @@ class Form // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers - $previous_ref = $object->ref_previous?'':''; - $next_ref = $object->ref_next?'':''; + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') + { + $stringforfirstkey .= ' ALT +'; + } + elseif ($conf->browser->name == 'firefox') + { + $stringforfirstkey .= ' ALT + SHIFT +'; + } + else + { + $stringforfirstkey .= ' CTL +'; + } + + $previous_ref = $object->ref_previous?'':''; + $next_ref = $object->ref_next?'':''; } //print "xx".$previous_ref."x".$next_ref; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6dd2264bf8b..caed0fe9063 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -751,39 +751,8 @@ class FormMail extends Form } // CCC - if (! empty($this->withtoccc) || is_array($this->withtoccc)) - { - $out.= '
    \n"; + if (! empty($this->withtoccc) || is_array($this->withtoccc)) { + $out .= $this->getHtmlForWithCcc(); } // Replyto @@ -799,77 +768,18 @@ class FormMail extends Form } // Errorsto - if (! empty($this->witherrorsto)) - { - //if (! $this->errorstomail) $this->errorstomail=$this->frommail; - $errorstomail = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); - if ($this->witherrorstoreadonly) - { - $out.= ''; - $out.= '\n"; - } - else - { - $out.= '\n"; - } + if (! empty($this->witherrorsto)) { + $out .= $this->getHtmlForWithErrorsTo(); } // Ask delivery receipt - if (! empty($this->withdeliveryreceipt)) - { - $out.= '\n"; + if (! empty($this->withdeliveryreceipt)) { + $out .= $this->getHtmlForDeliveryReceipt(); } // Topic - if (! empty($this->withtopic)) - { - $defaulttopic=GETPOST('subject','none'); - if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1') - { - if ($arraydefaultmessage && $arraydefaultmessage->topic) { - $defaulttopic = $arraydefaultmessage->topic; - } elseif (! is_numeric($this->withtopic)) { - $defaulttopic = $this->withtopic; - } - } - - $defaulttopic=make_substitutions($defaulttopic,$this->substit); - - $out.= ''; - $out.= ''; - $out.= '\n"; + if (! empty($this->withtopic)) { + $out .= $this->getHtmlForTopic(); } // Attached files @@ -1099,7 +1009,123 @@ class FormMail extends Form } } + /** + * get html For WithCCC + * + * @return string html + */ + public function getHtmlForWithCcc() + { + global $conf, $langs, $form; + $out = '\n"; + return $out; + } + + /** + * get Html For WithErrorsTo + * + * @return string html + */ + public function getHtmlForWithErrorsTo() + { + global $conf, $langs; + //if (! $this->errorstomail) $this->errorstomail=$this->frommail; + $errorstomail = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); + if ($this->witherrorstoreadonly) { + $out.= '\n"; + } else { + $out.= '\n"; + } + return $out; + } + + /** + * get Html For Asking for Deliveriy Receipt + * + * @return string html + */ + public function getHtmlForDeliveryreceipt() + { + global $conf, $langs, $form; + $out = '\n"; + return $out; + } + + /** + * get Html For Topic of message + * + * @return string html + */ + public function getHtmlForTopic() + { + global $conf, $langs, $form; + $defaulttopic = GETPOST('subject','none'); + if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1') { + if ($arraydefaultmessage && $arraydefaultmessage->topic) { + $defaulttopic = $arraydefaultmessage->topic; + } elseif (! is_numeric($this->withtopic)) { + $defaulttopic = $this->withtopic; + } + } + + $defaulttopic=make_substitutions($defaulttopic,$this->substit); + + $out = ''; + $out.= ''; + $out.= '\n"; + return $out; + } /** * Return templates of email with type = $type_template or type = 'all'. diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 7ad40349589..d6d1e0c741c 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -3,7 +3,8 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2015 Juanjo Menent * Copyright (C) 2017 Ferran Marcet - * + * Copyright (C) 2018 Charlene Benke +* * 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 @@ -150,7 +151,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) * @return int Time into seconds * @see convertSecondToTime */ -function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) +function convertTime2Seconds($iHours=0, $iMinutes=0, $iSeconds=0) { $iResult=($iHours*3600)+($iMinutes*60)+$iSeconds; return $iResult; @@ -274,6 +275,35 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt } +/** + * Generate a SQL string to make a filter into a range (for second of date until last second of date) + * + * @param string $datefield Name of SQL field where apply sql date filter + * @param int $day_date Day date + * @param int $month_date Month date + * @param int $year_date Year date + * @return string $sqldate String with SQL filter + */ +function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date) +{ + global $db; + $sqldate=""; + if ($month_date > 0) { + if ($year_date > 0 && empty($day_date)) { + $sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, false)); + $sqldate.= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, false))."'"; + } else if ($year_date > 0 && ! empty($day_date)) { + $sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date)); + $sqldate.= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'"; + } else + $sqldate.= " AND date_format( ".$datefield.", '%m') = '".$db->escape($month_date)."'"; + } else if ($year_date > 0){ + $sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false)); + $sqldate.= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'"; + } + return $sqldate; +} + /** * Convert a string date into a GM Timestamps date * Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string. diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f280825af08..4739cc12954 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -107,7 +107,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) * @param string $element Current element * 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource', * 'product', 'productprice', 'stock', - * 'propal', 'supplier_proposal', 'facture', 'facture_fourn', 'payment_various', + * 'propal', 'supplier_proposal', 'invoice', 'facture_fourn', 'payment_various', * 'categorie', 'bank_account', 'bank_account', 'adherent', 'user', * 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey', * 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project', @@ -5747,22 +5747,31 @@ function dol_textishtml($msg,$option=0) * text1 txt + text2 html => dol_nl2br(text1) + '
    ' + text2 * text1 txt + text2 txt => text1 + '\n' + text2 * - * @param string $text1 Text 1 - * @param string $text2 Text 2 - * @param bool $forxml false=Use
    instead of \n if html content detected, true=Use
    instead of \n if html content detected - * @return string Text 1 + new line + Text2 + * @param string $text1 Text 1 + * @param string $text2 Text 2 + * @param bool $forxml false=Use
    instead of \n if html content detected, true=Use
    instead of \n if html content detected + * @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active + * @return string Text 1 + new line + Text2 * @see dol_textishtml */ -function dol_concatdesc($text1,$text2,$forxml=false) +function dol_concatdesc($text1,$text2,$forxml=false, $invert=false) { - $ret=''; - $ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1; - $ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"
    \n":"
    \n") : "\n") : ""; - $ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2; - return $ret; + if (!empty($invert)) + { + $tmp = $text1; + $text1 = $text2; + $text2 = $tmp; + } + + $ret=''; + $ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1; + $ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"
    \n":"
    \n") : "\n") : ""; + $ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2; + return $ret; } + /** * Return array of possible common substitutions. This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user' * diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index c64ea1fa090..9f2e55153d0 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -111,16 +111,16 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass) print '
    '; if (! function_exists("ldap_connect")) { - print ''.$butlabel.''; + print ''.$butlabel.''; } else if (empty($conf->global->LDAP_SERVER_HOST)) { - print ''.$butlabel.''; + print ''.$butlabel.''; } else if (empty($key) || empty($dn) || empty($objectclass)) { $langs->load("errors"); - print ''.$butlabel.''; + print ''.$butlabel.''; } else { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ce2145d3986..8e9d4d1b5ed 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -4,7 +4,8 @@ * Copyright (C) 2012-2015 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 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 @@ -76,9 +77,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $menu->add('/index.php?mainmenu=home&leftmenu=home', $titlehome, 0, $showmode, $atarget, "home", '', 10, $id, $idsel, $classname); // Members - $tmpentry=array('enabled'=>(! empty($conf->adherent->enabled)), - 'perms'=>(! empty($user->rights->adherent->lire)), - 'module'=>'adherent'); + $tmpentry = array( + 'enabled'=>(! empty($conf->adherent->enabled)), + 'perms'=>(! empty($user->rights->adherent->lire)), + 'module'=>'adherent', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -91,7 +94,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // Third parties - $tmpentry=array('enabled'=>(( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)), 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), 'module'=>'societe|fournisseur'); + $tmpentry = array( + 'enabled'=>(( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)), + 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), + 'module'=>'societe|fournisseur', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -107,7 +114,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // Products-Services - $tmpentry=array('enabled'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'perms'=>(! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)), 'module'=>'product|service'); + $tmpentry = array( + 'enabled'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), + 'perms'=>(! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)), + 'module'=>'product|service', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -140,10 +151,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->supplier_proposal->enabled)) $menuqualified++; if (! empty($conf->contrat->enabled)) $menuqualified++; if (! empty($conf->ficheinter->enabled)) $menuqualified++; - $tmpentry=array( + $tmpentry = array( 'enabled'=>$menuqualified, 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)), - 'module'=>'propal|commande|supplier_order|contrat|ficheinter'); + 'module'=>'propal|commande|supplier_order|contrat|ficheinter', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -165,10 +177,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->salaries->enabled)) $menuqualified++; if (! empty($conf->supplier_invoice->enabled)) $menuqualified++; if (! empty($conf->loan->enabled)) $menuqualified++; - $tmpentry=array( - 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), - 'module'=>'facture|supplier_invoice|don|tax|salaries|loan'); + $tmpentry = array( + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), + 'module'=>'facture|supplier_invoice|don|tax|salaries|loan', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -183,9 +196,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // Bank - $tmpentry=array('enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), - 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), - 'module'=>'banque|prelevement'); + $tmpentry = array( + 'enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), + 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), + 'module'=>'banque|prelevement', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -205,10 +220,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->comptabilite->enabled)) $menuqualified++; if (! empty($conf->accounting->enabled)) $menuqualified++; if (! empty($conf->asset->enabled)) $menuqualified++; - $tmpentry=array( - 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)), - 'module'=>'comptabilite|accounting'); + $tmpentry = array( + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)), + 'module'=>'comptabilite|accounting', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -223,9 +239,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // Projects - $tmpentry=array('enabled'=>(! empty($conf->projet->enabled)), - 'perms'=>(! empty($user->rights->projet->lire)), - 'module'=>'projet'); + $tmpentry = array( + 'enabled'=>(! empty($conf->projet->enabled)), + 'perms'=>(! empty($user->rights->projet->lire)), + 'module'=>'projet', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -254,9 +272,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // HRM - $tmpentry=array('enabled'=>(! empty($conf->hrm->enabled) || ! empty($conf->holiday->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled)), - 'perms'=>(! empty($user->rights->hrm->employee->read) || ! empty($user->rights->holiday->write) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->expensereport->lire)), - 'module'=>'hrm|holiday|deplacement|expensereport'); + $tmpentry = array( + 'enabled'=>(! empty($conf->hrm->enabled) || ! empty($conf->holiday->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled)), + 'perms'=>(! empty($user->rights->hrm->employee->read) || ! empty($user->rights->holiday->write) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->expensereport->lire)), + 'module'=>'hrm|holiday|deplacement|expensereport', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -271,10 +291,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode } // Tools - $tmpentry=array( - 'enabled'=>1, - 'perms'=>1, - 'module'=>''); + $tmpentry = array( + 'enabled'=>1, + 'perms'=>1, + 'module'=>'', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -333,19 +354,21 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode // Sort on position $menu->liste = dol_sort_array($menu->liste, 'position'); - // Output menu entries - foreach($menu->liste as $menkey => $menuval) - { - if (empty($noout)) print_start_menu_entry($menuval['idsel'],$menuval['classname'],$menuval['enabled']); - if (empty($noout)) print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); - if (empty($noout)) print_end_menu_entry($menuval['enabled']); - } + // Output menu entries + if (empty($noout)) { + foreach($menu->liste as $menkey => $menuval) { + print_start_menu_entry($menuval['idsel'],$menuval['classname'],$menuval['enabled']); + print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); + print_end_menu_entry($menuval['enabled']); + } + } $showmode=1; - if (empty($noout)) print_start_menu_entry('','class="tmenuend"',$showmode); - if (empty($noout)) print_end_menu_entry($showmode); - - if (empty($noout)) print_end_menu_array(); + if (empty($noout)) { + print_start_menu_entry('','class="tmenuend"',$showmode); + print_end_menu_entry($showmode); + print_end_menu_array(); + } return 0; } @@ -398,8 +421,7 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, { global $langs; - if ($showmode == 1) - { + if ($showmode == 1) { print ''; print '
    '; print '
    '; @@ -408,9 +430,7 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, print $text; print ''; print ''; - } - if ($showmode == 2) - { + } elseif ($showmode == 2) { print '
    '; print ''; print ''; @@ -583,9 +603,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->loadLangs(array('admin', 'help')); $newmenu->add('/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1); - if ($usemenuhider || empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); - if ($usemenuhider || empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); - if ($usemenuhider || empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('FileCheck'), 2); + if ($usemenuhider || empty($leftmenu) || $leftmenu=='admintools_info') { + $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); + $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); + $newmenu->add('/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('FileCheck'), 2); + } $newmenu->add('/admin/system/browser.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoBrowser'), 1); $newmenu->add('/admin/system/os.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoOS'), 1); $newmenu->add('/admin/system/web.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoWebServer'), 1); @@ -737,12 +759,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100); $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") { + $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); + //$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); + } $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); } @@ -753,12 +777,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") { + $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); + if (! empty($conf->expedition->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); + //$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); + } $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); } @@ -770,14 +796,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); - if (($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") && empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") { + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); + if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); + } // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("StatusOrderBilled"), 2, $user->rights->fournisseur->commande->lire); @@ -792,10 +820,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="contracts") { + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); + } } // Interventions @@ -892,8 +922,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("donations"); $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/card.php?leftmenu=donations&action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/list.php?leftmenu=donations",$langs->trans("List"), 1, $user->rights->don->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") { + $newmenu->add("/don/card.php?leftmenu=donations&action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); + $newmenu->add("/don/list.php?leftmenu=donations",$langs->trans("List"), 1, $user->rights->don->lire); + } // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); } @@ -909,39 +941,47 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->tax->enabled)) { $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) { + $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + } // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) { + $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer); + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + } global $mysoc; //Local Taxes 1 if($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj=="1")) { $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1",$langs->trans("New"),2,$user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) { + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1",$langs->trans("New"),2,$user->rights->tax->charges->creer); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("List"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + } } //Local Taxes 2 if($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1")) { $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2",$langs->trans("New"),2,$user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) { + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2",$langs->trans("New"),2,$user->rights->tax->charges->creer); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("List"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("ReportByMonth"),2,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + } } } } @@ -951,9 +991,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("salaries"); $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) { + $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); + $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); + $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read); + } } // Loan @@ -961,8 +1003,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("loan"); $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); - //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) { + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); + //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); + } } // Various payment @@ -970,8 +1014,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("banks"); $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create",$langs->trans("New"), 2, $user->rights->banque->modifier); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various",$langs->trans("List"),2,$user->rights->banque->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) { + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create",$langs->trans("New"), 2, $user->rights->banque->modifier); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various",$langs->trans("List"),2,$user->rights->banque->lire); + } } } } @@ -993,56 +1039,60 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Chart of account $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); - if (! empty($conf->banque->enabled)) - { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); - } - if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) - { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); - } - if (! empty($conf->tax->enabled)) - { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); - } - if (! empty($conf->expensereport->enabled)) - { - if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); - } - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) { + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); + $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); + $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); + $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); + if (! empty($conf->banque->enabled)) { + $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); + } + if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { + $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); + } + if (! empty($conf->tax->enabled)) { + $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); + } + if (! empty($conf->expensereport->enabled)) { + $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); + } + $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); - // Fiscal year - if ($conf->global->MAIN_FEATURES_LEVEL > 1) // Not yet used. In a future will lock some periods. - { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); - } + // Fiscal year + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { + // Not yet used. In a future will lock some periods. + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + } + } // Binding if (! empty($conf->facture->enabled)) { $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) { + $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); + $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + } } if (! empty($conf->supplier_invoice->enabled)) { $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) { + $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); + $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + } } if (! empty($conf->expensereport->enabled)) { $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) { + $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); + $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + } } // Journals @@ -1110,36 +1160,48 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Balance $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); - + + // Files + if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 2) + { + $newmenu->add("/compta/compta-files.php?mainmenu=accountancy&leftmenu=accountancy_files",$langs->trans("AccountantFiles"),1,$user->rights->accounting->mouvements->lire); + } + // Reports $langs->load("compta"); $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("MenuReportInOut"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) { + $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("MenuReportInOut"),2,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); + } $modecompta='CREANCES-DETTES'; if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta='BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) { + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + } } $modecompta='RECETTES-DEPENSES'; //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ReportTurnoverCollected"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); - //if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); - //if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) { + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ReportTurnoverCollected"),2,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta,$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); + //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); + //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + } } } @@ -1151,30 +1213,32 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Bilan, resultats $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy",$langs->trans("Reportings"),0,$user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("MenuReportInOut"),1,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire); - /* On verra ca avec module compabilite expert - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); - */ - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=report",$langs->trans("ReportTurnover"),1,$user->rights->compta->resultat->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) { + $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("MenuReportInOut"),1,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire); + /* On verra ca avec module compabilite expert + $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); + */ + $newmenu->add("/compta/stats/index.php?leftmenu=report",$langs->trans("ReportTurnover"),1,$user->rights->compta->resultat->lire); - /* - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - if (! empty($conf->propal->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); - } - */ - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"),2,$user->rights->compta->resultat->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"),2,$user->rights->compta->resultat->lire); + /* + $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); + if (! empty($conf->propal->enabled)) { + $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); + } + */ + $newmenu->add("/compta/stats/casoc.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"),2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"),2,$user->rights->compta->resultat->lire); - // Journaux + // Journaux + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 50); + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 51); + } //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 50); - if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire, '', '', '', 51); } // Assets @@ -1185,8 +1249,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/asset/card.php?action=create",$langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy",$langs->trans("MenuListAssets"), 1, $user->rights->asset->read); $newmenu->add("/asset/type.php?leftmenu=asset_type",$langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); - if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/',$leftmenu)) $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create",$langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/',$leftmenu)) $newmenu->add("/asset/type.php?leftmenu=asset_type",$langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/',$leftmenu)) { + $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create",$langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->write); + $newmenu->add("/asset/type.php?leftmenu=asset_type",$langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); + } } } @@ -1223,25 +1289,28 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank",$langs->trans("StandingOrders"),0,$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw'); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/demandes.php?status=0&mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") { + //$newmenu->add("/compta/prelevement/demandes.php?status=0&mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire); - if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/create.php?mainmenu=bank",$langs->trans("NewStandingOrder"),1,$user->rights->prelevement->bons->creer); + $newmenu->add("/compta/prelevement/create.php?mainmenu=bank",$langs->trans("NewStandingOrder"),1,$user->rights->prelevement->bons->creer); + $newmenu->add("/compta/prelevement/bons.php?mainmenu=bank",$langs->trans("WithdrawalsReceipts"),1,$user->rights->prelevement->bons->lire); + $newmenu->add("/compta/prelevement/list.php?mainmenu=bank",$langs->trans("WithdrawalsLines"),1,$user->rights->prelevement->bons->lire); + $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank",$langs->trans("Rejects"),1,$user->rights->prelevement->bons->lire); + $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank",$langs->trans("Statistics"),1,$user->rights->prelevement->bons->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/bons.php?mainmenu=bank",$langs->trans("WithdrawalsReceipts"),1,$user->rights->prelevement->bons->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/list.php?mainmenu=bank",$langs->trans("WithdrawalsLines"),1,$user->rights->prelevement->bons->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank",$langs->trans("Rejects"),1,$user->rights->prelevement->bons->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank",$langs->trans("Statistics"),1,$user->rights->prelevement->bons->lire); - - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer); + //$newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer); + } } // Gestion cheques if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->cheque, '', $mainmenu, 'checks'); - if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque); - if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->cheque); + if (preg_match('/checks/',$leftmenu)) { + $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque); + $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->cheque); + } } } @@ -1344,9 +1413,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings'); $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") { + $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); + $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); + $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); + } $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); } } @@ -1362,9 +1433,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $search_project_user = GETPOST('search_project_user','int'); - $tmpentry=array('enabled'=>(! empty($conf->projet->enabled)), - 'perms'=>(! empty($user->rights->projet->lire)), - 'module'=>'projet'); + $tmpentry = array( + 'enabled'=>(! empty($conf->projet->enabled)), + 'perms'=>(! empty($user->rights->projet->lire)), + 'module'=>'projet', + ); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); $titleboth=$langs->trans("LeadsOrProjects"); @@ -1443,11 +1516,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); $newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1,$user->rights->holiday->write); $newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("List"), 1,$user->rights->holiday->read); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") { + $newmenu->add("/holiday/list.php?search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); + } $newmenu->add("/holiday/define_holiday.php?action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/month_report.php", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all); $newmenu->add("/holiday/view_log.php?action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); @@ -1470,12 +1545,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport'); $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") { + $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); + } $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); } @@ -1792,5 +1869,3 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu return count($menu_array); } - - diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 7f3cca693b5..422f1139754 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2018 Philippe Grand * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Francis Appels * * 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 @@ -213,7 +214,7 @@ class pdf_standard extends ModeleExpenseReport if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; // Load traductions files requiredby by page - $outputlangs->loadLangs(array("main", "trips", "projects", "dict")); + $outputlangs->loadLangs(array("main", "trips", "projects", "dict", "bills", "banks")); $nblignes = count($object->lines); @@ -462,30 +463,37 @@ class pdf_standard extends ModeleExpenseReport // Show total area box $posy=$bottomlasttab+5; - $pdf->SetXY(100, $posy); - $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L'); - $pdf->SetXY(160, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ht), 1, 'R'); + $posy_start_of_totals = $posy; + $pdf->SetXY(130, $posy); + $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L'); + $pdf->SetXY(180, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_ht), 1, 'R'); $pdf->SetFillColor(248,248,248); if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { // TODO Show vat amout per tax level $posy+=5; - $pdf->SetXY(100, $posy); + $pdf->SetXY(130, $posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalVAT"), 1,'L'); - $pdf->SetXY(160, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_tva),1, 'R'); + $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalVAT"), 1,'L'); + $pdf->SetXY(180, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_tva),1, 'R'); } $posy+=5; - $pdf->SetXY(100, $posy); + $pdf->SetXY(130, $posy); $pdf->SetFont('','B', 10); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalTTC"), 1,'L'); - $pdf->SetXY(160, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ttc),1, 'R'); + $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalTTC"), 1,'L'); + $pdf->SetXY(180, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_ttc),1, 'R'); + + // show payments zone + $sumPayments = $object->getSumPayments(); + if ($sumPayments > 0 && empty($conf->global->PDF_EXPENSEREPORT_NO_PAYMENT_DETAILS)) { + $posy=$this->tablePayments($pdf, $object, $posy_start_of_totals, $outputlangs); + } // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); @@ -531,7 +539,7 @@ class pdf_standard extends ModeleExpenseReport * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return void */ - private function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails=0) + private function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails=0) { global $conf; $pdf->SetFont('','', $default_font_size - 1); @@ -926,6 +934,118 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetTextColor(0,0,0); } + /** + * Show payments table + * + * @param PDF $pdf Object PDF + * @param Object $object Object invoice + * @param int $posy Position y in PDF + * @param Translate $outputlangs Object langs for output + * @return int <0 if KO, >0 if OK + */ + private function tablePayments(&$pdf, $object, $posy, $outputlangs) + { + global $conf; + + $sign=1; + $tab3_posx = $this->marge_gauche; + $tab3_top = $posy; + $tab3_width = 88; + $tab3_height = 5; + + $default_font_size = pdf_getPDFFontSize($outputlangs); + + $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($tab3_posx, $tab3_top - 4); + $pdf->SetTextColor(0,0,0); + $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + + $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width+2, $tab3_top); // Top border line of table title + + $pdf->SetXY($tab3_posx, $tab3_top+1); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Date"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+19, $tab3_top+1); // Old value 17 + $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0); + $pdf->SetXY($tab3_posx+35, $tab3_top+1); + $pdf->MultiCell(30, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + if (! empty($conf->banque->enabled)) { + $pdf->SetXY($tab3_posx+65, $tab3_top+1); + $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0); + } + $pdf->line($tab3_posx, $tab3_top+$tab3_height, $tab3_posx+$tab3_width+2, $tab3_top+$tab3_height); // Bottom border line of table title + + $y=0; + + // Loop on each payment + // TODO create method on expensereport class to get payments + // Payments already done (from payment on this expensereport) + $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,"; + $sql.= "c.code as p_code, c.libelle as payment_type,"; + $sql.= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; + $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; + $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; + $sql.= " WHERE e.rowid = '".$object->id."'"; + $sql.= " AND p.fk_expensereport = e.rowid"; + $sql.= ' AND e.entity IN ('.getEntity('expensereport').')'; + $sql.= " ORDER BY dp"; + + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) { + $y+=$tab3_height; + $row = $this->db->fetch_object($resql); + + $pdf->SetXY($tab3_posx, $tab3_top+$y+1); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->dp),'day',false,$outputlangs,true), 0, 'L', 0); + $pdf->SetXY($tab3_posx+17, $tab3_top+$y+1); + $pdf->MultiCell(15, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'R', 0); + $pdf->SetXY($tab3_posx+35, $tab3_top+$y+1); + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->p_code); + + $pdf->MultiCell(40, 3, $oper, 0, 'L', 0); + if (! empty($conf->banque->enabled)) { + $pdf->SetXY($tab3_posx+65, $tab3_top+$y+1); + $pdf->MultiCell(30, 3, $row->baref, 0, 'L', 0); + } + + $pdf->line($tab3_posx, $tab3_top+$y+$tab3_height, $tab3_posx+$tab3_width+2, $tab3_top+$y+$tab3_height); // Bottom line border of table + $totalpaid += $row->amount; + $i++; + } + if ($num > 0 && $object->paid == 0) + { + $y+=$tab3_height; + + $pdf->SetXY($tab3_posx+17, $tab3_top+$y); + $pdf->MultiCell(15, 3, price($totalpaid), 0, 'R', 0); + $pdf->SetXY($tab3_posx+35, $tab3_top+$y); + $pdf->MultiCell(30, 4, $outputlangs->trans("AlreadyPaid"), 0, 'L', 0); + $y+=$tab3_height-2; + $pdf->SetXY($tab3_posx+17, $tab3_top+$y); + $pdf->MultiCell(15, 3, price($object->total_ttc), 0, 'R', 0); + $pdf->SetXY($tab3_posx+35, $tab3_top+$y); + $pdf->MultiCell(30, 4, $outputlangs->trans("AmountExpected"), 0, 'L', 0); + $y+=$tab3_height-2; + $remaintopay = $object->total_ttc - $totalpaid; + $pdf->SetXY($tab3_posx+17, $tab3_top+$y); + $pdf->MultiCell(15, 3, price($remaintopay), 0, 'R', 0); + $pdf->SetXY($tab3_posx+35, $tab3_top+$y); + $pdf->MultiCell(30, 4, $outputlangs->trans("RemainderToPay"), 0, 'L', 0); + } + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } + /** * Show footer of page. Need this->emetteur object * diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index ee166e5b7a1..6b5cb22d69a 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -1,11 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014-2015 Raphaël Doursenaud +/* Copyright (C) 2003,2005 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014-2015 Raphaël Doursenaud + * Copyright (C) 2018 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 @@ -268,7 +269,7 @@ class modAdherent extends DolibarrModules $this->export_label[$r]='MembersAndSubscriptions'; $this->export_permission[$r]=array(array("adherent","export")); $this->export_fields_array[$r]=array( - 'a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature', + 'a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.gender'=>"Gender",'a.morphy'=>'Nature', 'a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'co.code'=>"CountryCode",'co.label'=>"Country", 'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status", 'a.photo'=>"Photo",'a.note_public'=>"NotePublic",'a.note_private'=>"NotePrivate",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation', @@ -276,13 +277,13 @@ class modAdherent extends DolibarrModules 'c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.subscription'=>'Amount' ); $this->export_TypeFields_array[$r]=array( - 'a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text", + 'a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.gender'=>'Text','a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text", 'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text", 'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date', 'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric' ); $this->export_entities_array[$r]=array( - 'a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member', + 'a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.gender'=>'member','a.morphy'=>'member', 'a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member", 'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member", 'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member', @@ -316,7 +317,7 @@ class modAdherent extends DolibarrModules $this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields'); $this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r]=array( - 'a.civility'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password", + 'a.civility'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.gender'=>"Gender",'a.login'=>"Login*","a.pass"=>"Password", "a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town", 'a.state_id'=>'StateId','a.country'=>"CountryId",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note_public'=>"NotePublic",'a.note_private'=>"NotePrivate", diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 69bdc9486b3..5420a4d3f84 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -265,7 +265,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; - $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('facture').')'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('invoice').')'; if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; $r++; @@ -320,7 +320,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON b.rowid = p.fk_bank'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture').')'; + $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('invoice').')'; if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; $r++; } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 76aa73e960e..6292008c54d 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -164,27 +164,27 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - function get_substitutionarray_tasks($task,$outputlangs) + function get_substitutionarray_tasks(Task $task,$outputlangs) { // phpcs:enable global $conf; $resarray = array( - 'task_ref'=>$task->ref, - 'task_fk_project'=>$task->fk_project, - 'task_projectref'=>$task->projectref, - 'task_projectlabel'=>$task->projectlabel, - 'task_label'=>$task->label, - 'task_description'=>$task->description, - 'task_fk_parent'=>$task->fk_parent, - 'task_duration'=>$task->duration, - 'task_duration_hour'=>convertSecondToTime($task->duration,'all'), - 'task_progress'=>$task->progress, - 'task_public'=>$task->public, - 'task_date_start'=>dol_print_date($task->date_start,'day'), - 'task_date_end'=>dol_print_date($task->date_end,'day'), - 'task_note_private'=>$task->note_private, - 'task_note_public'=>$task->note_public + 'task_ref'=>$task->ref, + 'task_fk_project'=>$task->fk_project, + 'task_projectref'=>$task->projectref, + 'task_projectlabel'=>$task->projectlabel, + 'task_label'=>$task->label, + 'task_description'=>$task->description, + 'task_fk_parent'=>$task->fk_parent, + 'task_duration'=>$task->duration, + 'task_duration_hour'=>convertSecondToTime($task->duration,'all'), + 'task_progress'=>$task->progress, + 'task_public'=>$task->public, + 'task_date_start'=>dol_print_date($task->date_start,'day'), + 'task_date_end'=>dol_print_date($task->date_end,'day'), + 'task_note_private'=>$task->note_private, + 'task_note_public'=>$task->note_public ); require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; @@ -750,6 +750,7 @@ class doc_generic_project_odt extends ModelePDFProjects $num = $this->db->num_rows($resql); $i = 0; $tasks = array(); + $row=array(); $listlinestasktime = $listlines->__get('taskstimes'); if (empty($num)) { $row['rowid']=''; @@ -1064,7 +1065,7 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListSocialContributionAssociatedProject", 'class' => 'ChargeSociales', 'table' => 'chargesociales', - 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id, + 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $object->id, 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire ), 'stock_mouvement' => array( diff --git a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php index 824859edfd7..ad0ec9421ad 100644 --- a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php +++ b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php @@ -22,6 +22,12 @@ if (empty($conf) || ! is_object($conf)) exit; } +$objectUrl = $object->getNomUrl(0,'',0,1); +if($object->element == 'propal') +{ + $objectUrl = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; +} + ?> @@ -47,7 +53,7 @@ $(document).ready(function(){ }); - var $dialog = $('
    ') + var $dialog = $('
    ') .load( page + " #tablelines", function() { $("#" + formId + " #tablelines").prop("id", "ajaxloaded_tablelines"); // change id attribute diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 0d1fd84923c..db3514d7778 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -140,6 +140,10 @@ if ($action == 'presend') $liste[$key] = $value; } } + elseif ($object->element == 'contact') + { + $liste['contact'] = $object->getFullName($langs)." <".$object->email.">"; + } elseif ($object->element == 'user' || $object->element == 'member') { $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">"; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7e3e479048b..96510b85617 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -67,7 +67,13 @@ $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { + // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random' + ?> + + + global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> + dol_use_jmobile)) { ?> '."\n"; + } + print load_fiche_titre($langs->trans("DoPayment")); print '
    '; @@ -298,7 +312,12 @@ if ($action == 'create' || empty($action)) if ($sumpaid < $objp->total_ttc) { $namef = "amount_".$objp->id; - print ''; + $nameRemain = "remain_".$objp->id; // autofill remainder amount + if (!empty($conf->use_javascript_ajax)) // autofill remainder amount + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->total_ttc - $sumpaid)."'"); // autofill remainder amount + $remaintopay=$objp->total_ttc - $sumpaid; // autofill remainder amount + print ''; // autofill remainder amount + print ''; } else { diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index b715ba853b7..54a9b64cb8f 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -678,7 +678,7 @@ if ($step == 2 && $datatoexport) } else { - print '
    '.$langs->trans("NextStep").''; + print ''.$langs->trans("NextStep").''; } print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 756613d6a8f..6158848ceed 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1644,7 +1644,7 @@ else if ($id > 0 || ! empty($ref)) { print ''; } - else print ''; + else print ''; } // create intervention model @@ -1663,7 +1663,7 @@ else if ($id > 0 || ! empty($ref)) if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->rights->propal->creer) print ''; - else print ''; + else print ''; } } @@ -1674,7 +1674,7 @@ else if ($id > 0 || ! empty($ref)) if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->rights->facture->creer) print ''; - else print ''; + else print ''; } if (! empty($conf->global->FICHINTER_CLASSIFY_BILLED)) // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index c26e642a651..85f92f55f85 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -269,6 +269,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 235a3c85396..f017cce90ab 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -780,7 +780,7 @@ if ($object->id > 0) { if ($object->status != 1) { - print ''; + print ''; } if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer) @@ -792,7 +792,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddSupplierProposal").''; + print ''.$langs->trans("AddSupplierProposal").''; } } @@ -805,7 +805,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddOrder").''; } } @@ -818,7 +818,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddBill").''; + print ''.$langs->trans("AddBill").''; } } @@ -832,10 +832,10 @@ if ($object->id > 0) } else { - print ''; + print ''; } } - else print ''; + else print ''; } // Add action diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8098946b186..d0ba9e83656 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -404,7 +404,7 @@ if (empty($reshook)) $desc = $productsupplier->desc_supplier; } else $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); $type = $productsupplier->type; $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); @@ -1579,7 +1579,7 @@ if ($action=='create') if (! empty($conf->multicurrency->enabled)) { print '
    '; - print ''; + print ''; print ''; @@ -1964,7 +1964,7 @@ elseif (! empty($object->id)) print ''; print '
    '; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
    ' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
    ' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
    ' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
    ' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
    ' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
    ' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '; - print fieldLabel('DatePayment','datep',1).''; + print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; print $form->selectDate((empty($datep)?-1:$datep), "datep", '', '', '', 'add', 1, 1); print '
    '; - print fieldLabel('DateValue','datev',0).''; + print $form->editfieldkey('DateValue', 'datev', '', $object, 0).''; print $form->selectDate((empty($datev)?-1:$datev), "datev", '', '', '', 'add', 1, 1); print '
    '; - print fieldLabel('Employee','fk_user',1).''; + print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).''; $noactive=0; // We keep active and unactive users print $form->select_dolusers(GETPOST('fk_user','int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive); print '
    '; - print fieldLabel('Label','label',1).''; + print $form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).''; print 'trans("SalaryPayment")).'">'; print '
    '; - print fieldLabel('DateStartPeriod','datesp',1).''; + print $form->editfieldkey('DateStartPeriod', 'datesp', '', $object, 0, 'string', '', 1).''; print $form->selectDate($datesp, "datesp", '', '', '', 'add'); print '
    '; - print fieldLabel('DateEndPeriod','dateep',1).''; + print $form->editfieldkey('DateEndPeriod', 'dateep', '', $object, 0, 'string', '', 1).''; print $form->selectDate($dateep, "dateep", '', '', '', 'add'); print '
    '; - print fieldLabel('Amount','amount',1).''; + print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; print ''; print '
    '; - print fieldLabel('BankAccount','selectaccountid',1).''; + print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; $form->select_comptes($_POST["accountid"],"accountid",0,'',1); // Affiche liste des comptes courant print '
    '; - print fieldLabel('PaymentMode','selectpaymenttype',1).''; + print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; $form->select_types_paiements(GETPOST("paymenttype"), "paymenttype", '', 2); print '
    skype).'">
    twitter).'">
    facebook).'">
    ' . fieldLabel( 'Categories', 'contcats' ) . ''; - $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, 'parent', null, null, 1 ); - print $form->multiselectarray( 'contcats', $cate_arbo, GETPOST( 'contcats', 'array' ), null, null, null, - null, '90%' ); + print '
    ' . $form->editfieldkey('Categories', 'contcats', '', $object, 0) . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); + print $form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); print "
    skype).'">
    twitter).'">
    facebook).'">
    ' . fieldLabel( 'Categories', 'contcats' ) . '
    ' . $form->editfieldkey('Categories', 'contcats', '', $object, 0) . ''; - $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, null, null, null, 1 ); - $c = new Categorie( $db ); - $cats = $c->containing( $object->id, 'contact' ); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1); + $c = new Categorie($db); + $cats = $c->containing($object->id, 'contact'); foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print $form->multiselectarray( 'contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); + print $form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); print "
    ' . $langs->trans("Categories") . ''; - print $form->showCategories( $object->id, 'contact', 1 ); + print $form->showCategories($object->id, 'contact', 1); print '
    '; - $out.= $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); - $out.= ''; - if (! empty($this->withtocccreadonly)) - { - $out.= (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:""; - } - else - { - $out.= 'withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; - if (! empty($this->withtoccc) && is_array($this->withtoccc)) - { - $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time - $tmparray = $this->withtoccc; - foreach($tmparray as $key => $val) - { - $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); - } - $withtocccselected=GETPOST("receiverccc"); // Array of selected value - $out.= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, null,null, "90%"); - } - } - - $showinfobcc=''; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; - if ($showinfobcc) $out.=' + '.$showinfobcc; - $out.= "
    '.$langs->trans("MailErrorsTo").''; - $out.= $errorstomail; - $out.= "
    '.$langs->trans("MailErrorsTo").''; - $out.= ''; - $out.= "
    '.$langs->trans("DeliveryReceipt").''; - - if (! empty($this->withdeliveryreceiptreadonly)) - { - $out.= yn($this->withdeliveryreceipt); - } - else - { - $defaultvaluefordeliveryreceipt=0; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; - $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); - } - - $out.= "
    '; - $out.=$form->textwithpicto($langs->trans('MailTopic'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfromtopic'); - $out.=''; - if ($this->withtopicreadonly) - { - $out.= $defaulttopic; - $out.= ''; - } - else - { - $out.= ''; - } - $out.= "
    '; + $out.= $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + $out.= ''; + if (! empty($this->withtocccreadonly)) { + $out.= (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:""; + } else { + $out.= 'withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; + if (! empty($this->withtoccc) && is_array($this->withtoccc)) { + $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; + // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + $tmparray = $this->withtoccc; + foreach ($tmparray as $key => $val) { + $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + } + $withtocccselected=GETPOST("receiverccc"); // Array of selected value + $out.= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, null,null, "90%"); + } + } + $showinfobcc=''; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; + if ($showinfobcc) $out.=' + '.$showinfobcc; + $out.= "
    '.$langs->trans("MailErrorsTo").''; + $out = ''; + $out.= $errorstomail; + $out.= "
    '.$langs->trans("MailErrorsTo").''; + $out.= ''; + $out.= "
    '.$langs->trans("DeliveryReceipt").''; + + if (! empty($this->withdeliveryreceiptreadonly)) { + $out.= yn($this->withdeliveryreceipt); + } else { + $defaultvaluefordeliveryreceipt=0; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; + $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); + } + $out.= "
    '; + $out.= $form->textwithpicto($langs->trans('MailTopic'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfromtopic'); + $out.= ''; + if ($this->withtopicreadonly) { + $out.= $defaulttopic; + $out.= ''; + } else { + $out.= ''; + } + $out.= "
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
    '; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -1981,7 +1981,7 @@ elseif (! empty($object->id)) print ''; print '
    '; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -2097,17 +2097,17 @@ elseif (! empty($object->id)) if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -2275,7 +2275,7 @@ elseif (! empty($object->id)) { if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && ! empty($object->user_approve_id)) { - print ''.$langs->trans("ApproveOrder").''; + print ''.$langs->trans("ApproveOrder").''; } else { @@ -2284,7 +2284,7 @@ elseif (! empty($object->id)) } else { - print ''.$langs->trans("ApproveOrder").''; + print ''.$langs->trans("ApproveOrder").''; } } @@ -2297,7 +2297,7 @@ elseif (! empty($object->id)) { if (! empty($object->user_approve_id2)) { - print ''.$langs->trans("Approve2Order").''; + print ''.$langs->trans("Approve2Order").''; } else { @@ -2306,7 +2306,7 @@ elseif (! empty($object->id)) } else { - print ''.$langs->trans("Approve2Order").''; + print ''.$langs->trans("Approve2Order").''; } } } @@ -2320,7 +2320,7 @@ elseif (! empty($object->id)) } else { - print ''.$langs->trans("RefuseOrder").''; + print ''.$langs->trans("RefuseOrder").''; } } @@ -2370,7 +2370,7 @@ elseif (! empty($object->id)) if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) { print ''; } else { - print ''; + print ''; } } } @@ -2383,7 +2383,7 @@ elseif (! empty($object->id)) } else { - print ''; + print ''; } } diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 5d6664347b7..feab3fcb1bc 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -187,7 +187,7 @@ if (! empty($conf->agenda->enabled)) } else { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 729899a8ff2..a8ea0b63f6d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -6,7 +6,8 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Charlene Benke * * 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 @@ -519,42 +520,13 @@ if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ; if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$db->escape($search_billed); if ($search_product_category > 0) $sql.= " AND cp.fk_categorie = ".$search_product_category; - //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') -{ $sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")"; -} if ($search_status != '' && $search_status >= 0) -{ $sql.=" AND cf.fk_statut IN (".$db->escape($search_status).")"; -} -if ($search_ordermonth > 0) -{ - if ($search_orderyear > 0 && empty($search_orderday)) - $sql.= " AND cf.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,$search_ordermonth,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,$search_ordermonth,false))."'"; - else if ($search_orderyear > 0 && ! empty($search_orderday)) - $sql.= " AND cf.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_ordermonth, $search_orderday, $search_orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_ordermonth, $search_orderday, $search_orderyear))."'"; - else - $sql.= " AND date_format(cf.date_commande, '%m') = '".$db->escape($search_ordermonth)."'"; -} -else if ($search_orderyear > 0) -{ - $sql.= " AND cf.date_commande BETWEEN '".$db->idate(dol_get_first_day($search_orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_orderyear,12,false))."'"; -} -if ($search_deliverymonth > 0) -{ - if ($search_deliveryyear > 0 && empty($search_deliveryday)) - $sql.= " AND cf.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,$search_deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,$search_deliverymonth,false))."'"; - else if ($search_deliveryyear > 0 && ! empty($search_deliveryday)) - $sql.= " AND cf.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_eliverymonth, $search_deliveryday, $search_deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_deliverymonth, $search_deliveryday, $search_deliveryyear))."'"; - else - $sql.= " AND date_format(cf.date_livraison, '%m') = '".$db->escape($search_deliverymonth)."'"; -} -else if ($search_deliveryyear > 0) -{ - $sql.= " AND cf.date_livraison BETWEEN '".$db->idate(dol_get_first_day($search_deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_deliveryyear,12,false))."'"; -} +$sql.= dolSqlDateFilter("cf.date_commande", $search_orderday, $search_ordermonth, $search_orderyear); +$sql.= dolSqlDateFilter("cf.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); @@ -647,6 +619,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 4f40b0cae36..5f3c51a6e38 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -41,8 +41,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->produit->enabled)) +if (!empty($conf->produit->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +} if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -516,7 +517,7 @@ if (empty($reshook)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement') . ')'; $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; $sql.= ' AND pf.fk_paiementfourn = p.rowid'; - $sql.= ' AND p.entity IN (' . getEntity('facture').')'; + $sql.= ' AND p.entity IN (' . getEntity('invoice').')'; $resql = $db->query($sql); if (! $resql) dol_print_error($db); @@ -1222,7 +1223,7 @@ if (empty($reshook)) $desc = $productsupplier->desc_supplier; } else $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); $type = $productsupplier->type; $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); @@ -1990,7 +1991,7 @@ if ($action == 'create') if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -2519,7 +2520,7 @@ else print ''; print '
    '; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
    ' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
    ' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
    ' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
    '; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -2536,7 +2537,7 @@ else print ''; print '
    '; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -2614,17 +2615,17 @@ else if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -3021,9 +3022,9 @@ else else { if ($user->rights->fournisseur->facture->creer) { - print '
    '.$langs->trans('ReOpen').'
    '; + print '
    '.$langs->trans('ReOpen').'
    '; } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - print '
    '.$langs->trans('ReOpen').'
    '; + print '
    '.$langs->trans('ReOpen').'
    '; } } } @@ -3035,7 +3036,7 @@ else { print ''; } - else print '
    '.$langs->trans('SendMail').'
    '; + else print '
    '.$langs->trans('SendMail').'
    '; } // Make payments @@ -3060,7 +3061,7 @@ else { if ($resteapayer == 0) { - print '
    '.$langs->trans('DoPaymentBack').'
    '; + print '
    '.$langs->trans('DoPaymentBack').'
    '; } else { @@ -3097,7 +3098,7 @@ else } else { - print ''; } } @@ -3130,20 +3131,20 @@ else { //var_dump($isErasable); if ($isErasable == -4) { - print ''; + print ''; } elseif ($isErasable == -3) { // Should never happen with supplier invoice - print ''; + print ''; } elseif ($isErasable == -2) { // Should never happen with supplier invoice - print ''; + print ''; } elseif ($isErasable == -1) { - print ''; + print ''; } elseif ($isErasable <= 0) // Any other cases { - print ''; + print ''; } else { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9a53b31c8a1..9286c038507 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -10,7 +10,8 @@ * Copyright (C) 2015 Abbes Bahfir * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2018 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 @@ -329,32 +330,8 @@ if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $searc if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode.""; -if ($month > 0) -{ - if ($year > 0 && empty($day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; - else - $sql.= " AND date_format(f.datef, '%m') = '".$month."'"; -} -else if ($year > 0) -{ - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; -} -if ($month_lim > 0) -{ - if ($year_lim > 0 && empty($day_lim)) - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,$month_lim,false))."' AND '".$db->idate(dol_get_last_day($year_lim,$month_lim,false))."'"; - else if ($year_lim > 0 && ! empty($day_lim)) - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim))."'"; - else - $sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$db->escape($month_lim)."'"; -} -else if ($year_lim > 0) -{ - $sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'"; -} +$sql.= dolSqlDateFilter( "f.datef", $day, $month, $year); +$sql.= dolSqlDateFilter( "f.date_lim_reglement", $day_lim, $month_lim, $year_lim); if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'"; if ($search_label) $sql .= natural_search('f.libelle', $search_label); if ($search_status != '' && $search_status >= 0) @@ -477,6 +454,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( 'validate'=>$langs->trans("Validate"), + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index bd957503b94..5f720175b69 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -356,7 +356,7 @@ if ($result > 0) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } } diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 16ed559814d..7a623e2cba2 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -117,6 +117,7 @@ if ($fourn_id) $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 0028367cd3d..0f22e07245b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1326,14 +1326,14 @@ else } else { - print ''.$langs->trans("Approve").''; - print ''.$langs->trans("ActionRefuseCP").''; + print ''.$langs->trans("Approve").''; + print ''.$langs->trans("ActionRefuseCP").''; } } if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || ! empty($user->rights->holiday->write_all)) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved { if (($object->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; - else print ''.$langs->trans("ActionCancelCP").''; + else print ''.$langs->trans("ActionCancelCP").''; } if ($cancreate && $object->statut == Holiday::STATUS_CANCELED) { diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index a2bdcb2a5b3..1cb76abf4ec 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -1,7 +1,8 @@ * Copyright (C) 2013-2018 Laurent Destailleur - * Copyright (C) 2012-2016 Regis Houssin + * Copyright (C) 2012-2016 Regis Houssin + * Copyright (C) 2018 Charlene Benke * * 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 @@ -188,67 +189,24 @@ if(!empty($search_ref)) { $filter.= " AND cp.rowid = ".(int) $db->escape($search_ref); } - // Start date -if($search_year_start > 0) { - if($search_month_start > 0) { - $filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($search_year_start,$search_month_start,1))."' AND '".$db->idate(dol_get_last_day($search_year_start,$search_month_start,1))."')"; - //$filter.= " AND date_format(cp.date_debut, '%Y-%m') = '$search_year_start-$search_month_start'"; - } else { - $filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($search_year_start,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_start,12,1))."')"; - //$filter.= " AND date_format(cp.date_debut, '%Y') = '$search_year_start'"; - } -} else { - if($search_month_start > 0) { - $filter.= " AND date_format(cp.date_debut, '%m') = '".$db->escape($search_month_start)."'"; - } -} - +$filter.= dolSqlDateFilter("cp.date_debut", $search_day_start, $search_month_start, $search_year_start); // End date -if($search_year_end > 0) { - if($search_month_end > 0) { - $filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($search_year_end,$search_month_end,1))."' AND '".$db->idate(dol_get_last_day($search_year_end,$search_month_end,1))."')"; - //$filter.= " AND date_format(cp.date_fin, '%Y-%m') = '$search_year_end-$search_month_end'"; - } else { - $filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($search_year_end,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_end,12,1))."')"; - //$filter.= " AND date_format(cp.date_fin, '%Y') = '$search_year_end'"; - } -} else { - if($search_month_end > 0) { - $filter.= " AND date_format(cp.date_fin, '%m') = '".$db->escape($search_month_end)."'"; - } -} - +$filter.= dolSqlDateFilter("cp.date_fin", $search_day_end, $search_month_end, $search_year_end); // Create date -if($search_year_create > 0) { - if($search_month_create > 0) { - $filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($search_year_create,$search_month_create,1))."' AND '".$db->idate(dol_get_last_day($search_year_create,$search_month_create,1))."')"; - //$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$search_year_create-$search_month_create'"; - } else { - $filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($search_year_create,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_create,12,1))."')"; - //$filter.= " AND date_format(cp.date_create, '%Y') = '$search_year_create'"; - } -} else { - if($search_month_create > 0) { - $filter.= " AND date_format(cp.date_create, '%m') = '".$db->escape($search_month_create)."'"; - } -} - +$filter.= dolSqlDateFilter("cp.date_create", $search_day_create, $search_month_create, $search_year_create); // Employee if(!empty($search_employee) && $search_employee != -1) { $filter.= " AND cp.fk_user = '".$db->escape($search_employee)."'\n"; } - // Validator if(!empty($search_valideur) && $search_valideur != -1) { $filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n"; } - // Type if (!empty($search_type) && $search_type != -1) { $filter.= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; } - // Status if(!empty($search_statut) && $search_statut != -1) { $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index d7f591da027..77126100068 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -185,11 +185,14 @@ if ($action == 'create') print '
    '; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
    ' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
    ' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
    ' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '; // Name - print ''; + print ''; + print ''; + print ''; + print ''; // Address print ''; - print ''; + print ''; print ''; @@ -197,18 +200,23 @@ if ($action == 'create') // Zipcode print ''; - print ''; + print ''; print ''; print ''; // Town print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -272,30 +280,30 @@ if (($id || $ref) && $action == 'edit') print ''; // Name - print ''; // Address - print ''; + print ''; print ''; // Zipcode / Town - print ''; - print ''; // Country - print ''; + print ''; print ''; // Status - print ''; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 5e69a01bcaf..2e4ae5da357 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1091,7 +1091,7 @@ if ($step == 4 && $datatoimport) } else { - print ''.$langs->trans("NextStep").''; + print ''.$langs->trans("NextStep").''; } } @@ -1436,7 +1436,7 @@ if ($step == 5 && $datatoimport) } else { - print ''.$langs->trans("RunSimulateImportFile").''; + print ''.$langs->trans("RunSimulateImportFile").''; } print ''; } @@ -1596,14 +1596,14 @@ if ($step == 5 && $datatoimport) { //print ''; - print ''.$langs->trans("RunImportFile").''; + print ''.$langs->trans("RunImportFile").''; } } else { - print ''.$langs->trans("RunSimulateImportFile").''; + print ''.$langs->trans("RunSimulateImportFile").''; - print ''.$langs->trans("RunImportFile").''; + print ''.$langs->trans("RunImportFile").''; } print ''; } diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index b1852a3de4f..2c1905d9db4 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -96,7 +96,7 @@ if (count($import->array_import_code)) //} //else //{ - // print ''.$langs->trans("NewImport").''; + // print ''.$langs->trans("NewImport").''; //} } print ''; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 834cedb4694..0bf41b5af10 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -1,7 +1,7 @@ -- -- Be carefull to requests order. -- This file must be loaded by calling /install/index.php page --- when current version is 9.0.0 or higher. +-- when current version is 10.0.0 or higher. -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y @@ -27,8 +27,6 @@ -- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; -- Note: fields with type BLOB/TEXT can't have default value. - - -- Missing in 9.0 @@ -57,3 +55,5 @@ create table llx_mailing_unsubscribe )ENGINE=innodb; ALTER TABLE llx_mailing_unsubscribe ADD UNIQUE uk_mailing_unsubscribe(email, entity, unsubscribegroup); + +ALTER TABLE llx_adherent ADD gender VARCHAR(10); diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 96da4ffb326..ede4de2e487 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -30,6 +30,7 @@ create table llx_adherent entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(128), -- reference into an external system (not used by dolibarr) + gender varchar(10), civility varchar(6), lastname varchar(50), firstname varchar(50), diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index fbec38af136..6e3da609683 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4403,7 +4403,7 @@ function migrate_usergroup_rights_entity($db,$langs,$conf) * @param string $newname New name (relative to DOL_DATA_ROOT) * @return void */ -function migrate_rename_directories($db,$langs,$conf,$oldname,$newname) +function migrate_rename_directories($db, $langs, $conf, $oldname, $newname) { dolibarr_install_syslog("upgrade2::migrate_rename_directories"); @@ -4423,70 +4423,65 @@ function migrate_rename_directories($db,$langs,$conf,$oldname,$newname) * @param Conf $conf Object conf * @return void */ -function migrate_delete_old_files($db,$langs,$conf) +function migrate_delete_old_files($db, $langs, $conf) { - $result=true; + $result = true; - dolibarr_install_syslog("upgrade2::migrate_delete_old_files"); + dolibarr_install_syslog("upgrade2::migrate_delete_old_files"); - // List of files to delete - $filetodeletearray=array( - DOL_DOCUMENT_ROOT.'/core/triggers/interface_demo.class.php', - DOL_DOCUMENT_ROOT.'/core/menus/barre_left/default.php', - DOL_DOCUMENT_ROOT.'/core/menus/barre_top/default.php', - DOL_DOCUMENT_ROOT.'/core/modules/modComptabiliteExpert.class.php', - DOL_DOCUMENT_ROOT.'/core/modules/modCommercial.class.php', - DOL_DOCUMENT_ROOT.'/core/modules/modProduit.class.php', - DOL_DOCUMENT_ROOT.'/core/modules/modSkype.class.php', - DOL_DOCUMENT_ROOT.'/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php', - DOL_DOCUMENT_ROOT.'/webcalendar/inc/triggers/interface_modWebcalendar_webcalsynchro.class.php', - DOL_DOCUMENT_ROOT.'/core/triggers/interface_modWebcalendar_Webcalsynchro.class.php', - DOL_DOCUMENT_ROOT.'/core/triggers/interface_modCommande_Ecotax.class.php', - DOL_DOCUMENT_ROOT.'/core/triggers/interface_modCommande_fraisport.class.php', - DOL_DOCUMENT_ROOT.'/core/triggers/interface_modPropale_PropalWorkflow.class.php', - DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone.lib.php', - DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_frontoffice.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts2.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts3.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts4.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/framboise.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/mailings/kiwi.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_crabe.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_oursin.modules.php', + // List of files to delete + $filetodeletearray = array( + '/core/triggers/interface_demo.class.php', + '/core/menus/barre_left/default.php', + '/core/menus/barre_top/default.php', + '/core/modules/modComptabiliteExpert.class.php', + '/core/modules/modCommercial.class.php', + '/core/modules/modProduit.class.php', + '/core/modules/modSkype.class.php', + '/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php', + '/webcalendar/inc/triggers/interface_modWebcalendar_webcalsynchro.class.php', + '/core/triggers/interface_modWebcalendar_Webcalsynchro.class.php', + '/core/triggers/interface_modCommande_Ecotax.class.php', + '/core/triggers/interface_modCommande_fraisport.class.php', + '/core/triggers/interface_modPropale_PropalWorkflow.class.php', + '/core/menus/smartphone/iphone.lib.php', + '/core/menus/smartphone/iphone_backoffice.php', + '/core/menus/smartphone/iphone_frontoffice.php', + '/core/menus/standard/auguria_backoffice.php', + '/core/menus/standard/auguria_frontoffice.php', + '/core/menus/standard/eldy_backoffice.php', + '/core/menus/standard/eldy_frontoffice.php', + '/core/modules/mailings/contacts2.modules.php', + '/core/modules/mailings/contacts3.modules.php', + '/core/modules/mailings/contacts4.modules.php', + '/core/modules/mailings/framboise.modules.php', + '/core/modules/mailings/dolibarr_services_expired.modules.php', + '/core/modules/mailings/peche.modules.php', + '/core/modules/mailings/poire.modules.php', + '/core/modules/mailings/kiwi.modules.php', + '/core/modules/facture/pdf_crabe.modules.php', + '/core/modules/facture/pdf_oursin.modules.php', - DOL_DOCUMENT_ROOT.'/compta/facture/class/api_invoice.class.php', - DOL_DOCUMENT_ROOT.'/commande/class/api_commande.class.php', - DOL_DOCUMENT_ROOT.'/user/class/api_user.class.php', - DOL_DOCUMENT_ROOT.'/product/class/api_product.class.php', - DOL_DOCUMENT_ROOT.'/societe/class/api_contact.class.php', - DOL_DOCUMENT_ROOT.'/societe/class/api_thirdparty.class.php', - DOL_DOCUMENT_ROOT.'/support/online.php' + '/compta/facture/class/api_invoice.class.php', + '/commande/class/api_commande.class.php', + '/user/class/api_user.class.php', + '/product/class/api_product.class.php', + '/societe/class/api_contact.class.php', + '/societe/class/api_thirdparty.class.php', + '/support/online.php', ); - foreach ($filetodeletearray as $filetodelete) - { - //print ''.$filetodelete."
    \n"; - $result=1; - if (file_exists($filetodelete)) - { - $result=dol_delete_file($filetodelete,0,0,0,null,true); - if (! $result) - { + foreach ($filetodeletearray as $filetodelete) { + //print ''DOL_DOCUMENT_ROOT.$filetodelete."
    \n"; + $result = 1; + if (file_exists(DOL_DOCUMENT_ROOT.$filetodelete)) { + $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false); + if (! $result) { $langs->load("errors"); - print '
    '.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile",$filetodelete); + print '
    '.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile", DOL_DOCUMENT_ROOT . $filetodelete); print ' '.$langs->trans("RemoveItManuallyAndPressF5ToContinue").'
    '; - } - else - { - //print $langs->trans("FileWasRemoved",$filetodelete); + } else { + //print $langs->trans("FileWasRemoved", $filetodelete).'
    '; } } } @@ -4501,27 +4496,24 @@ function migrate_delete_old_files($db,$langs,$conf) * @param Conf $conf Object conf * @return void */ -function migrate_delete_old_dir($db,$langs,$conf) +function migrate_delete_old_dir($db, $langs, $conf) { - $result=true; + $result = true; dolibarr_install_syslog("upgrade2::migrate_delete_old_dir"); // List of files to delete $filetodeletearray=array( - DOL_DOCUMENT_ROOT.'/core/modules/facture/terre', - DOL_DOCUMENT_ROOT.'/core/modules/facture/mercure' + DOL_DOCUMENT_ROOT.'/core/modules/facture/terre', + DOL_DOCUMENT_ROOT.'/core/modules/facture/mercure', ); - foreach ($filetodeletearray as $filetodelete) - { + foreach ($filetodeletearray as $filetodelete) { //print ''.$filetodelete."
    \n"; - if (file_exists($filetodelete)) - { - $result=dol_delete_dir_recursive($filetodelete); + if (file_exists($filetodelete)) { + $result = dol_delete_dir_recursive($filetodelete); } - if (! $result) - { + if (! $result) { $langs->load("errors"); print '
    '.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteDir",$filetodelete); print ' '.$langs->trans("RemoveItManuallyAndPressF5ToContinue").'
    '; diff --git a/htdocs/langs/ar_SA/other.lang b/htdocs/langs/ar_SA/other.lang index 55a27196753..f3338b68cdd 100644 --- a/htdocs/langs/ar_SA/other.lang +++ b/htdocs/langs/ar_SA/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/bg_BG/other.lang b/htdocs/langs/bg_BG/other.lang index 6558f3277a6..a49e2bdc2dc 100644 --- a/htdocs/langs/bg_BG/other.lang +++ b/htdocs/langs/bg_BG/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/bn_BD/other.lang b/htdocs/langs/bn_BD/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/bn_BD/other.lang +++ b/htdocs/langs/bn_BD/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/bs_BA/other.lang b/htdocs/langs/bs_BA/other.lang index 329e6b0ab2c..f8f63550fb2 100644 --- a/htdocs/langs/bs_BA/other.lang +++ b/htdocs/langs/bs_BA/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang index 5b044952637..2a9b21a0672 100644 --- a/htdocs/langs/ca_ES/other.lang +++ b/htdocs/langs/ca_ES/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Podeu fer clic a l'enllaç següent per fer el pagament si encara no està fet.\n\n%s\n\n DemoDesc=Dolibarr és un ERP/CRM per a la gestió de negocis (professionals o associacions), compost de mòduls funcionals independents i opcionals. Una demostració que incloga tots aquests mòduls no té sentit perquè no utilitzarà tots els mòduls al mateix temps. Per això, hi han disponibles diferents tipus de perfils de demostració. diff --git a/htdocs/langs/cs_CZ/other.lang b/htdocs/langs/cs_CZ/other.lang index e2c32ee9e0f..fad89925f19 100644 --- a/htdocs/langs/cs_CZ/other.lang +++ b/htdocs/langs/cs_CZ/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr je kompaktní ERP/CRM systém, který se skládá z více funkčních modulů. Demo, které obsahuje všechny moduly vám nepředstaví všechny možnosti, protože v reálné situaci všechny moduly najednou používat nebudete. Pro lepší a snadnější seznámení s celým systémem máte k dispozici několik demo profilů lépe vystihujících vaše požadavky. diff --git a/htdocs/langs/da_DK/other.lang b/htdocs/langs/da_DK/other.lang index a1753ae741a..e6c9d78ccd5 100644 --- a/htdocs/langs/da_DK/other.lang +++ b/htdocs/langs/da_DK/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hej)__\n\nVenligst find vedlagte fak PredefinedMailContentSendShipping=__(Hej)__\n\nSe venligst vedhæftet fragt __REF__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hej)__\n\nVenligst find vedhæftet intervention __REF__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hej)__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hej)__\n\n\n__ (Sincerely) __\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Du kan klikke på linket herunder for at foretage din betaling, hvis den ikke allerede er færdig.\n\n%s\n\n DemoDesc=Dolibarr er en kompakt ERP / CRM, der understøtter flere forretningsmoduler. En demo, der viser alle moduler, giver ingen mening, da dette scenario aldrig forekommer (flere hundrede tilgængelige). Så flere demo profiler er tilgængelige. diff --git a/htdocs/langs/de_DE/other.lang b/htdocs/langs/de_DE/other.lang index a1cfc329ecd..d4cfa4feab6 100644 --- a/htdocs/langs/de_DE/other.lang +++ b/htdocs/langs/de_DE/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Sie können den folgenden Link anklicken um die Zahlung auszuführen, falls sie noch nicht getätigt wurde.\n\n%s\n\n DemoDesc=Dolibarr ist eine Management-Software die mehrere Business-Module anbietet. Eine Demo, die alle Module beinhaltet ist nicht sinnvoll , weil der Fall nie existiert (Hunderte von verfügbaren Module). Es stehen auch einige Demo-Profile Typen zur Verfügung. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d2834c45760..838365d99fe 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -651,9 +651,9 @@ ValueIsValid=Value is valid ValueIsNotValid=Value is not valid RecordCreatedSuccessfully=Record created successfully RecordModifiedSuccessfully=Record modified successfully -RecordsModified=%s record(s) modified -RecordsDeleted=%s record(s) deleted -RecordsGenerated=%s record(s) generated +RecordsModified=%s record modified +RecordsDeleted=%s record deleted +RecordsGenerated=%s record generated AutomaticCode=Automatic code FeatureDisabled=Feature disabled MoveBox=Move widget diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index fd13746007a..d7579c98fc6 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nNos ponemos en contacto PredefinedMailContentSendShipping=__(Hello)__\n\nNos ponemos en contacto con usted para facilitarle el presupuesto __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nNos ponemos en contacto con usted para facilitarle el presupuesto __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hola)__\n\n\n__(Sinceramente)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hola)__\n\n\n__(Sinceramente)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Puede hacer clic en el siguiente enlace para realizar su pago, si aún no lo ha hecho.\n\n%s\n\n DemoDesc=Dolibarr es un ERP/CRM para la gestión de negocios (profesionales o asociaciones), compuesto de módulos funcionales independientes y opcionales. Una demostración que incluya todos estos módulos no tiene sentido porque no utilizará todos los módulos. Además, tiene disponibles varios tipos de perfiles de demostración. diff --git a/htdocs/langs/et_EE/other.lang b/htdocs/langs/et_EE/other.lang index 71ac2bca2a0..ae98e6e4940 100644 --- a/htdocs/langs/et_EE/other.lang +++ b/htdocs/langs/et_EE/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/eu_ES/other.lang b/htdocs/langs/eu_ES/other.lang index 1401e5f2d96..82abec228c5 100644 --- a/htdocs/langs/eu_ES/other.lang +++ b/htdocs/langs/eu_ES/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/fi_FI/other.lang b/htdocs/langs/fi_FI/other.lang index 027dedfb83e..bf459454ba0 100644 --- a/htdocs/langs/fi_FI/other.lang +++ b/htdocs/langs/fi_FI/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 62263b0597d..b6d065edfa9 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -235,6 +235,7 @@ ListOfProductsWithoutAccountingAccount=Liste des produits non liés à un compte ChangeBinding=Changer les liens Accounted=Comptabilisé NotYetAccounted=Pas encore comptabilisé +AccountantFiles = Justificatifs comptablilité ## Admin ApplyMassCategories=Application en masse des catégories diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index ebb13aca043..fb34215d9b2 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nVeuillez trouver la fact PredefinedMailContentSendShipping=__(Hello)__\n\nVeuillez trouver ci-joint l'expédition __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nVeuillez trouver l'intervention ci-jointe __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Vous pouvez cliquer sur le lien ci-dessous pour effectuer votre paiement si ce n'est déjà fait.\n\n%s\n\n DemoDesc=Dolibarr est un logiciel de gestion proposant plusieurs modules métiers. Une démonstration qui inclut tous ces modules n'a pas de sens car ce cas n'existe jamais (plusieurs centaines de modules disponibles). Aussi, quelques profils type de démo sont disponibles. diff --git a/htdocs/langs/he_IL/other.lang b/htdocs/langs/he_IL/other.lang index 5e993be5133..4a8162a8557 100644 --- a/htdocs/langs/he_IL/other.lang +++ b/htdocs/langs/he_IL/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/hr_HR/other.lang b/htdocs/langs/hr_HR/other.lang index f4ff3ea6d8e..419d7ff1c39 100644 --- a/htdocs/langs/hr_HR/other.lang +++ b/htdocs/langs/hr_HR/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/hu_HU/other.lang b/htdocs/langs/hu_HU/other.lang index d00f6b9f0c6..da4f9c1e000 100644 --- a/htdocs/langs/hu_HU/other.lang +++ b/htdocs/langs/hu_HU/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/id_ID/other.lang b/htdocs/langs/id_ID/other.lang index db3a88b9c1a..47f4a5e72d9 100644 --- a/htdocs/langs/id_ID/other.lang +++ b/htdocs/langs/id_ID/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/is_IS/other.lang b/htdocs/langs/is_IS/other.lang index 247ddedc5af..de8a3def77e 100644 --- a/htdocs/langs/is_IS/other.lang +++ b/htdocs/langs/is_IS/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/it_IT/other.lang b/htdocs/langs/it_IT/other.lang index 72b1331fba4..74b9e7a1cbf 100644 --- a/htdocs/langs/it_IT/other.lang +++ b/htdocs/langs/it_IT/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr è un ERP/CRM compatto composto di diversi moduli funzionali. Un demo comprendente tutti i moduli non ha alcun senso, perché un caso simile non esiste nella realtà. Sono dunque disponibili diversi profili demo. diff --git a/htdocs/langs/ja_JP/other.lang b/htdocs/langs/ja_JP/other.lang index d9e958e64c3..88f729df532 100644 --- a/htdocs/langs/ja_JP/other.lang +++ b/htdocs/langs/ja_JP/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/ka_GE/other.lang b/htdocs/langs/ka_GE/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/ka_GE/other.lang +++ b/htdocs/langs/ka_GE/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/kn_IN/other.lang b/htdocs/langs/kn_IN/other.lang index 53af6c5beec..593eee74131 100644 --- a/htdocs/langs/kn_IN/other.lang +++ b/htdocs/langs/kn_IN/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/ko_KR/other.lang b/htdocs/langs/ko_KR/other.lang index 2c071cefa30..e2ab9513e39 100644 --- a/htdocs/langs/ko_KR/other.lang +++ b/htdocs/langs/ko_KR/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/lo_LA/other.lang b/htdocs/langs/lo_LA/other.lang index 363bfed21af..15ef5b3e164 100644 --- a/htdocs/langs/lo_LA/other.lang +++ b/htdocs/langs/lo_LA/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/lt_LT/other.lang b/htdocs/langs/lt_LT/other.lang index 1aecb06a3e0..ac3a2e397ef 100644 --- a/htdocs/langs/lt_LT/other.lang +++ b/htdocs/langs/lt_LT/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/lv_LV/other.lang b/htdocs/langs/lv_LV/other.lang index 9a735b24f8c..0e98d2bcba3 100644 --- a/htdocs/langs/lv_LV/other.lang +++ b/htdocs/langs/lv_LV/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Labdien)__\n\nLūdzu, pievienojiet r PredefinedMailContentSendShipping=__(Labdien)__\n\nLūdzu, pievienojiet piegādi __REF__\n\n\n__ (Ar cieņu) __\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Labdien)__\n\nLūdzu, pievienojiet intervenci __REF__\n\n\n__ (Ar cieņu) __\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Sveiki)__\n\n\n__ (Ar cieņu) __\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Labdien,)__\n\n\n__ (Ar cieņu) __\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Jūs varat noklikšķināt uz zemāk esošās saites, lai veiktu maksājumu, ja tas vēl nav izdarīts.\n\n%s\n\n DemoDesc=Dolibarr ir kompakts ERP / CRM, kas atbalsta vairākus biznesa moduļus. Demonstrācija, kas demonstrē visus moduļus, nav jēga, jo šis scenārijs nekad nenotiek (pieejami vairāki simti). Tātad, ir pieejami vairāki demo profili. diff --git a/htdocs/langs/mk_MK/other.lang b/htdocs/langs/mk_MK/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/mk_MK/other.lang +++ b/htdocs/langs/mk_MK/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/mn_MN/other.lang b/htdocs/langs/mn_MN/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/mn_MN/other.lang +++ b/htdocs/langs/mn_MN/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/nb_NO/other.lang b/htdocs/langs/nb_NO/other.lang index 36a55eeebfc..796a7678b61 100644 --- a/htdocs/langs/nb_NO/other.lang +++ b/htdocs/langs/nb_NO/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hei)__\n\n\n__(Vennlig hilsen)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hei)__\n\n\n__(Vennlig hilsen)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Du kan klikke på linken under for å utføre betalingen din, hvis det ikke allerede er gjort.\n\n%s\n\n DemoDesc=Dolibarr er en kompakt ERP/CRM med støtte for flere forretningsmoduler. En demo som viser alle moduler gir ingen mening da dette scenariet aldri skjer (flere hundre tilgjengelig). Derforer flere demoprofiler er tilgjengelig. diff --git a/htdocs/langs/nl_NL/other.lang b/htdocs/langs/nl_NL/other.lang index 6f5ba9fb0e6..15a23f1cdbb 100644 --- a/htdocs/langs/nl_NL/other.lang +++ b/htdocs/langs/nl_NL/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/pl_PL/other.lang b/htdocs/langs/pl_PL/other.lang index 810e900d0f8..9dc9f35266f 100644 --- a/htdocs/langs/pl_PL/other.lang +++ b/htdocs/langs/pl_PL/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/pt_PT/other.lang b/htdocs/langs/pt_PT/other.lang index 742f34e0abc..c3fd507e4e9 100644 --- a/htdocs/langs/pt_PT/other.lang +++ b/htdocs/langs/pt_PT/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Olá)__\n\nPor favor, encontre a fat PredefinedMailContentSendShipping=__(Olá)__\n\nPor favor, encontrar o envio em anexo __REF__\n\n\n__(Atenciosamente)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Olá)__\n\nPor favor encontre a intervenção em anexo __REF__\n\n\n__(Atenciosamente)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Olá)__\n\n\n__(Atenciosamente)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Olá)__\n\n\n__(Atenciosamente)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=Você pode clicar no link abaixo para fazer seu pagamento, se ainda não estiver pronto.\n\n%s\n\n DemoDesc=O Dolibarr é um ERP/CRM compacto que suporta vários módulos de negócios. Uma demonstração mostrando todos os módulos não faz sentido porque esse cenário nunca ocorre (várias centenas disponíveis). Assim, vários perfis de demonstração estão disponíveis. diff --git a/htdocs/langs/ro_RO/other.lang b/htdocs/langs/ro_RO/other.lang index d423e560227..f468b7d5d6e 100644 --- a/htdocs/langs/ro_RO/other.lang +++ b/htdocs/langs/ro_RO/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sk_SK/other.lang b/htdocs/langs/sk_SK/other.lang index 88907452830..c8c42fc5c11 100644 --- a/htdocs/langs/sk_SK/other.lang +++ b/htdocs/langs/sk_SK/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sl_SI/other.lang b/htdocs/langs/sl_SI/other.lang index c5549ded0a1..01b564a6d4d 100644 --- a/htdocs/langs/sl_SI/other.lang +++ b/htdocs/langs/sl_SI/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sq_AL/other.lang b/htdocs/langs/sq_AL/other.lang index 4e628e0a3b3..c349aa6a2c6 100644 --- a/htdocs/langs/sq_AL/other.lang +++ b/htdocs/langs/sq_AL/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sr_RS/other.lang b/htdocs/langs/sr_RS/other.lang index 417f29264f4..1f46e34c73d 100644 --- a/htdocs/langs/sr_RS/other.lang +++ b/htdocs/langs/sr_RS/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sv_SE/other.lang b/htdocs/langs/sv_SE/other.lang index 7bb42882bab..d97e72ede13 100644 --- a/htdocs/langs/sv_SE/other.lang +++ b/htdocs/langs/sv_SE/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/sw_SW/other.lang b/htdocs/langs/sw_SW/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/sw_SW/other.lang +++ b/htdocs/langs/sw_SW/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/th_TH/other.lang b/htdocs/langs/th_TH/other.lang index f2ff406f446..b05d7b86655 100644 --- a/htdocs/langs/th_TH/other.lang +++ b/htdocs/langs/th_TH/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/tr_TR/other.lang b/htdocs/langs/tr_TR/other.lang index 2907be72ffa..a495eb02583 100644 --- a/htdocs/langs/tr_TR/other.lang +++ b/htdocs/langs/tr_TR/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr, çeşitli iş modüllerini destekleyen kompakt bir ERP/CRM çözümüdür. Tüm modüllerin sergilendiği bir demonun mantığı yoktur, çünkü böyle bir senaryo asla gerçekleşmez (birkaç yüz adet mevcut). Bu nedenle birkaç demo profili vardır. diff --git a/htdocs/langs/uk_UA/other.lang b/htdocs/langs/uk_UA/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/uk_UA/other.lang +++ b/htdocs/langs/uk_UA/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/uz_UZ/other.lang b/htdocs/langs/uz_UZ/other.lang index ec0315b94cd..021bfe65985 100644 --- a/htdocs/langs/uz_UZ/other.lang +++ b/htdocs/langs/uz_UZ/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/vi_VN/other.lang b/htdocs/langs/vi_VN/other.lang index ba88771511a..aadf0444a54 100644 --- a/htdocs/langs/vi_VN/other.lang +++ b/htdocs/langs/vi_VN/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/langs/zh_TW/other.lang b/htdocs/langs/zh_TW/other.lang index 5a8219c5986..90c42c2ec4a 100644 --- a/htdocs/langs/zh_TW/other.lang +++ b/htdocs/langs/zh_TW/other.lang @@ -94,6 +94,7 @@ PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find attached inv PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find attached shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find attached intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentContact=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 0e9b3110a26..017f6a26254 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -289,7 +289,7 @@ if (empty($action) && ! empty($user->rights->loan->delete)) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 5c808051a06..71922b77aa2 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -139,7 +139,7 @@ $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; $sql.= " AND sc.fk_soc = f.fk_soc"; $sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; if (! empty($conf->global->AGENT_CONTACT_TYPE)) diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index fcd5cd4102c..850b47cee17 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -191,7 +191,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as d ON d.fk_facture = f.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON d.fk_product = p.rowid"; $sql .= " WHERE f.fk_statut > 0"; -$sql .= " AND f.entity IN (" . getEntity('facture') . ") "; +$sql .= " AND f.entity IN (" . getEntity('invoice') . ") "; if (! empty($startdate)) $sql .= " AND f.datef >= '" . $db->idate($startdate) . "'"; if (! empty($enddate)) $sql .= " AND f.datef <= '" . $db->idate($enddate) . "'"; if ($search_ref) $sql.=natural_search('f.ref', $search_ref); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 22dec6dd277..ae79cc7957f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -189,7 +189,7 @@ if (! empty($TSelectedCats)) { $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=p.rowid'; } $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; $sql.= " AND f.fk_statut > 0"; $sql.= " AND d.fk_facture = f.rowid"; if ($id > 0) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 9c6c9265592..b1da52ad4aa 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -232,7 +232,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f9b3db7a99e..75754512c71 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -372,7 +372,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } // Clone @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print '
    '."\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f94c34d1804..3e95b3cbb45 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2037,12 +2037,12 @@ if ($action != 'create' && $action != 'edit') } else { - print ''; + print ''; } } else { - print ''; + print ''; } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ae6d193b80f..b872a6e401e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2623,7 +2623,7 @@ class Product extends CommonObject } $sql.= " WHERE f.rowid = fd.fk_facture"; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND fd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; } @@ -2789,7 +2789,7 @@ class Product extends CommonObject if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; } $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; } if ($socid > 0) { $sql.= " AND f.fk_soc = $socid"; diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index baa738c20c5..3e4a87fe9f9 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -219,7 +219,7 @@ print ' print ''.$langs->trans("Back").''; if ($eid == 0) { - print '
    '.$langs->trans('Delete').'
    '."\n"; + print '
    '.$langs->trans('Delete').'
    '."\n"; } else { diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 24848ad26c5..eaa2f3dffc2 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -336,7 +336,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } if ($permissiontodelete) @@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/product/inventory/tpl/inventory.tpl.php b/htdocs/product/inventory/tpl/inventory.tpl.php index 30dc02a17d6..0b89ac8a647 100644 --- a/htdocs/product/inventory/tpl/inventory.tpl.php +++ b/htdocs/product/inventory/tpl/inventory.tpl.php @@ -201,7 +201,7 @@ if (empty($conf) || ! is_object($conf)) - trans('Delete') ?> + trans('Delete') ?> diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dda8cf267c9..323d21e5629 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -417,6 +417,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b610e2a2914..735b01f2123 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -352,7 +352,10 @@ if (empty($reshook)) break; } - $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); + if($object->multiprices[$key]!=$newprice || $object->multiprices_min[$key]!=$newprice_min || $object->multiprices_base_type[$key]!=$val['price_base_type']) + $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); + else $res=0; + if ($res < 0) { $error ++; @@ -1111,7 +1114,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } } else { if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 32efac120b7..6cf8c13208a 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref)) $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND d.fk_product =".$product->id; if (! empty($search_month)) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 6977ac28acf..1d9cbd7952f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -419,12 +419,12 @@ else if ($user->rights->stock->creer) print "id."\">".$langs->trans("Modify").""; else - print "".$langs->trans("Modify").""; + print "".$langs->trans("Modify").""; if ($user->rights->stock->supprimer) print "id."\">".$langs->trans("Delete").""; else - print "".$langs->trans("Delete").""; + print "".$langs->trans("Delete").""; } } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 852bf2a4e8d..54a4cd564ab 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -767,12 +767,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } //if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch()) @@ -783,12 +783,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("TransferStock") . ''; + print '' . $langs->trans("TransferStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 14b4f637718..c9abfd7d4ad 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1118,7 +1118,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } @@ -1131,7 +1131,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } @@ -1144,7 +1144,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } @@ -1157,7 +1157,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } @@ -1225,7 +1225,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } @@ -1238,7 +1238,7 @@ elseif ($object->id > 0) } else { - print ''; + print ''; } } } diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 92c187ce438..d491e55a080 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -169,7 +169,7 @@ if (! empty($conf->agenda->enabled)) } else { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index b220af0d96a..e36a000674b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -438,6 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), // 'presend'=>$langs->trans("SendByMail"), // 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 73ce4a562e4..7b96d2e2ea1 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -333,12 +333,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } print ''; @@ -580,7 +580,7 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } // Delete @@ -592,12 +592,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 78b3ceb75db..b78534bf4b0 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -1,10 +1,11 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 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 @@ -232,6 +233,7 @@ if ($action == 'add') $adh->public = $public; $adh->firstname = $_POST["firstname"]; $adh->lastname = $_POST["lastname"]; + $adh->gender = $_POST["gender"]; $adh->civility_id = $_POST["civility_id"]; $adh->societe = $_POST["societe"]; $adh->address = $_POST["address"]; @@ -580,6 +582,12 @@ print $formcompany->select_civility(GETPOST('civility_id'),'civility_id').' print ''."\n"; // Firstname print ''."\n"; +// Gender +print ''; +print ''; // Company print ''."\n"; // Address diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index c7a9fa45b3a..c2df82fb2f2 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -1,8 +1,9 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2007-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2007-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2018 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 @@ -91,6 +92,7 @@ if ($id > 0) print ''; print ''; print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index cd923ee6dcd..3981731419e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 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 @@ -1148,7 +1149,7 @@ else } else { - print ''.fieldLabel('ThirdPartyName','name').''; + print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; print ''; @@ -1161,11 +1162,11 @@ else // If javascript on, we show option individual if ($conf->use_javascript_ajax) { - print ''; + print ''; print ''; print ''; // Title - print ''; print ''; } @@ -1175,7 +1176,7 @@ else print ''; // Prospect/Customer - print ''; + print ''; print ''; - print '
    '. fieldLabel('Name','name',1).'
    '. $form->editfieldkey('Name', 'name', '', $object, 0, 'string', '', 1).'
    '.fieldLabel('Address','address',0).''.$form->editfieldkey('Address', 'address', '', $object, 0).''; print ''; print '
    '.fieldLabel('Zip','zipcode',0).''.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; - print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array ( + print $formcompany->select_ziptown( + GETPOST('zipcode', 'alpha'), + 'zipcode', + array ( 'town', 'selectcountry_id' - ), 6); + ), + 6 + ); print '
    '.fieldLabel('Town','town',0).''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array ( 'zipcode', @@ -219,7 +227,7 @@ if ($action == 'create') // Country print '
    '.fieldLabel('Country','selectcountry_id',0).''.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country(GETPOST('country_id','int')>0?GETPOST('country_id','int'):$mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); @@ -228,7 +236,7 @@ if ($action == 'create') // Status print '
    '.fieldLabel('Status','status',1).''.$form->editfieldkey('Status', 'status', '', $object, 0, 'string', '', 1).''; print $form->selectarray('status',$status2label,GETPOST('status','alpha')); print '
    '.fieldLabel('Name','name',1).''; + print '
    '.$form->editfieldkey('Name', 'name', '', $object, 0, 'string', '', 1).''; print ''; print '
    '.fieldLabel('Address','address',0).'
    '.$form->editfieldkey('Address', 'address', '', $object, 0).''; print ''; print '
    '.fieldLabel('Zip','zipcode',0).''; + print '
    '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array ( 'town', 'selectcountry_id' ), 6) . '
    '.fieldLabel('Town','town',0).''; + print '
    '.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array ( 'zipcode', 'selectcountry_id' )) . '
    '.fieldLabel('Country','selectcountry_id',0).'
    '.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country($object->fk_country,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); @@ -303,7 +311,7 @@ if (($id || $ref) && $action == 'edit') print '
    '.fieldLabel('Status','status',1).''; + print '
    '.$form->editfieldkey('Status', 'status', '', $object, 0, 'string', '', 1).''; print $form->selectarray('status',$status2label,$object->status); print '
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Gender").''; +$arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1); +print '
    '.$langs->trans("Company").'
    '.$langs->trans("Person").''.$object->morphy.'
    '.$langs->trans("Firstname").''.$object->firstname.' 
    '.$langs->trans("Lastname").''.$object->lastname.' 
    '.$langs->trans("Gender").''.$object->gender.' 
    '.$langs->trans("Company").''.$object->societe.' 
    '.$langs->trans("Address").''.nl2br($object->address).' 
    '.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.' '.$object->town.' 
    '.fieldLabel('FirstName','firstname').'
    '.$form->editfieldkey('FirstName', 'firstname', '', $object, 0).'
    '.fieldLabel('UserTitle','civility_id').''; + print '
    '.$form->editfieldkey('UserTitle', 'civility_id', '', $object, 0).''; print $formcompany->select_civility($object->civility_id, 'civility_id', 'maxwidth100').'
    '.fieldLabel('ProspectCustomer','customerprospect',1).'
    '.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; $selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client; print ''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; // Barcode if (! empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1264,11 +1265,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1287,27 +1288,33 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; - print ''; + print ''; + print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; - print ''; + print ''; + print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; - print ''; + print ''; + print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1322,7 +1329,7 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - print ''; @@ -1334,11 +1341,11 @@ else if ($j % 2 == 1) print ''; // Vat is used - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; // Legal Form - print ''; + print ''; print ''; // Capital - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1431,7 +1438,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1444,7 +1451,7 @@ else // Customer //if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { - print '"; @@ -1452,7 +1459,7 @@ else // Supplier //if ($object->fournisseur) { - print '"; @@ -1463,7 +1470,7 @@ else if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1478,18 +1485,18 @@ else print $object->showOptionals($extrafields,'edit'); } - // Assign a sale representative - print ''; - print ''; - print ''; + // Assign a sale representative + print ''; + print ''; + print ''; // Ajout du logo print ''; - print ''; + print ''; print ''; @@ -1736,7 +1743,7 @@ else } // Name - print ''; + print ''; print ''; // Alias names (commercial, trademark or alias names) @@ -1746,7 +1753,7 @@ else // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; print ''; - print ''; - print ''; + print ''; print ''; @@ -2626,7 +2629,7 @@ else else { $langs->load("mails"); - print ''; + print ''; } if ($user->rights->societe->creer) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index de792c69189..7559301a913 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3804,7 +3804,7 @@ class Societe extends CommonObject if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('facture_fourn').")"; } else { - $sql .= " AND entity IN (".getEntity('facture').")"; + $sql .= " AND entity IN (".getEntity('invoice').")"; } dol_syslog("getOutstandingBills", LOG_DEBUG); diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 97e6817f5d5..5d8936060ac 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -133,7 +133,7 @@ if ($socid) /* } else { - print ''.$langs->trans("AddProject").''; + print ''.$langs->trans("AddProject").''; } } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 69dc4e33307..a7a2e56ecff 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -215,23 +215,23 @@ class ActionsStripeconnect } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif ($resteapayer == 0) { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif (is_object($object) && $object->element == 'invoice_supplier'){ - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } elseif (is_object($object) && $object->element == 'member'){ - print ''.$langs->trans("StripeAutoSubscription").''; + print ''.$langs->trans("StripeAutoSubscription").''; } return 0; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 99e99517f75..55bdddec096 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -630,7 +630,7 @@ if (empty($reshook)) $desc = $productsupplier->desc_supplier; } else $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); $pu_ht = $productsupplier->fourn_pu; @@ -1169,10 +1169,9 @@ if ($action == 'create') } // Multicurrency - if (! empty($conf->multicurrency->enabled)) - { + if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1524,7 +1523,7 @@ if ($action == 'create') print ''; print '
    '; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); @@ -1202,7 +1203,7 @@ else { // Supplier print '
    '.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; $default = -1; if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0)); @@ -1210,7 +1211,7 @@ else print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1228,33 +1229,33 @@ else } // Status - print '
    '.fieldLabel('Status','status').''; + print '
    '.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); print '
    '.fieldLabel('Gencod','barcode').'
    '.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
    '.fieldLabel('Address','address').'
    '.$form->editfieldkey('Address', 'address', '', $object, 0).'
    '.fieldLabel('Zip','zipcode').''; + print '
    '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
    '.fieldLabel('Country','selectcountry_id').''; + print '
    '.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('Region-State','state_id').''; + print '
    '.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
    '.fieldLabel('State','state_id').''; + print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code); @@ -1277,9 +1278,9 @@ else } // Email / Web - print '
    '.fieldLabel('EMail','email',$conf->global->SOCIETE_EMAIL_MANDATORY).'
    '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).'
    '.fieldLabel('Web','url').'
    '.$form->editfieldkey('Web', 'url', '', $object, 0).'
    '.fieldLabel('Skype','skype').'skype).'">
    '.$form->editfieldkey('Skype', 'skype', '', $object, 0).''; + print 'skype).'">'; + print '
    '.fieldLabel('Twitter','twitter').'twitter).'">
    '.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).''; + print 'twitter).'">'; + print '
    '.fieldLabel('Facebook','facebook').'facebook).'">
    '.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; + print 'facebook).'">'; + print '
    '.fieldLabel('Phone','phone').'
    '.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
    '.fieldLabel($idprof,$key, (empty($conf->global->$idprof_mandatory)?0:1)).''; + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', (empty($conf->global->$idprof_mandatory)?0:1)).''; print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
    '.fieldLabel('VATIsUsed','assujtva_value').'
    '.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value', GETPOSTISSET('assujtva_value')?GETPOST('assujtva_value','int'):1, 1); // Assujeti par defaut en creation print ''.fieldLabel('VATIntra','intra_vat').''.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s = ''; @@ -1391,18 +1398,18 @@ else } // Type - Size - print '
    '.fieldLabel('ThirdPartyType','typent_id').''."\n"; + print '
    '.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''."\n"; $sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('JuridicalStatus','forme_juridique_code').'
    '.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; if ($object->country_id) { @@ -1415,13 +1422,13 @@ else print '
    '.fieldLabel('Capital','capital').'
    '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '; print ''.$langs->trans("Currency".$conf->currency).'
    '.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language(($object->default_lang?$object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); print '
    '.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
    ' . fieldLabel('CustomersProspectsCategoriesShort', 'custcats') . ''; + print '
    ' . $form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); print "
    ' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; + print '
    ' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); print "
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
    '.fieldLabel('AllocateCommercial','commercial_id').''; - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); - // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. - print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); - print '
    '.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. + print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); + print '
    '.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; print ''; print '
    '.fieldLabel('ThirdPartyName','name',1).'
    '.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0, 'string', '', 1).'
    '.fieldLabel('Prefix','prefix').''; + print '
    '.$form->editfieldkey('Prefix', 'prefix', '', $object, 0).''; // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { @@ -1761,14 +1768,14 @@ else } // Prospect/Customer - print '
    '.fieldLabel('ProspectCustomer','customerprospect',1).'
    '.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; print ''; + print ''; print ''; } // Status - print ''; // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1872,11 +1879,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1894,27 +1901,27 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; + print ''; print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; + print ''; print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; + print ''; print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1929,12 +1936,8 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if (empty($conf->global->$idprof_mandatory) || ! $object->isACompany()) - print ''; if (($j % 2) == 1) print ''; $j++; @@ -1944,7 +1947,7 @@ else if ($j % 2 == 1) print ''; // VAT is used - print ''; @@ -1952,7 +1955,7 @@ else //TODO: Place into a function to control showing by country or study better option if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; + print ''; print ''; // Type - Size - print ''; - print ''; // Juridical type - print ''; // Capital - print ''; + print ''; print ''; @@ -2051,7 +2054,7 @@ else // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -2061,7 +2064,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -2071,7 +2074,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - print ''; + print ''; print '"; // Supplier - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -2118,15 +2121,15 @@ else // Webservices url/key if (!empty($conf->syncsupplierwebservices->enabled)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; } // Logo print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
    '; if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) @@ -1799,13 +1806,13 @@ else || (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire))) { print '
    '.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1838,31 +1845,31 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
    '.fieldLabel('Gencod','barcode').'
    '.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
    '.fieldLabel('Status','status').''; + print '
    '.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$object->status); print '
    '.fieldLabel('Address','address').'
    '.$form->editfieldkey('Address', 'address', '', $object, 0).'
    '.fieldLabel('Zip','zipcode').''; + print '
    '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '
    '.fieldLabel('Country','selectcounty_id').''; + print '
    '.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('Region-State','state_id').''; + print '
    '.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
    '.fieldLabel('State','state_id').''; + print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } print $formcompany->select_state($object->state_id,$object->country_code); @@ -1884,9 +1891,9 @@ else } // EMail / Web - print '
    '.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
    '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', (! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
    '.fieldLabel('Web','url').'
    '.$form->editfieldkey('Web', 'url', '', $object, 0).'
    '.fieldLabel('Skype','skype').'
    '.$form->editfieldkey('Skype', 'skype', '', $object, 0).'
    '.fieldLabel('Twitter','twitter').'
    '.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'
    '.fieldLabel('Facebook','facebook').'
    '.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'
    '.fieldLabel('Phone','phone').'
    '.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
    '.fieldLabel($idprof,$key).''; - else - print ''.fieldLabel($idprof,$key).''; - - print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', ! (empty($conf->global->$idprof_mandatory) || ! $object->isACompany())).''; + print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
    '.fieldLabel('VATIsUsed','assujtva_value').''; + print '
    '.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
    '.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
    '.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1962,7 +1965,7 @@ else } print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print ''.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) { @@ -1974,7 +1977,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print '
    '.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
    '.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1986,7 +1989,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print '
    '.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print '
    '.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if(! isOnlyOneLocalTax(2)) { @@ -1998,7 +2001,7 @@ else } // VAT Code - print '
    '.fieldLabel('VATIntra','intra_vat').'
    '.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s =''; @@ -2028,22 +2031,22 @@ else print '
    '.fieldLabel('ThirdPartyType','typent_id').''; + print '
    '.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('JuridicalStatus','forme_juridique_code').''; + print '
    '.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); print '
    '.fieldLabel('Capital','capital').'
    '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$conf->currency).'
    '.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); print '
    '.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
    ' . fieldLabel('CustomersCategoriesShort', 'custcats') . '
    ' . $form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); $c = new Categorie($db); @@ -2084,7 +2087,7 @@ else print "
    ' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '
    ' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); $c = new Categorie($db); @@ -2101,7 +2104,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
    '.fieldLabel('WebServiceURL','webservices_url').'
    '.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).''.fieldLabel('WebServiceKey','webservices_key').''.$form->editfieldkey('WebServiceKey', 'webservices_key', '', $object, 0).'
    '.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; if ($object->logo) print $form->showphoto('societe',$object); $caneditfield=1; @@ -2144,7 +2147,7 @@ else // Assign sale representative print '
    '.fieldLabel('AllocateCommercial','commercial_id').''.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); $arrayselected = GETPOST('commercial', 'array'); @@ -2155,7 +2158,7 @@ else print '
    '; print ''; - dol_fiche_end(); + dol_fiche_end(); print '
    '; print ''; @@ -2524,7 +2527,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print !empty($object->multicurrency_code) ? currency_name($object->multicurrency_code,1) : ''; print '
    '.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
    '; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -1541,7 +1540,7 @@ if ($action == 'create') print ''; print '
    '; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -1612,17 +1611,17 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -1778,7 +1777,7 @@ if ($action == 'create') ) { if (count($object->lines) > 0) print ''; - // else print ''.$langs->trans('Validate').''; + // else print ''.$langs->trans('Validate').''; } // Edit @@ -1797,7 +1796,7 @@ if ($action == 'create') if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { print ''; } else - print ''; + print ''; } // Create an order diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 795564984d4..1fe96bc4def 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2018 Charlene Benke * * 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 @@ -77,8 +78,10 @@ $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alp $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); $year=GETPOST("year"); $month=GETPOST("month"); +$day=GETPOST("day"); $yearvalid=GETPOST("yearvalid"); $monthvalid=GETPOST("monthvalid"); +$dayvalid=GETPOST("dayvalid"); $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -196,8 +199,10 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_author=''; $yearvalid=''; $monthvalid=''; + $dayvalid=''; $year=''; $month=''; + $day=''; $search_status=''; $object_statut=''; } @@ -284,32 +289,8 @@ if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')'; -if ($month > 0) -{ - if ($year > 0 && empty($day)) - $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; - else - $sql.= " AND date_format(sp.date_livraison, '%m') = '".$month."'"; -} -else if ($year > 0) -{ - $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; -} -if ($monthvalid > 0) -{ - if ($yearvalid > 0 && empty($dayvalid)) - $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_get_first_day($yearvalid,$monthvalid,false))."' AND '".$db->idate(dol_get_last_day($yearvalid,$monthvalid,false))."'"; - else if ($yearvalid > 0 && ! empty($dayvalid)) - $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $monthvalid, $dayvalid, $yearvalid))."' AND '".$db->idate(dol_mktime(23, 59, 59, $monthvalid, $dayvalid, $yearvalid))."'"; - else - $sql.= " AND date_format(sp.date_valid, '%m') = '".$monthvalid."'"; -} -else if ($yearvalid > 0) -{ - $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_get_first_day($yearvalid,1,false))."' AND '".$db->idate(dol_get_last_day($yearvalid,12,false))."'"; -} +$sql.= dolSqlDateFilter("sp.date_livraison", $day, $month, $year); +$sql.= dolSqlDateFilter("sp.date_valid", $dayvalid, $monthvalid, $yearvalid); if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) { @@ -396,6 +377,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a3d8b119d77..68f01707d58 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -728,7 +728,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Link to create an intervention // socid is needed otherwise fichinter ask it and forgot origin after form submit :\ if (!$object->fk_soc && $user->rights->ficheinter->creer) { - print ''; + print ''; } if ($object->fk_soc > 0 && $object->fk_statut < 8 && $user->rights->ficheinter->creer) { print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b4aed9f7844..a2fab9f41de 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -934,23 +934,23 @@ if ($action == 'create' || $action == 'adduserldap') // Address - print ''; + print ''; print ''; // Zip - print ''; // Town - print ''; // Country - print ''; @@ -958,7 +958,7 @@ if ($action == 'create' || $action == 'adduserldap') // State if (empty($conf->global->USER_DISABLE_STATE)) { - print ''; } @@ -1091,7 +1091,7 @@ if ($action == 'create' || $action == 'adduserldap') // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print ''; @@ -2135,22 +2135,21 @@ else print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1); print ''; - // Employee - print ''; - print ''; + print ''; + print ''; - // Hierarchy + // Hierarchy print ''; print ''; + print ''; print ''; // Zip - print ''; // Town - print ''; // Country - print ''; @@ -2196,7 +2195,7 @@ else // State if (empty($conf->global->USER_DISABLE_STATE)) { - print ''; } @@ -2371,7 +2370,7 @@ else // Categories if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) { - print ''; + print ''; print '
    '; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
    ' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
    ' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
    ' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '.fieldLabel('Address','address').'
    '.$form->editfieldkey('Address', 'address', '', $object, 0).'
    '.fieldLabel('Zip','zipcode').''; + print '
    '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print '
    '.fieldLabel('Town','town').''; + print '
    '.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '
    '.fieldLabel('Country','selectcountry_id').''; + print '
    '.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('State','state_id').''; + print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print '
    ' . fieldLabel('Categories', 'usercats') . ''; + print '
    ' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print $form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), null, null, null, null, '90%' ); @@ -1726,14 +1726,14 @@ else else { $langs->load("mails"); - print ''; + print ''; } if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { - print ''; + print ''; } else { @@ -1751,7 +1751,7 @@ else { if ($object->statut == 0) { - print ''; + print ''; } elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) @@ -1761,13 +1761,13 @@ else if ($object->statut == 0) { - print ''; + print ''; } else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if ($object->email) print ''; - else print ''; + else print ''; } } @@ -1793,7 +1793,7 @@ else } else { - print ''; + print ''; } } } @@ -2123,7 +2123,7 @@ else { $type=0; if ($object->contactid) $type=$object->contactid; - print $form->selectcontacts(0,$type,'contactid',2,'','',1,'',false,1); + print $form->selectcontacts(0, $type, 'contactid', 2, '', '', 1, '', false, 1); if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; } print '
    '.fieldLabel('Employee','employee',0).''; - if ($caneditfield) - { - print $form->selectyesno("employee",$object->employee,1); - }else{ + // Employee + print '
    '.$form->editfieldkey('Employee', 'employee', '', $object, 0).''; + if ($caneditfield) { + print $form->selectyesno("employee", $object->employee, 1); + } else { if ($object->employee){ print $langs->trans("Yes"); - }else{ + } else { print $langs->trans("No"); } } - print '
    '.$langs->trans("HierarchicalResponsible").''; if ($caneditfield) @@ -2172,23 +2171,23 @@ else // Address - print '
    '.fieldLabel('Address','address').'
    '.$form->editfieldkey('Address', 'address', '', $object, 0).'
    '.fieldLabel('Zip','zipcode').''; + print '
    '.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print '
    '.fieldLabel('Town','town').''; + print '
    '.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '
    '.fieldLabel('Country','selectcounty_id').''; + print '
    '.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '.fieldLabel('State','state_id').''; + print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print '
    ' . fieldLabel( 'Categories', 'usercats' ) . '
    ' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, null, null, null, 1 ); $c = new Categorie( $db ); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 0c43a12361d..d501a8d3cac 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -387,7 +387,7 @@ else print '
    '; if (empty($user->admin) && ! empty($dolibarr_main_demo)) { - print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; + print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; } else { @@ -397,7 +397,7 @@ else } else { - print "trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify").""; + print "trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify").""; } } diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 47c1b42e63b..4e8d3ec41d8 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -428,7 +428,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) $sql ='SELECT f.rowid as facid, ref as ref, ref_ext, type, fk_statut as status, total_ttc, total, tva'; $sql.=' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.=" WHERE f.entity = ".$conf->entity; + $sql.=" WHERE f.entity IN (".getEntity('invoice').")"; if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty); $resql=$db->query($sql); diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index ed7dd35df36..21023c6f545 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -252,6 +252,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase //$localobject->note_public='New note public after update'; $localobject->lastname='New name'; $localobject->firstname='New firstname'; + $localobject->gender='man'; $localobject->address='New address'; $localobject->zip='New zip'; $localobject->town='New town'; @@ -284,6 +285,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $this->assertEquals($localobject->note_public, $newobject->note_public); $this->assertEquals($localobject->lastname, $newobject->lastname); $this->assertEquals($localobject->firstname, $newobject->firstname); + $this->assertEquals($localobject->gender, $newobject->gender); $this->assertEquals($localobject->address, $newobject->address); $this->assertEquals($localobject->zip, $newobject->zip); $this->assertEquals($localobject->town, $newobject->town);