diff --git a/.travis.yml b/.travis.yml index 688d706331d..9958556d42d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -404,6 +404,10 @@ script: php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log + php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log + php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log + php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log + # Enable modules not enabled into original dump php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log echo $? diff --git a/ChangeLog b/ChangeLog index dafa90b9632..20a1748af6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -78,7 +78,7 @@ FIX: we must export company mail address on contact vcard only if contact email FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create FIX: Wrong Sql on getListOfTowns api method FIX: wrong user right's name to top menu "commercial" -FIX: XSS Vulnerability +FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security ***** ChangeLog for 12.0.0 compared to 11.0.0 ***** For Users: diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 26476119cca..f8fa0774400 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -438,7 +438,7 @@ if ($action == 'create') print $langs->trans('Docdate'); print ''; if ($action != 'editdate') - print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).''; + print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).''; print ''; print ''; if ($action == 'editdate') { @@ -462,7 +462,7 @@ if ($action == 'create') print $langs->trans('Codejournal'); print ''; if ($action != 'editjournal') - print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; print ''; print ''; if ($action == 'editjournal') { @@ -486,7 +486,7 @@ if ($action == 'create') print $langs->trans('Piece'); print ''; if ($action != 'editdocref') - print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; print ''; print ''; if ($action == 'editdocref') { @@ -650,8 +650,8 @@ if ($action == 'create') print ''.price($line->credit).''; print ''; - print 'id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">'; - print img_edit(); + print 'id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">'; + print img_edit('', 0, 'class="marginrightonly"'); print '  '; $actiontodelete = 'delete'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 15cfd9ed9db..cce441c4052 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; + if ($value == 'dayrule' && empty($_POST['dayrule'])) continue; if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position' if ((!isset($_POST[$value]) || $_POST[$value] == '') && (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f0ad4352b60..f642cd64182 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -177,7 +177,11 @@ $sessiontimeout = ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout; print ''; print ''.$langs->trans("SessionTimeOut").''; -print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"))); +if (ini_get("session.gc_probability") == 0) { + print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime"))); +} else { + print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime"))); +} print ''; print ''; print ' '.strtolower($langs->trans("Seconds")); @@ -185,7 +189,6 @@ print ''; print ''; -$sessiontimeout = ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = ""; print ''; print ''.$langs->trans("MAIN_APPLICATION_TITLE").''; diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index d9a010019a5..de10759c92d 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz'))) $file .= '.tar'; // We also exclude '/temp/' dir and 'documents/admin/documents' - $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); + $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); $result = $utils->executeCLI($cmd, $outputfile); diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 92f43ec3fce..4d5f980de83 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -79,7 +79,7 @@ function bomPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("BOM"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 6ab6bc283b6..385dd506031 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -135,7 +135,7 @@ $head = array(); $h = 1; $head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? 'id='.$object->id : ''); -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("Bookmark"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c4366ebf19c..803b4ae34ab 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -735,7 +735,7 @@ if ($type == Categorie::TYPE_CONTACT) $num = count($contacts); $nbtotalofrecords = ''; $newcardbutton = ''; - print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contacts', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit); print ''."\n"; print ''."\n"; @@ -989,7 +989,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) print '
'; $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = ''; - print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit); print "
'.$langs->trans("Ref").'
\n"; print ''."\n"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7141d875567..bf906989d16 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -679,6 +679,7 @@ class ActionComm extends CommonObject $sql = "SELECT a.id,"; $sql .= " a.id as ref,"; + $sql .= " a.entity,"; $sql .= " a.ref_ext,"; $sql .= " a.datep,"; $sql .= " a.datep2,"; @@ -715,6 +716,7 @@ class ActionComm extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->id; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->ref_ext = $obj->ref_ext; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 29701f57c59..308dad5dbca 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -131,15 +131,14 @@ if ($result) print ''; print ''; print ''; - print ""; } else { print ""; - print ''; } print ""; diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index abab3b4ff9c..6f6d7236f15 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -46,7 +46,7 @@ $object->info($id); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id; -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("BankTransaction"); $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 6e53dd00c37..bf8dc6f5649 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -257,7 +257,7 @@ foreach ($cats as $cat) { $tabs = array( array( DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid, - $langs->trans('Card') + $langs->trans('BankTransaction') ), array( DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid, diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 70a26d231e1..3780fbc1afe 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -612,7 +612,7 @@ if (empty($action) || $action == "view" || $action == "close") else { $head = array(); $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id; - $head[0][1] = $langs->trans("Card"); + $head[0][1] = $langs->trans("CashControl"); $head[0][2] = 'cashcontrol'; dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account'); diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 29d6f982d59..e14581f6531 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -342,7 +342,7 @@ if ($resql) print ''; print ''; print ''; - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)print ''; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) print ''; print ''; print ''; print ''; @@ -379,7 +379,7 @@ if ($resql) print ''; // Expected to pay - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) { print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a3cdb1747a0..d9753001db2 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1590,7 +1590,7 @@ class Contact extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'socpeople' + 'socpeople', 'societe_contacts' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 21682a4abe6..317c639ad91 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -56,7 +56,7 @@ function accounting_prepare_head(AccountingAccount $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Asset"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index da51589b8ac..d0f102a4e78 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -39,7 +39,7 @@ function bank_prepare_head(Account $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/bank/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("BankAccount"); $head[$h][2] = 'bankname'; $h++; @@ -211,7 +211,7 @@ function various_payment_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("VariousPayment"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index e0945f9a029..e900e6ff424 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -40,7 +40,7 @@ function categories_prepare_head(Categorie $object, $type) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Category"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 17597c41c38..4b0a2d5b131 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -46,7 +46,7 @@ function societe_prepare_head(Societe $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("ThirdParty"); $head[$h][2] = 'card'; $h++; @@ -367,7 +367,7 @@ function societe_prepare_head2($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("ThirdParty"); $head[$h][2] = 'company'; $h++; diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 901a5992494..1589809dd6b 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -38,7 +38,7 @@ function contact_prepare_head(Contact $object) $head = array(); $head[$tab][0] = DOL_URL_ROOT.'/contact/card.php?id='.$object->id; - $head[$tab][1] = $langs->trans("Card"); + $head[$tab][1] = $langs->trans("Contact"); $head[$tab][2] = 'card'; $tab++; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index b2280657481..425dd05fbb5 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -68,7 +68,7 @@ function donation_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Donation"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index 4dbb418855a..3d14f14a7df 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -81,14 +81,14 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '') if ($module == 'ecm') { $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Directory"); $head[$h][2] = 'card'; $h++; } else { $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Directory"); $head[$h][2] = 'card'; $h++; } @@ -109,7 +109,7 @@ function ecm_file_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label); - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("File"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 2767af2e792..4c54ca09e31 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -35,7 +35,7 @@ function expensereport_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/expensereport/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("ExpenseReport"); $head[$h][2] = 'card'; $h++; @@ -94,7 +94,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("ExpenseReport"); $head[$h][2] = 'payment'; $h++; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8d0809f9768..260bbf980f8 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -42,7 +42,7 @@ function fichinter_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Intervention"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index f54772c2339..8bd3ff55624 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -35,7 +35,7 @@ function fiscalyear_prepare_head(Fiscalyear $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("FiscalPeriod"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 878b85993b5..c2cad773af6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3167,7 +3167,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'off', 'on', 'order', 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip', - 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', + 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic', @@ -3178,7 +3178,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = $pictowithouttext; $facolor = ''; $fasize = ''; $fa = 'fas'; - if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark'))) { + if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) { $fa = 'far'; } if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) { @@ -3212,7 +3212,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', - 'uparrow'=>'mail-forward', + 'uparrow'=>'mail-forward', 'vcard'=>'address-card', 'jabber'=>'comment-o', 'website'=>'globe-americas' ); diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index 987895c27d8..bb114b6a62e 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -35,7 +35,7 @@ function holiday_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Holiday"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index 83eafa2548f..3b336fee8d3 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -37,7 +37,7 @@ function establishment_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Establishment"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index d6993845488..815060c8022 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -38,7 +38,7 @@ function member_prepare_head(Adherent $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Member"); $head[$h][2] = 'general'; $h++; @@ -124,7 +124,7 @@ function member_type_prepare_head(AdherentType $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("MemberType"); $head[$h][2] = 'card'; $h++; @@ -276,7 +276,7 @@ function subscription_prepare_head(Subscription $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Subscription"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 80aed36f674..d031984552e 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -34,7 +34,7 @@ function payment_prepare_head(Paiement $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Payment"); $head[$h][2] = 'payment'; $h++; @@ -69,7 +69,7 @@ function payment_supplier_prepare_head(Paiement $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Payment"); $head[$h][2] = 'payment'; $h++; diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index eca43aef3f6..a404e19184e 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -40,7 +40,7 @@ function prelevement_prepare_head(BonPrelevement $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("WithdrawalsReceipts"); $head[$h][2] = 'prelevement'; $h++; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 0615ff127b0..43acb16ba2a 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -41,7 +41,7 @@ function product_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("ProductOrService"); $head[$h][2] = 'card'; $h++; @@ -216,7 +216,7 @@ function productlot_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Lot"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f3690694b01..bf60968387a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -168,7 +168,7 @@ function task_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : ''); - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Project"); $head[$h][2] = 'task_task'; $h++; diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 0e2328bc7e7..5a94e025097 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -34,7 +34,7 @@ function salaries_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/salaries/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("SalaryPayment"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index 988c7a2d78c..0b9deb7779b 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -35,7 +35,7 @@ function stock_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Warehouse"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 1b2a5c1245f..cf6607e6960 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -78,7 +78,7 @@ function ticket_prepare_head($object) $h = 0; $head = array(); $head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id='.$object->track_id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Ticket"); $head[$h][2] = 'tabTicket'; $h++; diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index ec8c6a6858f..cdc7360fbf8 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -35,7 +35,7 @@ function trip_prepare_head(Deplacement $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("Trip"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 5eac4469c4e..782c22a7d33 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -520,7 +520,7 @@ function includeContainer($containerref) $tmpoutput = ob_get_contents(); ob_end_clean(); - print "\n".''."\n"; + print "\n".''."\n"; print preg_replace(array('/^.*]*>/ims', '/<\/body>.*$/ims'), array('', ''), $tmpoutput); if (!$res) @@ -533,14 +533,15 @@ function includeContainer($containerref) /** * Return HTML content to add structured data for an article, news or Blog Post. + * Use the json-ld format. * - * @param string $type 'blogpost', 'product', 'software'... + * @param string $type 'blogpost', 'product', 'software', 'organization', ... * @param array $data Array of data parameters for structured data * @return string HTML content */ function getStructuredData($type, $data = array()) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs; // Very important. Required to have var available when running inluded containers. if ($type == 'software') { @@ -551,7 +552,7 @@ function getStructuredData($type, $data = array()) "@type": "SoftwareApplication", "name": "'.dol_escape_json($data['name']).'", "operatingSystem": "'.dol_escape_json($data['os']).'", - "applicationCategory": "https://schema.org/GameApplication", + "applicationCategory": "https://schema.org/'.$data['applicationCategory'].'", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "'.$data['ratingvalue'].'", @@ -565,6 +566,44 @@ function getStructuredData($type, $data = array()) }'."\n"; $ret .= ''."\n"; } + elseif ($type == 'organization') + { + $companyname = $mysoc->name; + $url = $mysoc->url; + + $ret = ''."\n"; + $ret .= ''."\n"; + } elseif ($type == 'blogpost') { if (!empty($websitepage->author_alias)) @@ -581,7 +620,7 @@ function getStructuredData($type, $data = array()) $pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl); $title = str_replace('__WEBSITE_KEY__', $website->ref, $title); - $image = str_replace('__WEBSITE_KEY__', $website->ref, $image); + $image = 'medias/'.str_replace('__WEBSITE_KEY__', $website->ref, $image); $companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname); $description = str_replace('__WEBSITE_KEY__', $website->ref, $description); @@ -598,6 +637,7 @@ function getStructuredData($type, $data = array()) "image": [ "'.dol_escape_json($image).'" ], + "dateCreated": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'", "datePublished": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'", "dateModified": "'.dol_print_date($websitepage->date_modification, 'dayhourrfc').'", "author": { @@ -609,11 +649,22 @@ function getStructuredData($type, $data = array()) "name": "'.dol_escape_json($companyname).'", "logo": { "@type": "ImageObject", - "url": "/viewimage.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'" + "url": "/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'" } - }, - "description": "'.dol_escape_json($description).'" - }'."\n"; + },'."\n"; + if ($websitepage->keywords) { + $ret .= '"keywords": ['; + $i = 0; + $arrayofkeywords = explode(',', $websitepage->keywords); + foreach($arrayofkeywords as $keyword) { + $ret.= '"'.dol_escape_json($keyword).'"'; + $i++; + if ($i < count($arrayofkeywords)) $ret .= ', '; + } + $ret .= '],'."\n"; + } + $ret .= '"description": "'.dol_escape_json($description).'"'; + $ret .= "\n".'}'."\n"; $ret .= ''."\n"; } } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index fc56a489d75..ce1f27b49fc 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -196,7 +196,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) else dol_print_error($db); } // Add canonical reference - $tplcontent .= ''."\n"; + if ($object->virtualhost) { + $tplcontent .= ''."\n"; + } // Add manifest.json on homepage $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cc27a4ae825..3f539260856 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -308,8 +308,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // 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' + 'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)), + 'module'=>'banque|prelevement|paymentbybanktransfer' ); $menu_arr[] = array( 'name' => 'Bank', @@ -1464,7 +1464,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Load translation files required by the page $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); - // Bank-Caisse + // Bank-Cash account if (!empty($conf->banque->enabled)) { $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank'); @@ -1484,14 +1484,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); } - // Prelevements + // Direct debit order if (!empty($conf->prelevement->enabled)) { $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); - $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); @@ -1503,7 +1501,22 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } } - // Gestion cheques + // Bank transfer order + if (!empty($conf->paymentbybanktransfer->enabled)) + { + $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer'); + + if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { + $newmenu->add("/compta/paymentbybanktransfer/create.php?mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create); + + $newmenu->add("/compta/paymentbybanktransfer/bons.php?mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/paymentbybanktransfer/list.php?mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/paymentbybanktransfer/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/paymentbybanktransfer/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read); + } + } + + // Management of checks 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'); diff --git a/htdocs/core/modules/modPaymentByBankTransfer.class.php b/htdocs/core/modules/modPaymentByBankTransfer.class.php new file mode 100644 index 00000000000..d68274e2dee --- /dev/null +++ b/htdocs/core/modules/modPaymentByBankTransfer.class.php @@ -0,0 +1,148 @@ + + * Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2011 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup paymentbybanktransfer Module paymentbybanktransfer + * \brief Module to manage payment by bank transfer + * \file htdocs/core/modules/modPaymentByBankTransfer.class.php + * \ingroup paymentbybanktransfer + * \brief File to describe and activate the module PaymentByBankTransfer + */ + +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + + +/** + * Class to describe and enable module of payment by Bank transfer + */ +class modPaymentByBankTransfer extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $conf; + + $this->db = $db; + $this->numero = 56; + + $this->family = "financial"; + $this->module_position = '52'; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i', '', get_class($this)); + $this->description = "Management of payment by bank transfer"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; + + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Name of png file (without png) used for this module + $this->picto = 'payment'; + + // Data directories to create when module is enabled + $this->dirs = array("/paymentbybanktransfer/temp", "/paymentbybanktransfer/receipts"); + + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array("modFournisseur", "modBanque"); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5, 4); // Minimum version of PHP required by module + + // Config pages + $this->config_page_url = array("paymentbybanktransfer.php"); + + // Constants + $this->const = array(); + $r = 0; + + /*$this->const[$r][0] = "BANK_ADDON_PDF"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "sepamandate"; + $this->const[$r][3] = 'Name of manager to generate SEPA mandate'; + $this->const[$r][4] = 0; + $r++;*/ + + + // Boxes + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'paymentbybanktransfer'; + $r = 0; + $r++; + $this->rights[$r][0] = 561; + $this->rights[$r][1] = 'Read bank transfer payment orders'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'read'; + + $r++; + $this->rights[$r][0] = 562; + $this->rights[$r][1] = 'Create/modify a bank transfer payment order'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'create'; + + $r++; + $this->rights[$r][0] = 563; + $this->rights[$r][1] = 'Send/Transmit bank transfer payment order'; + $this->rights[$r][2] = 'a'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'send'; + + $r++; + $this->rights[$r][0] = 564; + $this->rights[$r][1] = 'Record Debits/Rejects of bank transfer payment order'; + $this->rights[$r][2] = 'a'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'debit'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } + + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options = '') + { + global $conf; + + // Permissions + $this->remove($options); + + $sql = array(); + + return $this->_init($sql, $options); + } +} diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 4eb1ce3a171..00259fec22c 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -20,17 +20,17 @@ /** * \defgroup prelevement Module prelevement - * \brief Module de gestion des prelevements bancaires + * \brief Module to manage Direct debit orders * \file htdocs/core/modules/modPrelevement.class.php * \ingroup prelevement - * \brief Fichier de description et activation du module Prelevement + * \brief File to describe and enable the module Prelevement */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** - * Class to describe and enable module Prelevement + * Class to describe and enable module of payment by Direct Debit */ class modPrelevement extends DolibarrModules { @@ -51,7 +51,7 @@ class modPrelevement extends DolibarrModules $this->module_position = '52'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Gestion des Prelevements"; + $this->description = "Management of Direct Debit orders"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; @@ -124,15 +124,6 @@ class modPrelevement extends DolibarrModules $this->rights[$r][4] = 'bons'; $this->rights[$r][5] = 'credit'; - /* - $this->rights[2][0] = 154; - $this->rights[2][1] = 'Setup withdraw account'; - $this->rights[2][2] = 'w'; - $this->rights[2][3] = 0; - $this->rights[2][4] = 'bons'; - $this->rights[2][5] = 'configurer'; - */ - // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 6456fabf5b3..5c618b089a3 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -68,7 +68,7 @@ if ($pageid > 0) { $websitepage->fetch($pageid); - $weblangs->setDefaultLang(empty($_COOKIE['weblangs-shortcode']) ? 'auto' : $_COOKIE['weblangs-shortcode']); + $weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : $_COOKIE['weblangs-shortcode'])); $pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang); if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 0017f0a8556..e1784dc4b8b 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -122,7 +122,7 @@ $form = new Form($db); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/don/payment/card.php?id='.$id; -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("DonationPayment"); $hselected = $h; $h++; diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index 089545e8d7e..fe4a5f1b19c 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -26,7 +26,7 @@ * Prepare array of tabs for EmailCollector * * @param EmailCollector $object EmailCollector - * @return array Array of tabs + * @return array Array of tabs */ function emailcollectorPrepareHead($object) { @@ -38,7 +38,7 @@ function emailcollectorPrepareHead($object) $head = array(); $head[$h][0] = dol_buildpath("/admin/emailcollector_card.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("EmailCollector"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 52ec6048506..1ccfe9944f7 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -539,7 +539,7 @@ class Expedition extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($ref_ext)) return -1; - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed"; + $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed"; $sql .= ", e.date_valid"; $sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; @@ -568,6 +568,7 @@ class Expedition extends CommonObject $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->socid = $obj->socid; $this->ref_customer = $obj->ref_customer; diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 210fe31d1ef..782516353b2 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -33,4 +33,4 @@ -- For v13 - +ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql index 743d4ec9ca8..717052f795c 100644 --- a/htdocs/install/mysql/tables/llx_website.sql +++ b/htdocs/install/mysql/tables/llx_website.sql @@ -35,6 +35,7 @@ CREATE TABLE llx_website fk_user_creat integer, fk_user_modif integer, date_creation datetime, + position integer DEFAULT 0, tms timestamp, import_key varchar(14) -- import key ) ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6c139a0f10c..84c64a23615 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -541,8 +541,8 @@ Module54Name=Contracts/Subscriptions Module54Desc=Management of contracts (services or recurring subscriptions) Module55Name=Barcodes Module55Desc=Barcode management -Module56Name=Telephony -Module56Desc=Telephony integration +Module56Name=Payment by bank transfer +Module56Desc=Management of payment by bank transfer orders. It includes generation of SEPA file for European countries. Module57Name=Bank Direct Debit payments Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries. Module58Name=ClickToDial @@ -1145,6 +1145,7 @@ AvailableModules=Available app/modules ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). SessionTimeOut=Time out for session SessionExplanation=This number guarantees that the session will never expire before this delay, if the session cleaner is done by Internal PHP session cleaner (and nothing else). Internal PHP session cleaner does not guarantee that the session will expire after this delay. It will expire, after this delay, and when the session cleaner is run, so every %s/%s access, but only during access made by other sessions (if value is 0, it means clearing of session is done only by an external process).
Note: on some servers with an external session cleaning mechanism (cron under debian, ubuntu ...), the sessions can be destroyed after a period defined by an external setup, no matter what the value entered here is. +SessionsPurgedByExternalSystem=Sessions on this server seems to be cleaned by an external mechanism (cron under debian, ubuntu ...), probably every %s seconds (= value of parameter session.gc_maxlifetime), so changing the value here has no effect. You must ask the server administrator to change session delay. TriggersAvailable=Available triggers TriggersDesc=Triggers are files that will modify the behavior of Dolibarr workflow once copied into the directory htdocs/core/triggers. They realize new actions, activated on Dolibarr events (new company creation, invoice validation, ...). TriggerDisabledByName=Triggers in this file are disabled by the -NORUN suffix in their name. diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index e54239e9fb2..48bd2b81c2e 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -37,6 +37,8 @@ IbanValid=BAN valid IbanNotValid=BAN not valid StandingOrders=Direct Debit orders StandingOrder=Direct debit order +PaymentByBankTransfers=Payments by bank transfer +PaymentByBankTransfer=Payment by bank transfer AccountStatement=Account statement AccountStatementShort=Statement AccountStatements=Account statements diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 9f11d8ecf87..276fd94374d 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -243,6 +243,8 @@ SendBillRef=Submission of invoice %s SendReminderBillRef=Submission of invoice %s (reminder) StandingOrders=Direct debit orders StandingOrder=Direct debit order +PaymentByBankTransfers=Payments by bank transfer +PaymentByBankTransfer=Payment by bank transfer NoDraftBills=No draft invoices NoOtherDraftBills=No other draft invoices NoDraftInvoices=No draft invoices diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 0fad58c9389..1a9208bcf85 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -19,7 +19,6 @@ ProspectionArea=Prospection area IdThirdParty=Id third party IdCompany=Company Id IdContact=Contact Id -Contacts=Contacts/Addresses ThirdPartyContacts=Third-party contacts ThirdPartyContact=Third-party contact/address Company=Company @@ -298,7 +297,8 @@ AddContact=Create contact AddContactAddress=Create contact/address EditContact=Edit contact EditContactAddress=Edit contact/address -Contact=Contact +Contact=Contact/Address +Contacts=Contacts/Addresses ContactId=Contact id ContactsAddresses=Contacts/Addresses FromContactName=Name: diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 135ac1ae9ec..b89e1fb0a38 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -27,7 +27,7 @@ DangerZone=Danger zone BuildPackage=Build package BuildPackageDesc=You can generate a zip package of your application so your are ready to distribute it on any Dolibarr. You can also distribute it or sell it on marketplace like DoliStore.com. BuildDocumentation=Build documentation -ModuleIsNotActive=This module is not activated yet. Go to %s to make it live or click here: +ModuleIsNotActive=This module is not activated yet. Go to %s to make it live or click here ModuleIsLive=This module has been activated. Any change may break a current live feature. DescriptionLong=Long description EditorName=Name of editor diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index b1d6e30e329..ad51b045a37 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -4,9 +4,13 @@ SuppliersStandingOrdersArea=Direct credit payment orders area StandingOrdersPayment=Direct debit payment orders StandingOrderPayment=Direct debit payment order NewStandingOrder=New direct debit order +NewPaymentByBankTransfer=New payment by bank transfer StandingOrderToProcess=To process +PaymentByBankTransferReceipts=Bank transfer orders +PaymentByBankTransferLines=Bank transfer order lines WithdrawalsReceipts=Direct debit orders WithdrawalReceipt=Direct debit order +LatestBankTransferReceipts=Latest %s bank transfer orders LastWithdrawalReceipts=Latest %s direct debit files WithdrawalsLines=Direct debit order lines RequestStandingOrderToTreat=Request for direct debit payment order to process @@ -14,10 +18,12 @@ RequestStandingOrderTreated=Request for direct debit payment order processed NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. NbOfInvoiceToWithdraw=No. of qualified invoice with waiting direct debit order NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information +SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by bank transfer InvoiceWaitingWithdraw=Invoice waiting for direct debit AmountToWithdraw=Amount to withdraw WithdrawsRefused=Direct debit refused NoInvoiceToWithdraw=No customer invoice with open 'Direct debit requests' is waiting. Go on tab '%s' on invoice card to make a request. +NoSupplierInvoiceToWithdraw=No supplier invoice with open 'Direct credit requests' is waiting. Go on tab '%s' on invoice card to make a request. ResponsibleUser=User Responsible WithdrawalsSetup=Direct debit payment setup WithdrawStatistics=Direct debit payment statistics diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 4798366d087..b739b81ca54 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -122,7 +122,7 @@ $form = new Form($db); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/loan/payment/card.php?id='.$id; -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("PaymentLoan"); $hselected = $h; $h++; diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 241a036cc44..f203633584e 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -37,7 +37,7 @@ function moPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Card"); + $head[$h][1] = $langs->trans("MO"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 31ec69f3a42..2fa067ba9a3 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -38,7 +38,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) $head = array(); $head[0][0] = 'card.php?id='.$object->id_sondage; - $head[0][1] = $langs->trans("Card"); + $head[0][1] = $langs->trans("Survey"); $head[0][2] = 'general'; $h++; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c4a1eb9a71d..6af779a2295 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -580,7 +580,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); @@ -871,7 +871,7 @@ elseif ($object->id > 0) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 62140ba5d89..de65e05d41e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3745,6 +3745,13 @@ class Societe extends CommonObject $this->instagram_url = empty($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL; $this->youtube_url = empty($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL; $this->github_url = empty($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_GITHUB_URL; + $this->socialnetworks = array(); + if (! empty($this->facebook_url)) $this->socialnetworks['facebook'] = $this->facebook_url; + if (! empty($this->twitter_url)) $this->socialnetworks['twitter'] = $this->twitter_url; + if (! empty($this->linkedin_url)) $this->socialnetworks['linkedin'] = $this->linkedin_url; + if (! empty($this->instagram_url)) $this->socialnetworks['instagram'] = $this->instagram_url; + if (! empty($this->youtube_url)) $this->socialnetworks['youtube'] = $this->youtube_url; + if (! empty($this->github_url)) $this->socialnetworks['github'] = $this->github_url; // Id prof generiques $this->idprof1 = empty($conf->global->MAIN_INFO_SIREN) ? '' : $conf->global->MAIN_INFO_SIREN; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8da96df54d0..dbc68afeaf4 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -772,15 +772,17 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
-
-
+
+
'.$langs->trans("Ref").'
".$objp->label."'; - print ''.img_edit().'  '; - print ''.img_delete().''; + print ''; + print ''.img_edit().''; + print ''.img_delete().''; print '
'.$langs->trans('Bill').''.$langs->trans('Company').''.$langs->trans('Entity').''.$langs->trans('Entity').''.$langs->trans('ExpectedToPay').''.$langs->trans('PayedByThisPayment').''.$langs->trans('RemainderToPay').''; $mc->getInfo($objp->entity); print $mc->label; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index bf790bb9a9d..5fdfe327056 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -128,7 +128,7 @@ $form = new Form($db); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id; -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("PaymentSocialContribution"); $hselected = $h; $h++; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php new file mode 100644 index 00000000000..fd87dd5e447 --- /dev/null +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -0,0 +1,234 @@ + + * Copyright (C) 2005-2020 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/paymentbybanktransfer/index.php + * \ingroup paymentbybanktransfer + * \brief Payment by bank transfer index page + */ + + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array('banks', 'categories', 'withdrawals')); + +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) $socid = $user->socid; +$result = restrictedArea($user, 'paymentbybanktransfer', '', ''); + + +/* + * Actions + */ + + + + +/* + * View + */ + +llxHeader('', $langs->trans("SuppliersStandingOrdersArea")); + +if (prelevement_check_config() < 0) +{ + $langs->load("errors"); + setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors'); +} + +print load_fiche_titre($langs->trans("SuppliersStandingOrdersArea")); + + +print '
'; + + +$thirdpartystatic = new Societe($db); +$invoicestatic = new Facture($db); +$bprev = new BonPrelevement($db); + +print '
'; +print ''; +print ''; + +print ''; +print ''; + +print ''; +print '
'.$langs->trans("Statistics").'
'.$langs->trans("NbOfInvoiceToWithdraw").''; +print ''; +print $bprev->NbFactureAPrelever(); +print ''; +print '
'.$langs->trans("AmountToWithdraw").''; +print price($bprev->SommeAPrelever(), '', '', 1, -1, -1, 'auto'); +print '

'; + + + +/* + * Invoices waiting for withdraw + */ +$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; +$sql .= " pfd.date_demande, pfd.amount,"; +$sql .= " s.nom as name, s.rowid as socid"; +$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; +$sql .= " ".MAIN_DB_PREFIX."societe as s"; +if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= " WHERE s.rowid = f.fk_soc"; +$sql .= " AND f.entity IN (".getEntity('invoice').")"; +$sql .= " AND f.total_ttc > 0"; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} +$sql .= " AND pfd.traite = 0 AND pfd.fk_facture_fourn = f.rowid"; +if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; +if ($socid) $sql .= " AND f.fk_soc = ".$socid; + +$resql = $db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); + $i = 0; + + print '
'; + print ''; + print ''; + print ''; + if ($num) + { + while ($i < $num && $i < 20) + { + $obj = $db->fetch_object($resql); + + $invoicestatic->id = $obj->rowid; + $invoicestatic->ref = $obj->ref; + $invoicestatic->statut = $obj->fk_statut; + $invoicestatic->paye = $obj->paye; + $invoicestatic->type = $obj->type; + $alreadypayed = $invoicestatic->getSommePaiement(); + + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + print ''; + $i++; + } + } + else + { + print ''; + } + print "
'.$langs->trans("SupplierInvoiceWaitingWithdraw").' ('.$num.')
'; + print $invoicestatic->getNomUrl(1, 'withdraw'); + print ''; + $thirdpartystatic->id = $obj->socid; + $thirdpartystatic->name = $obj->name; + print $thirdpartystatic->getNomUrl(1, 'customer'); + print ''; + print price($obj->amount); + print ''; + print dol_print_date($db->jdate($obj->date_demande), 'day'); + print ''; + print $invoicestatic->getLibStatut(3, $alreadypayed); + print '
'.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).'

"; +} +else +{ + dol_print_error($db); +} + + +print '
'; + + +/* + * Withdraw receipts + */ +$limit = 5; +$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; +$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; +$sql .= " ORDER BY datec DESC"; +$sql .= $db->plimit($limit); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + + print"\n\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); + + + print ''; + + print "\n"; + print '\n"; + print '\n"; + print '\n"; + + print "\n"; + $i++; + } + print "
'.$langs->trans("LatestBankTransferReceipts", $limit).''.$langs->trans("Date").''.$langs->trans("Amount").''.$langs->trans("Status").'
"; + $bprev->id = $obj->rowid; + $bprev->ref = $obj->ref; + $bprev->statut = $obj->statut; + print $bprev->getNomUrl(1); + print "'.dol_print_date($db->jdate($obj->datec), "dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3)."

"; + $db->free($result); +} +else +{ + dol_print_error($db); +} + + +print '
'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 4dcd9f33388..cb3205a0e70 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -65,6 +65,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); + /* * Actions */ diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 29bb5c435e3..9169f71a377 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -126,7 +126,7 @@ llxHeader('', $langs->trans("StandingOrder")); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id; -$head[$h][1] = $langs->trans("Card"); +$head[$h][1] = $langs->trans("StandingOrder"); $hselected = $h; $h++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index ce948211c46..a6e5bee1898 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1454,7 +1454,7 @@ else print '
'; print $langs->trans("VCard").''; print ''; - print img_picto($langs->trans("Download"), 'vcard.png').' '; + print img_picto($langs->trans("Download"), 'vcard.png', 'class="paddingrightonly"'); print $langs->trans("Download"); print ''; print '