diff --git a/ChangeLog b/ChangeLog index 7f210c6fab1..0f2ed877a13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,19 +26,19 @@ Dolibarr better: - The old driver of "mysql" has been removed. Dolibarr use the new one (mysqli) by default. - Remove not used function calculate_byte(). Use dol_print_size() instead. - Function pdf_getTotalQty is now deprecated. Not used by Dolibarr core. +- Method commande->deleteline($lineid) has been replaced with commande->deleteline($user, $lineid). - Method expensereport->delete(id, user) has been replaced with ->delete(user) Method warehouse->delete(id) has been replace with ->delete(user) This is to follow good practice to make a fetch on object before deleting it. -- The form to add a product to a draft proposal/order/invoice from the product card is hidden by default. +- The form to add a product to a draft proposal/order/invoice, from the product card, is hidden by default. It was not commonly used and usage generates some problems (cost price for margin calculation not entered, vat setting). Set constant PRODUCT_ADD_FORM_ADD_TO to retrieve it. -- The javascript "datatables" library was used to be provided into Dolibarr sources, but it was not used by application. +- The javascript "datatables" library was previously provided into Dolibarr sources, but it was not used by application. So there is no reason to maintain its compatibility with other dolibarr components. If an external module need this - library, this external module must embed hte library in his own sources/packages. -- Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE -- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters - no more required were also removed. Use this new one if you ware using one of them. -- Method commande->deleteline($lindeid) has been replaced with commande->deleteline($user, $lineid). + library, this external module must embed the library in his own sources/packages. +- Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE. +- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters, + no more required, were also removed. Use this new one if you were using one of them. diff --git a/build/debian/README.howto b/build/debian/README.howto index cd7cd93c24e..696ea9a2bef 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -295,12 +295,16 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER * Edit orig.tar.gz file to remove - debian - htdocs/includes/ckeditor -- htdocs/includes/jszip +- htdocs/includes/jquery/css +- htdocs/includes/jquery/js +- htdocs/includes/jquery/plugins/flot +- htdocs/includes/jquery/plugins/multiselect - htdocs/includes/jquery/plugins/datatables +- htdocs/includes/jszip - htdocs/includes/mike42 - htdocs/includes/phpexcel or htdocs/includes/phpoffice -- htdocs/includes/swiftmailer - htdocs/includes/restler/framework/Luracast/Restler/explorer +- htdocs/includes/swiftmailer - htdocs/includes/tcpdf or htdocs/includes/tecnickcom And rename file into dolibarr-x.y.z+dfsgw.tgz diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index c47a87a8033..0eac0c761c7 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/.gitignore b/htdocs/.gitignore index 608ef55d106..1650ea7e5ae 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -22,3 +22,4 @@ /cabinetmed* /webmail* /conf/conf.php +/subtotal/ diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 95ba62de0c5..cb3255f981d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -256,10 +256,8 @@ if ($resql) { print ''; print ' '; print ''; - - print ''; - print ' '; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print ''; print ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index a66217ebbee..6854c8a45ff 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -138,7 +138,7 @@ foreach ( $list_account as $key ) { $label = $langs->trans($key); print '' . $label . ''; // Value - print ''; + print ''; // Do not force align=right, or it align also the content of the select box print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); print ''; print ''; diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 720f3a4f012..99b491688cb 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -40,6 +40,22 @@ $langs->load("accountancy"); if (! $user->admin) accessforbidden(); +$limit = GETPOST("limit")?GETPOST("limit","int"):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + + + + +/* + * View + */ + llxHeader('', $langs->trans("ImportAccount")); $to_import = GETPOST("mesCasesCochees"); @@ -90,15 +106,7 @@ if ($_POST["action"] == 'import') { print '
' . $langs->trans("EndProcessing") . '
'; } -/* - * list accounting account from product - * - */ -$page = GETPOST("page"); -if ($page < 0) - $page = 0; -$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; -$offset = $limit * $page; +// list accounting account from product $sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting "; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p "; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 4eb95d298c5..8f023432727 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -50,8 +50,6 @@ $action = GETPOST('action', 'alpha'); // Parameters ACCOUNTING_* and others $list = array ( - //'ACCOUNTING_LIMIT_LIST_VENTILATION', Useless, we can change value dynamically, so we use default global setup - 'ACCOUNTING_MANAGE_ZERO', 'ACCOUNTING_LENGTH_GACCOUNT', 'ACCOUNTING_LENGTH_AACCOUNT' , 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc @@ -85,13 +83,11 @@ if ($action == 'update') { $error ++; } - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); } - foreach ( $list as $constname ) { + foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -259,41 +255,37 @@ if (! empty($user->admin)) print ''; } print ''; + + $var = ! $var; + print ""; + print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; } // Param a user $user->rights->accountancy->chartofaccount can access -foreach ( $list as $key ) { +foreach ($list as $key) +{ $var = ! $var; - if ($key != 'ACCOUNTING_MANAGE_ZERO') - { - print ''; - // Param - $label = $langs->trans($key); - print ''.$label.''; - // Value - print ''; - print ''; - print ''; - print ''; - } - if ($key == 'ACCOUNTING_MANAGE_ZERO') - { - $var = ! $var; - print ""; - print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - } + print ''; + // Param + $label = $langs->trans($key); + print ''.$label.''; + // Value + print ''; + print ''; + print ''; + print ''; } @@ -302,10 +294,6 @@ print ''; - - - - dol_fiche_end(); print '
'; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 495fb2a1304..1cb37e92baa 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -40,6 +40,7 @@ $langs->load("companies"); $langs->load("compta"); $langs->load("main"); $langs->load("accountancy"); +$langs->load("products"); // Security check if (empty($conf->accounting->enabled)) { @@ -61,6 +62,10 @@ $changeaccount_sell = GETPOST('changeaccount_sell', 'array'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); +$search_current_account = GETPOST('search_current_account', 'alpha'); +$search_current_account_valid = GETPOST('search_current_account_valid', 'alpha'); +if ($search_current_account_valid == '') $search_current_account_valid='withoutvalidaccount'; + $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); $btn_changeaccount = GETPOST('changeaccount'); $btn_changetype = GETPOST('changetype'); @@ -85,12 +90,21 @@ $arrayfields=array(); * Actions */ +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_ref = ''; $search_label = ''; $search_desc = ''; + $search_current_account = ''; + $search_current_account_valid = '-1'; } // Sales or Purchase mode ? @@ -189,23 +203,38 @@ $aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? llxHeader('', $langs->trans("ProductsBinding")); -$pcgver = $conf->global->CHARTOFACCOUNTS; +$pcgverid = $conf->global->CHARTOFACCOUNTS; +$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); +if (empty($pcgvercode)) $pcgvercode=$pcgverid; -$sql = "SELECT p.rowid, p.ref, p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type"; -$sql .= " FROM " . MAIN_DB_PREFIX . "product as p"; -$sql .= " WHERE ("; -if ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { - $sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; - $sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; -} else { - $sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL "; - $sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; +$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type,"; +$sql.= " aa.rowid as aaid"; +$sql.= " FROM " . MAIN_DB_PREFIX . "product as p"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON"; +if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + $sql.=" p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'"; } -$sql .= ")"; -if (! empty($conf->multicompany->enabled)) { - $sql.= ' AND p.entity IN ('.getEntity('product', 1).')'; +else +{ + $sql.=" p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'"; +} +$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; +if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + if (strlen(trim($search_current_account))) { + $sql .= natural_search("p.accountancy_code_buy",$search_current_account); + } +} else { + if (strlen(trim($search_current_account))) { + $sql .= natural_search("p.accountancy_code_sell",$search_current_account); + } +} +if ($search_current_account_valid == 'withoutvalidaccount') +{ + $sql .= " AND aa.account_number IS NULL"; +} +if ($search_current_account_valid == 'withvalidaccount') +{ + $sql .= " AND aa.account_number IS NOT NULL"; } // Add search filter like if (strlen(trim($search_ref))) { @@ -218,6 +247,7 @@ if (strlen(trim($search_desc))) { $sql .= natural_search("p.description",$search_desc); } $sql .= $db->order($sortfield, $sortorder); + $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -236,9 +266,11 @@ if ($result) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($search_ref > 0) $param.="&search_desc=".urlencode($search_ref); - if ($search_label > 0) $param.="&search_desc=".urlencode($search_label); - if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); + if ($search_ref > 0) $param.="&search_desc=".urlencode($search_ref); + if ($search_label > 0) $param.="&search_desc=".urlencode($search_label); + if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); + if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account); + if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid); print '
'; if ($optioncss != '') print ''; @@ -260,11 +292,10 @@ if ($result) print '' . $langs->trans('Options') . '' . $langs->trans('Description') . ''; print "\n"; print ' ' . $langs->trans('OptionModeProductSell') . ''; - print '' . nl2br($langs->trans('OptionModeProductSellDesc')); + print ''.$langs->trans('OptionModeProductSellDesc'); print "\n"; print ' ' . $langs->trans('OptionModeProductBuy') . ''; - print '' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "\n"; - + print ''.$langs->trans('OptionModeProductBuyDesc')."\n"; print "\n"; print '
'; @@ -277,7 +308,7 @@ if ($result) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - $texte=$langs->trans("ListOfProductsWithoutAccountingAccount"); + $texte=$langs->trans("ListOfProductsServices"); print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); print ''; @@ -285,37 +316,54 @@ if ($result) print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); - /* - if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { - print_liste_field_titre($langs->trans("Accountancy_code_buy")); - } else { - print_liste_field_titre($langs->trans("Accountancy_code_sell")); - } - */ - print_liste_field_titre($langs->trans("AccountAccounting")); - //print_liste_field_titre($langs->trans("Modify") . '
/ ', '', '', '', '', 'align="center"'); + print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder); + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + $fieldtosortaccount="p.accountancy_code_buy"; + } + else $fieldtosortaccount="p.accountancy_code_sell"; + print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount")); print_liste_field_titre('', '', '', '', '', 'align="center"'); print ''; print ''; - print ''; - print ''; - print ''; - if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; + print ''; + print ''; + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; + // On sell + print ''; + // On buy + print ''; + // Current account + print ''; + print ''; print ''; print ''; - $var = true; + $product_static = new Product($db); + $var = true; + $i=0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var = ! $var; - - $compta_prodsell = $obj->accountancy_code_sell; + + // Ref produit as link + $product_static->ref = $obj->ref; + $product_static->id = $obj->rowid; + $product_static->type = $obj->product_type; + $product_static->label = $obj->label; + $product_static->description = $obj->description; + $product_static->status = $obj->tosell; + $product_static->status_buy = $obj->tobuy; if ($obj->product_type == 0) { $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); @@ -325,8 +373,6 @@ if ($result) $compta_prodsell_id = $aarowid_servsell; } - $compta_prodbuy = $obj->accountancy_code_buy; - if ($obj->product_type == 0) { $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy_id = $aarowid_prodbuy; @@ -335,30 +381,15 @@ if ($result) $compta_prodbuy_id = $aarowid_servbuy; } - $product_static = new Product($db); - - print ''; - - print ""; - + $var = ! $var; print ''; - // Ref produit as link - $product_static->ref = $obj->ref; - $product_static->id = $obj->rowid; - $product_static->type = $obj->type; - $product_static->label = $obj->label; - $product_static->description = $obj->description; - print ''; print ''; - + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) { // TODO ADJUST DESCRIPTION SIZE @@ -368,24 +399,43 @@ if ($result) print ''; } - // Accounting account buy + print ''; + + print ''; + + // Current accounting account + print ''; - // TODO: replace by select - // print ''; - // TODO: we shoul set a user defined value to adjust user square / wide screen size - // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print length_accountg($obj->accountancy_code_buy); + if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + } + else + { + print length_accountg($obj->accountancy_code_sell); + if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + } + print ''; + + // Dedicated account + $defaultvalue=''; + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + // Accounting account buy print ''; } else { // Accounting account sell - // print ''; - // TODO: replace by select - // TODO: we shoul set a user defined value to adjust user square / wide screen size - // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; print ''; } @@ -397,7 +447,34 @@ if ($result) } print '
 '; + print ''; + $listofvals=array('withoutvalidaccount'=>$langs->trans("WithoutValidAccount"), 'withvalidaccount'=>$langs->trans("WithValidAccount")); + print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1); + print ' '; $searchpitco=$form->showFilterAndCheckAddButtons(1, 'checkforselect', 1); print $searchpitco; print '
'; - if ($product_static->id) - print $product_static->getNomUrl(1); - else - print '- '; + print $product_static->getNomUrl(1); print ''.$obj->label.'' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''.$product_static->getLibStatut(3, 0).''.$product_static->getLibStatut(3, 1).''; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { - // print '' . $obj->accountancy_code_buy . '' . $compta_prodbuy . ''; - print $form->select_account($compta_prodbuy_id, 'codeventil_' . $product_static->id, 1); + //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code + if (empty($defaultvalue)) $defaultvalue=$compta_prodbuy; + $codesell=length_accountg($obj->accountancy_code_buy); + if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid + print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1); print '' . $obj->accountancy_code_sell . ''; - print $form->select_account($compta_prodsell_id, 'codeventil_' . $product_static->id, 1); + //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code + if (empty($defaultvalue)) $defaultvalue=$compta_prodsell; + $codesell=length_accountg($obj->accountancy_code_sell); + //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); + if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid + print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1); print '
'; - print '
'; + // Example : Adding jquery code + print ''; + + + print '
'; print '
'; diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index ac72df44e21..fab9e81031d 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -65,7 +65,7 @@ class FormVentilation extends Form /** * Return list of accounts with label by chart of accounts * - * @param string $selectid Preselected chart of accounts + * @param string $selectid Preselected id or code of accounting accounts (depends on $select_in) * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param array $event Event options @@ -99,26 +99,28 @@ class FormVentilation extends Form $out = ajax_combobox($htmlname, $event); + // TODO Add $options in cache so next call will not execute the request + $selected = 0; $options = array(); - $selected = null; - - while ($obj = $this->db->fetch_object($resql)) { + while ($obj = $this->db->fetch_object($resql)) + { $label = length_accountg($obj->account_number) . ' - ' . $obj->label; $label = dol_trunc($label, $trunclength); $select_value_in = $obj->rowid; $select_value_out = $obj->rowid; + // Try to guess if we have found default value if ($select_in == 1) { $select_value_in = $obj->account_number; } if ($select_out == 1) { $select_value_out = $obj->account_number; } - // Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number // Because same account_number can be share between different accounting_system and do have the same meaning - if (($selectid != '') && $selectid == $select_value_in) { + if ($selectid != '' && $selectid == $select_value_in) { + //var_dump("Found ".$selectid." ".$select_value_in); $selected = $select_value_out; } @@ -127,6 +129,7 @@ class FormVentilation extends Form $out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1); $this->db->free($resql); + return $out; } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index d33fc82f3bc..b18923a1e1d 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -83,7 +83,7 @@ $formventilation = new FormVentilation($db); */ // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { $search_ref = ''; $search_invoice = ''; @@ -254,6 +254,7 @@ if ($result) { print ''."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "fd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -263,21 +264,20 @@ if ($result) { print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "fd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', '', '', '', '', 'align="center"'); print "\n"; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; print ''; + print ''; + // Ref Invoice $facture_static->ref = $objp->facnumber; $facture_static->id = $objp->rowid; @@ -319,7 +321,6 @@ if ($result) { print ''; print ''; print ''; - print ''; print ''; print ""; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 7c718c54bfb..84d5e3ffdee 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -158,9 +158,10 @@ if ($action == 'ventil' && ! empty($btn_ventil)) { llxHeader('', $langs->trans("Ventilation")); // Customer Invoice lines -$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,"; +$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,"; +$sql .= " l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,"; -$sql .= " aa.rowid as aarowid"; +$sql .= " aa.rowid as aarowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; @@ -237,6 +238,7 @@ if ($result) { print '
'; $searchpitco=$form->showFilterAndCheckAddButtons(1); print $searchpitco; @@ -293,6 +293,8 @@ if ($result) { print '
' . $objp->rowid . '' . $objp->country .'' . $objp->tva_intra . '' . $objp->rowid . '
'."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -245,19 +247,18 @@ if ($result) { print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"'); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', '', '', '', '', 'align="center"'); print ''; // We add search filter print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; + // Line id + print ''; + // Ref Invoice $facture_static->ref = $objp->facnumber; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; print ''; + // Ref Product $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -327,9 +330,9 @@ if ($result) { print ''; - print ''; + print ''; $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; - print ''; + print ''; print ''; - // Accounting account suggested + // Suggested accounting account print ''; @@ -358,9 +359,6 @@ if ($result) { print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1); print ''; - // Line id - print ''; - print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 9720aba485d..14a3d69a4ea 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -230,24 +230,25 @@ if ($result) { print '
%%'; @@ -278,42 +279,44 @@ if ($result) { $objp->code_sell_l = ''; $objp->code_sell_p = ''; $objp->aarowid_suggest = ''; - $code_sell_p_l_differ = ''; $code_sell_p_notset = ''; $objp->aarowid_suggest = $objp->aarowid; - if (! empty($objp->code_sell)) { - $objp->code_sell_p = $objp->code_sell; - } else { - $code_sell_p_notset = 'color:red'; - if ($objp->type == 1) { - $objp->code_sell_p = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - } elseif ($objp->type == 0) { - $objp->code_sell_p = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - } - } if ($objp->type_l == 1) { - $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); if ($objp->aarowid == '') { $objp->aarowid_suggest = $aarowid_s; } } elseif ($objp->type_l == 0) { - $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); if ($objp->aarowid == '') { $objp->aarowid_suggest = $aarowid_p; } } - if ($objp->code_sell_l != $objp->code_sell_p) - $code_sell_p_l_differ = 'color:red'; + if ($objp->code_sell_l == -1) $objp->code_sell_l=''; + if (! empty($objp->code_sell)) { + $objp->code_sell_p = $objp->code_sell; // Code on product + } else { + $code_sell_p_notset = 'color:orange'; + } + if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) $code_sell_p_notset = 'color:red'; + + // $objp->code_sell_p is now code of product/service + // $objp->code_sell_l is now default code of product/service + print '
' . $objp->rowid . '' . $facture_static->getNomUrl(1) . '' . dol_trunc($objp->product_label, 24) . '' . dol_trunc($objp->product_label, 24) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . ''; print price($objp->total_ht); @@ -342,15 +345,13 @@ if ($result) { print price($objp->tva_tx_line); print ''; - if ($objp->code_sell_l == $objp->code_sell_p) { // Test if there is a difference between code by default and code on product - if ($objp->code_sell_l > 0) print $objp->code_sell_l; - else print $langs->trans("Unknown"); - } else { - print $langs->trans("Default") . ' = ' . ($objp->code_sell_l > 0 ? $objp->code_sell_l : $langs->trans("Unknown")); - print '
'; - print $langs->trans("Product") . ' = ' . ($objp->code_sell_p > 0 ? $objp->code_sell_p : $langs->trans("Unknown")); + print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("Unknown")); + if ($objp->product_id > 0) + { + print '
'; + print (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")) . ' = ' . (empty($objp->code_sell_p) ? $langs->trans("Unknown") : length_accountg($objp->code_sell_p)); } print '
' . $objp->rowid . ''; print 'aarowid ? "checked" : "") . '/>'; print '
'."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("TypeFees"), $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre(''); print_liste_field_titre('', '', '', '', '', 'align="center"'); print "\n"; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; print ''; + print ''; + // Ref Invoice $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; @@ -281,8 +284,6 @@ if ($result) { print ''; - print ''; - print ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 943105a00fa..b9e929cab04 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -233,6 +233,7 @@ if ($result) { print '
'; $searchpicto=$form->showFilterAndCheckAddButtons(1); @@ -265,6 +266,8 @@ if ($result) { print '
' . $objp->rowid . '' . $codeCompta . '' . $objp->rowid . ''; print img_edit(); print '
'."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("TypeFees"), $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); @@ -240,19 +241,18 @@ if ($result) { print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"'); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', '', '', '', '', 'align="center"'); print "\n"; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; print ''; + // Line id + print ''; + // Ref Expense report $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; @@ -306,9 +309,6 @@ if ($result) { print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1); print ''; - // Line id - print ''; - // Colonne choix ligne a ventiler print ''; print ''; // Title print ''; print ''; if (! $filteremail) print ''; @@ -145,7 +145,7 @@ if ($result) $email=new Mailing($db); - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6b47d5205b6..1fe8f76efaa 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -777,7 +777,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } } @@ -1808,7 +1808,7 @@ if ($action == 'create') // Remise dispo de type non avoir $filter = 'fk_facture_source IS NULL'; print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filter); + $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filter, 0, '', 1); } } if ($absolute_creditnote) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index aa5a865dbf2..04c1af11e1d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -37,7 +37,7 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->propale->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->supplier_proposal->lire) accessforbidden(); -$object_statut=GETPOST('propal_statut'); +$object_status=GETPOST('object_status'); $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); @@ -58,6 +58,7 @@ $langs->load('orders'); $langs->load('companies'); $langs->load('other'); $langs->load('suppliers'); +$langs->load('supplier_proposal'); /* @@ -91,7 +92,7 @@ dol_mkdir($dir); $stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode); -if ($object_statut != '' && $object_statut >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_statut.')'; +if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')'; // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); @@ -265,7 +266,7 @@ print '
'; print '
'; // Status print ''; // Year print ' > - - - - - - - - + + + + + + + + + 1) +{ + ?> + + + + + + + + + + diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 313fef16e2c..9495895beda 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -730,7 +730,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } else @@ -2019,7 +2019,7 @@ if ($action == 'create' && $user->rights->commande->creer) } else { // Remise dispo de type remise fixe (not credit note) print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount); + $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount, 0, '', 1); } } if ($absolute_creditnote) { diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index f000e4ce201..c9931ac6f2a 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -371,7 +371,7 @@ class Orders extends DolibarrApi } $request_data = (object) $request_data; $updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid); - if ($updateRes == 1) { + if ($updateRes > 0) { return $this->get($id); } return false; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 14c2b88214e..87a95062323 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1014,11 +1014,11 @@ if ($resql) { print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 1f0f763bfd1..55b82d1063c 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -28,6 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); @@ -37,6 +38,8 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->commande->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->fournisseur->commande->lire) accessforbidden(); +$object_status=GETPOST('object_status'); + $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); // Security check @@ -63,6 +66,7 @@ $langs->load('suppliers'); */ $form=new Form($db); +$formorder=new FormOrder($db); if ($mode == 'customer') { @@ -82,9 +86,19 @@ print load_fiche_titre($title,'','title_commercial.png'); dol_mkdir($dir); $stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0)); +if ($mode == 'customer') +{ + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; +} +if ($mode == 'supplier') +{ + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; +} + // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); + //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) @@ -261,6 +275,24 @@ print '
'; // User print '
'; // Year print ' > - - - - - - - - + + + + + + + + + 1) +{ + ?> + + + + + + + + + + \ No newline at end of file diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 9acf83db399..f82177e0b21 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $langs->load("banks"); $langs->load("categories"); +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); + $id=GETPOST('account')?GETPOST('account','alpha'):GETPOST('id'); $ref=GETPOST('ref'); @@ -53,6 +56,12 @@ else $year_end=$year_start+2; } + + +/* + * View + */ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("IOMonthlyReporting"); $helpurl = ""; llxHeader('',$title,$helpurl); @@ -276,10 +285,6 @@ if ($result < 0) } else { - // Definition de $width et $height - $width = 480; - $height = 300; - // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -374,8 +379,8 @@ else $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); $px1->SetTitle($title); - $px1->SetWidth($width); - $px1->SetHeight($height); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); $px1->SetType(array('line','line','line')); $px1->SetShading(3); $px1->setBgColor('onglet'); @@ -461,8 +466,8 @@ else $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); $px2->SetTitle($title); - $px2->SetWidth($width); - $px2->SetHeight($height); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); $px2->SetType(array('line','line','line')); $px2->SetShading(3); $px2->setBgColor('onglet'); diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index bb56c494854..20a5a2e8b85 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -108,14 +108,13 @@ if (! $sortfield) $sortfield='b.datev'; $mode_balance_ok=false; //if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected -if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid') && ($id > 0 || ! empty($ref))) +if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) { $sortfield = 'b.datev, b.dateo, b.rowid'; - $mode_balance_ok = true; + if ($id > 0 || ! empty($ref) || $account > 0) $mode_balance_ok = true; } if (strtolower($sortorder) == 'desc') $mode_balance_ok = false; - $object = new Account($db); if ($id > 0 || ! empty($ref)) { @@ -527,6 +526,9 @@ if ($page >= $nbtotalofpages) if ($page < 0) $page = 0; } +// If not account defined $mode_balance_ok=false +if (empty($account)) $mode_balance_ok=false; +// If a search is done $mode_balance_ok=false if (! empty($search_ref)) $mode_balance_ok=false; if (! empty($req_nb)) $mode_balance_ok=false; if (! empty($type)) $mode_balance_ok=false; @@ -879,6 +881,12 @@ if ($resql) // If we are in a situation where we need/can show balance, we calculate the start of balance if (! $balancecalculated && ! empty($arrayfields['balance']['checked']) && $mode_balance_ok) { + if (! $account) + { + dol_print_error('', 'account is not defined but $mode_balance_ok is true'); + exit; + } + //Loop on each record $sign = 1; $i = 0; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index a608a71bf7d..43efcc93d57 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry @@ -840,11 +840,11 @@ else // Label print ''; - print ''; + print ''; // Type print ''; - print ''; @@ -852,7 +852,7 @@ else print ''; - print ''; - print ''; // Country @@ -874,13 +874,13 @@ else $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''; - print ''; // State - print ''; - print ''; // Tags-Categories @@ -931,7 +931,7 @@ else print ''; @@ -1020,22 +1020,22 @@ else // IBAN print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '"; print ''; - print ''; + print ''; print ''; print '"; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index f786158ccbe..c25bc073d1f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -236,7 +236,7 @@ class Account extends CommonObject $this->status = array( self::STATUS_OPEN => $langs->trans("StatusAccountOpened"), - self::STATUS_CLOSED => $langs->trans("StatusAccountOpened") + self::STATUS_CLOSED => $langs->trans("StatusAccountClosed") ); } @@ -1244,7 +1244,7 @@ class Account extends CommonObject } if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' '); - $result.=$link.$this->label.$linkend; + $result.=$link.$this->ref.$linkend; return $result; } diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 7d3073d7129..56735d15fce 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -39,6 +39,9 @@ $show_files=GETPOST('show_files','int'); $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); +$search_ref=GETPOST('search_ref','alpha'); +$search_label=GETPOST('search_label','alpha'); +$search_number=GETPOST('search_number','alpha'); $statut=GETPOST('statut')?GETPOST('statut', 'alpha'):'opened'; // 'all' or ''='opened' $optioncss = GETPOST('optioncss','alpha'); @@ -115,7 +118,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $statut = 'all'; - + $search_ref=''; + $search_label=''; + $search_number=''; + $search_statut=''; } @@ -124,6 +130,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP * View */ +$form=new Form($db); + $title=$langs->trans('BankAccounts'); // Load array of financial accounts (opened by default) @@ -139,9 +147,11 @@ $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)"; $sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; -if ($statut == 'opened') $sql.= " AND clos = 0"; -if ($statut == 'closed') $sql.= " AND clos = 1"; - +if ($statut == 'opened') $sql.= " AND clos = 0"; +if ($statut == 'closed') $sql.= " AND clos = 1"; +if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref); +if ($search_label != '') $sql.=natural_search('b.label', $search_label); +if ($search_number != '') $sql.=natural_search('b.number', $search_number); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -202,6 +212,9 @@ $arrayofselected=is_array($toselect)?$toselect:array(); $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($search_ref != '') $param.='&search_ref='.$search_ref; +if ($search_label != '') $param.='&search_label='.$search_label; +if ($search_number != '') $param.='&search_number='.$search_number; if ($statut != '') $param.='&statut='.$statut; if ($show_files) $param.='&show_files=' .$show_files; if ($optioncss != '') $param.='&optioncss='.$optioncss; @@ -266,8 +279,8 @@ print '
'; $searchpicto=$form->showFilterAndCheckAddButtons(1); print $searchpicto; @@ -272,6 +272,9 @@ if ($result) { print '
' . $objp->rowid . '' . $objp->rowid . ''; print 'aarowid ? "checked" : "") . '/>'; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 94af5c82dba..09422eb5b93 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -82,7 +82,7 @@ $formventilation = new FormVentilation($db); */ // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { $search_ref = ''; $search_invoice = ''; @@ -237,6 +237,7 @@ if ($result) { print ''."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -244,20 +245,20 @@ if ($result) { print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre(''); print_liste_field_titre('', '', '', '', '', 'align="center"'); print "\n"; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; print ''; + print ''; + // Ref Invoice $facturefournisseur_static->ref = $objp->facnumber; $facturefournisseur_static->id = $objp->facid; @@ -297,7 +300,6 @@ if ($result) { print ''; print ''; print ''; - print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index bd0dac49096..e103c35810a 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -164,9 +164,10 @@ if ($action == 'ventil' && ! empty($btn_ventil)) { llxHeader('', $langs->trans("SuppliersVentilation")); // Supplier Invoice Lines -$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, "; -$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod"; -$sql .= " , aa.rowid as aarowid"; +$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef,"; +$sql .= " l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, "; +$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,"; +$sql .= " aa.rowid as aarowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; @@ -243,6 +244,7 @@ if ($result) { print '
'; $searchpitco=$form->showFilterAndCheckAddButtons(1); print $searchpitco; @@ -275,6 +276,8 @@ if ($result) { print '
' . $objp->rowid . '' . price($objp->total_ht) . '' . price($objp->tva_tx) . '' . $codeCompta . '' . $objp->rowid . ''; print img_edit(); print '
'."\n"; print ''; + print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -251,20 +253,19 @@ if ($result) { print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"'); - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', '', '', '', '', 'align="center"'); print "\n"; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; print ''; + // Line id + print ''; + // Ref Invoice $facturefourn_static->ref = $objp->ref; $facturefourn_static->id = $objp->facid; @@ -335,11 +333,11 @@ if ($result) { print ' '; print ''; - print ''; + print ''; // TODO: we should set a user defined value to adjust user square / wide screen size $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; - print ''; + print ''; print ''; - // Colonne choix du compte + // Suggested accounting account print ''; - // Line id - print ''; - // Colonne choix ligne a ventiler print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 9ea048c27fd..e6bb4a2914f 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2008-2016 Laurent Destailleur * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Charlie 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 @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; if (!$user->admin) accessforbidden(); @@ -370,6 +370,7 @@ print ''."\n"; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { $var=!$var; + print ''; print ''."\n"; print ''."\n"; print ''."\n"; @@ -384,7 +385,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS @@ -393,7 +394,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_VIEW diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index bf4a09c0ada..859534d53fd 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -87,14 +87,14 @@ else if ($action == 'disable_delivery') $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/"; $form=new Form($db); -llxHeader("",""); +llxHeader("",$langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("ModuleSetup"), 0, 'sending'); +dol_fiche_head($head, 'general', $langs->trans("Sendings"), 0, 'sending'); /* * Formulaire parametres divers diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 42741b49c7a..34a561121b2 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -215,7 +215,7 @@ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $form=new Form($db); -llxHeader("",""); +llxHeader("",$langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 5d0cf665d7c..5c288b9e78a 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -497,7 +497,7 @@ $var=false; print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; print $langs->trans("IfSetToYesDontForgetPermission"); print '\n"; diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 365cfaa449d..ff7a16d1893 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -88,7 +88,7 @@ else { $arraytest=array( 'character_set_database'=>array('var'=>'dolibarr_main_db_character_set','valifempty'=>'utf8'), - 'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_general_ci') + 'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_unicode_ci') ); } diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index eeea93a2fea..2fe87a02e63 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -40,20 +40,22 @@ if (! $user->admin) $form=new Form($db); -llxHeader(); +$title=$langs->trans("InfoDolibarr"); -print load_fiche_titre($langs->trans("InfoDolibarr"),'','title_setup'); +llxHeader('', $title); + +print load_fiche_titre($title,'','title_setup'); // Version $var=true; print '
'; $searchpitco=$form->showFilterAndCheckAddButtons(1); print $searchpitco; @@ -286,39 +287,36 @@ if ($result) { $objp->code_buy_l = ''; $objp->code_buy_p = ''; $objp->aarowid_suggest = ''; - $code_buy_p_l_differ = ''; $code_buy_p_notset = ''; - $objp->aarowid_suggest = $objp->aarowid; - if (! empty($objp->code_buy)) { - $objp->code_buy_p = $objp->code_buy; - } else { - $code_buy_p_notset = 'color:red'; - if ($objp->type == 1) { - $objp->code_buy_p = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - } - - elseif ($objp->type == 0) { - $objp->code_buy_p = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - } - } if ($objp->type_l == 1) { - $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : ''); if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s; } elseif ($objp->type_l == 0) { - $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : ''); if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p; } - - if ($objp->code_buy_l != $objp->code_buy_p) - $code_buy_p_l_differ = 'color:red'; + if ($objp->code_buy_l == -1) $objp->code_buy_l=''; + if (! empty($objp->code_buy)) { + $objp->code_buy_p = $objp->code_buy; + } else { + $code_buy_p_notset = 'color:orange'; + } + if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) $code_buy_p_notset = 'color:red'; + + // $objp->code_buy_p is now code of product/service + // $objp->code_buy_l is now default code of product/service + print '
' . $objp->rowid . '' . dol_trunc($objp->product_label, 24) . '' . dol_trunc($objp->product_label, 24) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . ''; print price($objp->price); @@ -354,24 +352,19 @@ if ($result) { // Accounting account suggested print ''; - if ($objp->code_buy_l == $objp->code_buy_p) { // Test if there is a difference between code by default and code on product - if ($objp->code_buy_l > 0) print $objp->code_buy_l; - else print $langs->trans("Unknown"); - } else { - print $langs->trans("Default") . ' = ' . ($objp->code_buy_l > 0 ? $objp->code_buy_l : $langs->trans("Unknown")); + print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("Unknown")); + if ($objp->product_id > 0) + { print '
'; - print $langs->trans("Product") . ' = ' . ($objp->code_buy_p > 0 ? $objp->code_buy_p : $langs->trans("Unknown")); + print (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")) . ' = ' . (empty($objp->code_buy_p) ? $langs->trans("Unknown") : length_accountg($objp->code_buy_p)); } print '
'; print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1); print '' . $objp->rowid . ''; print 'aarowid ? "checked" : "") . '/>'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 191b23bea32..79aa64fb1ab 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1146,12 +1146,12 @@ class Adherent extends CommonObject $this->birth = $this->db->jdate($obj->birthday); $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; + $this->note_public = $obj->note_public; $this->morphy = $obj->morphy; $this->typeid = $obj->fk_adherent_type; - $this->type = $obj->type; - $this->need_subscription = ($obj->subscription=='yes'?1:0); + $this->type = $obj->type; + $this->need_subscription = $obj->subscription; $this->user_id = $obj->user_id; $this->user_login = $obj->user_login; @@ -1682,6 +1682,17 @@ class Adherent extends CommonObject if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); } if ($mode == 5) + { + if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut >= 1) + { + if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActiveShort").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); + elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLateShort").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); + else return ''.$langs->trans("MemberStatusPaidShort").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); + } + if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + } + if ($mode == 6) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c98ad4abf31..0727002aa59 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -809,7 +809,7 @@ while ($i < $num && $i < $conf->liste_limit) if (! empty($arrayfields['d.statut']['checked'])) { print ''; - print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,2); + print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5); print '
'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").' 
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; -$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1); +$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1); print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").' '."\n"; -$formactions->form_select_status_action('agenda',$conf->global->AGENDA_DEFAULT_FILTER_STATUS,1,'AGENDA_DEFAULT_FILTER_STATUS',1,2); +$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2); print '
'; - print ''; + print ''; print ''; print ''; print "
'; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''; - print ''; + print ''; - print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'.$langs->trans("VersionLastUpgrade").''.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'.$langs->trans("VersionLastUpgrade").''.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'.$langs->trans("VersionProgram").''.DOL_VERSION; +print '
'.$langs->trans("VersionProgram").''.DOL_VERSION; // If current version differs from last upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) { @@ -72,30 +74,30 @@ print '
'; // Session $var=true; print ''; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print '\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; $var=!$var; -print ''."\n"; $var=!$var; -print ''; - print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("CurrentSessionTimeOut").''.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); +print '
'.$langs->trans("CurrentSessionTimeOut").''.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); print ''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print "
'.$langs->trans("CurrentTheme").''.$conf->theme.'
'.$langs->trans("CurrentTheme").''.$conf->theme.'
'.$langs->trans("CurrentMenuHandler").''; +print '
'.$langs->trans("CurrentMenuHandler").''; print $conf->standard_menu; print '
'.$langs->trans("Screen").''; +print '
'.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
'.$langs->trans("Session").''; +print '
'.$langs->trans("Session").''; $i=0; foreach($_SESSION as $key => $val) { @@ -116,7 +118,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S $var=true; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''."\n"; @@ -124,7 +126,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S foreach($shmoparray as $key => $val) { $var=!$var; - print ''; + print ''; print ''; print ''; print ''."\n"; @@ -138,41 +140,41 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S // Localisation $var=true; print '
'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("NbOfEntries").''.$langs->trans("Address").'
'.$key.'
'.$key.''.count($val).''.dol_getshmopaddress($key).'
'; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; // Thousands $var=!$var; $thousand=$langs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method if ($thousand == 'None') $thousand=''; -print ''."\n"; +print ''."\n"; // Decimals $var=!$var; $dec=$langs->transnoentitiesnoconv("SeparatorDecimal"); -print ''."\n"; +print ''."\n"; // Show results of functions to see if everything works $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print "\n"; +print "\n"; if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) { $var=!$var; - print ""; + print ""; print "\n"; } $var=!$var; -print ''."\n"; +print ''."\n"; // Timezone $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'
'."\n"; $txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."
\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php $txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ); //$txt.=$langs->trans("YouCanEditPHPTZ"); // deprecated $var=!$var; -print ''."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; -print ''; +print ''; $var=!$var; -print ''; +print ''; $var=!$var; -print ''; +print ''; // Database timezone if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') { $var=!$var; - print ''."\n"; print ''."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; $filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 -print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php $var=!$var; $tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows if (empty($tmp)) $tmp='utf-8'; // By default for other if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_FILESYSTEM_ENCODING; -print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'
'.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'
'.$langs->trans("CurrentValueSeparatorDecimal").''.$dec.'
'.$langs->trans("CurrentValueSeparatorDecimal").''.$dec.'
  => price2num(1233.56+1)'.price2num(1233.56+1,'2').'
  => price2num(1233.56+1)'.price2num(1233.56+1,'2').'
  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."
  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."
  => price2num('."'1 234.56')".price2num("1 234.56",'2')."
  => price2num('."'1 234.56')".price2num("1 234.56",'2')."
  => price(1234.56)'.price(1234.56).'
  => price(1234.56)'.price(1234.56).'
'.$langs->trans("CurrentTimeZone").''; // Timezone server PHP +print '
'.$langs->trans("CurrentTimeZone").''; // Timezone server PHP $a=getServerTimeZoneInt('now'); $b=getServerTimeZoneInt('winter'); $c=getServerTimeZoneInt('summer'); @@ -185,18 +187,18 @@ $val.='       '.$langs->trans("DaylingSavingTime").': '.($dayligh print $form->textwithtooltip($val,$txt,2,1,img_info('')); print '
  => '.$langs->trans("CurrentHour").''.dol_print_date(dol_now(),'dayhour','tzserver').'
  => '.$langs->trans("CurrentHour").''.dol_print_date(dol_now(),'dayhour','tzserver').'
  => dol_print_date(0,"dayhourtext")'.dol_print_date(0,"dayhourtext").'
  => dol_print_date(0,"dayhourtext")'.dol_print_date(0,"dayhourtext").'
  => dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')
  => dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')
  => dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')
  => dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')
'.$langs->trans("MySQLTimeZone").' (database)'; // Timezone server base + print '
'.$langs->trans("MySQLTimeZone").' (database)'; // Timezone server base $sql="SHOW VARIABLES where variable_name = 'system_time_zone'"; $resql = $db->query($sql); if ($resql) @@ -209,7 +211,7 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') // Client $var=!$var; $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst']; -print '
'.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; +print '
'.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; print '       '.$_SESSION['dol_tz_string']; print '       '.$langs->trans("DaylingSavingTime").': '; if ($_SESSION['dol_dst']>0) print yn(1); @@ -218,18 +220,18 @@ if (! empty($_SESSION['dol_dst_first'])) print '     ('.dol_print_date print '
  => '.$langs->trans("ClientHour").''.dol_print_date(dol_now(),'dayhour','tzuser').'
  => '.$langs->trans("ClientHour").''.dol_print_date(dol_now(),'dayhour','tzuser').'
'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)'.$filesystemencoding.'
'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)'.$filesystemencoding.'
  => '.$langs->trans("File encoding").''.$tmp.'
  => '.$langs->trans("File encoding").''.$tmp.'
'; print '
'; @@ -291,7 +293,7 @@ $configfileparameters=array( $var=true; print ''; print ''; -print ''; print ''; @@ -357,9 +359,9 @@ print '
'; // Parameters in database print '
'.$langs->trans("Parameters").' '; +print ''.$langs->trans("Parameters").' '; print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')'; print ''.$langs->trans("Parameter").'
'; print ''; -print ''; +print ''; print ''; -if (empty($conf->multicompany->enabled) || !$user->entity) print ''; // If superadmin or multicompany disabled +if (empty($conf->multicompany->enabled) || !$user->entity) print ''; // If superadmin or multicompany disabled print "\n"; $sql = "SELECT"; @@ -394,9 +396,9 @@ if ($resql) $var=!$var; print ''; - print ''."\n"; - print ''."\n"; - if (empty($conf->multicompany->enabled) || !$user->entity) print ''."\n"; // If superadmin or multicompany disabled + print ''."\n"; + print ''."\n"; + if (empty($conf->multicompany->enabled) || !$user->entity) print ''."\n"; // If superadmin or multicompany disabled print "\n"; $i++; diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 45f2be3e4da..e3081d10400 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -23,8 +23,7 @@ use Luracast\Restler\Defaults; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; /** - * Class for API - * + * Class for API REST v1 */ class DolibarrApi { @@ -55,6 +54,8 @@ class DolibarrApi $this->db = $db; $production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true ); $this->r = new Restler($production_mode); + + $this->r->setAPIVersion(1); } /** @@ -97,6 +98,7 @@ class DolibarrApi unset($object->statuts); unset($object->statuts_short); unset($object->statuts_logo); + unset($object->statuts_long); // Remove the $oldcopy property because it is not supported by the JSON // encoder. The following error is generated when trying to serialize diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 80cfb5485df..7fe3e6437ac 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -106,7 +106,10 @@ foreach ($modulesdir as $dir) elseif ($module == 'facture') { $moduledirforclass = 'compta/facture'; } - + elseif ($module == 'project') { + $moduledirforclass = 'projet'; + } + // Defined if module is enabled $enabled=true; if (empty($conf->$moduleforperm->enabled)) $enabled=false; @@ -135,7 +138,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found deprecated API classname=".$classname." into ".$dir); + dol_syslog("Found deprecated API by index.php classname=".$classname." into ".$dir); $api->r->addAPIClass($classname, '/'); } } @@ -145,7 +148,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found API classname=".$classname." into ".$dir); + dol_syslog("Found API by index.php classname=".$classname." into ".$dir); $listofapis[] = $classname; } } @@ -161,13 +164,14 @@ foreach ($modulesdir as $dir) // shows the classes in the order they are added and it's a mess if they are // not sorted. sort($listofapis); +//var_dump($listofapis); foreach ($listofapis as $classname) { $api->r->addAPIClass($classname); } // TODO If not found, redirect to explorer - +//var_dump($api); // Call API (we suppose we found it) $api->r->handle(); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index d38270b8827..c917925e87e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -795,7 +795,7 @@ if ($action == 'create') } print ''; } - if(!empty($origin) && !empty($originid)) + if (!empty($origin) && !empty($originid)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 419b32cdea4..f8d2913028c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1113,15 +1113,26 @@ class ActionComm extends CommonObject if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + $label = $this->label; + if (empty($label)) $label=$this->libelle; // For backward compatibility + $result=''; + // Set label of typ + $labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL'); + } + + $tooltip = '' . $langs->trans('ShowAction'.$objp->code) . ''; if (! empty($this->ref)) $tooltip .= '
' . $langs->trans('Ref') . ': ' . $this->ref; - $label = $this->label; - if (empty($label)) $label=$this->libelle; // For backward compatibility if (! empty($label)) $tooltip .= '
' . $langs->trans('Title') . ': ' . $label; + if (! empty($labeltype)) + $tooltip .= '
' . $langs->trans('Type') . ': ' . $labeltype; if (! empty($this->location)) $tooltip .= '
' . $langs->trans('Location') . ': ' . $this->location; @@ -1129,11 +1140,11 @@ class ActionComm extends CommonObject if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) $linkclose = ' style="background-color:#'.$this->type_color.'"'; - if (empty($notooltip) && $user->rights->propal->lire) + if (empty($notooltip)) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label=$langs->trans("ShowSupplierProposal"); + $label=$langs->trans("ShowAction"); $linkclose.=' alt="'.dol_escape_htmltag($tooltip, 1).'"'; } $linkclose.=' title="'.dol_escape_htmltag($tooltip, 1).'"'; @@ -1166,13 +1177,13 @@ class ActionComm extends CommonObject if ($withpicto == 2) { $libelle=$label; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->transnoentities("Action".$this->type_code); + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$labeltype; $libelleshort=''; } else { $libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:'')); - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=$labeltype; if ($maxlength < 0) $libelleshort=$this->ref; else $libelleshort=dol_trunc($libelle,$maxlength); } diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 237a1043ac6..c03763c13a6 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -105,9 +105,9 @@ class CActionComm * @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param string $idorcode 'id' or 'code' * @param string $excludetype Type to exclude ('system' or 'systemauto') - * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type + * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual" * @param string $morefilter Add more SQL filter - * @return mixed Array of all event types if OK, <0 if KO + * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. */ function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='') { @@ -123,7 +123,7 @@ class CActionComm if ($active != '') $sql.=" AND active=".$active; if (! empty($excludetype)) $sql.=" AND type <> '".$excludetype."'"; if ($morefilter) $sql.=" AND ".$morefilter; - $sql.= " ORDER BY module, position"; + $sql.= " ORDER BY module, position, type"; dol_syslog(get_class($this)."::liste_array", LOG_DEBUG); $resql=$this->db->query($sql); @@ -140,7 +140,7 @@ class CActionComm $qualified=1; // $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto - if ($qualified && $onlyautoornot && preg_match('/^system/',$obj->type) && ! preg_match('/^AC_OTH/',$obj->code)) $qualified=0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) + if ($qualified && $onlyautoornot > 0 && preg_match('/^system/',$obj->type) && ! preg_match('/^AC_OTH/',$obj->code)) $qualified=0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) if ($qualified && $obj->module) { @@ -155,12 +155,19 @@ class CActionComm if ($qualified) { $code=$obj->code; - if ($onlyautoornot && $code == 'AC_OTH') $code='AC_MANUAL'; - if ($onlyautoornot && $code == 'AC_OTH_AUTO') $code='AC_AUTO'; + if ($onlyautoornot > 0 && $code == 'AC_OTH') $code='AC_MANUAL'; + if ($onlyautoornot > 0 && $code == 'AC_OTH_AUTO') $code='AC_AUTO'; $transcode=$langs->trans("Action".$code); - $repid[$obj->id] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->label)); - $repcode[$obj->code] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->label)); - if ($onlyautoornot && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')'; + $label = ($transcode!="Action".$code?$transcode:$langs->trans($obj->label)); + if ($onlyautoornot == -1 && ! empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! preg_match('/auto/i', $code)) + { + $label='  '.$label; + $repid[-99]=$langs->trans("ActionAC_MANUAL"); + $repcode['AC_NON_AUTO']=$langs->trans("ActionAC_MANUAL"); + } + $repid[$obj->id] = $label; + $repcode[$obj->code] = $label; + if ($onlyautoornot > 0 && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')'; } $i++; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f70b8d171a1..f63bbd7ab79 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -450,7 +450,29 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; +// Condition on actioncode +if (! empty($actioncode)) +{ + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + if ($actioncode == 'AC_OTH') $sql.= " AND ca.type != 'systemauto'"; + if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND ca.type = 'systemauto'"; + } + } + else + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; + } + } +} if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; @@ -970,7 +992,15 @@ if (empty($action) || $action == 'show_month') // View by month $i=0; while ($i < 7) { - echo ' \n"; + print ' \n"; $i++; } echo " \n"; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index ec4fba12980..d583d56074e 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -194,7 +194,29 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= " WHERE c.id = a.fk_action"; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND c.code IN ('".$db->escape($actioncode)."')"; +// Condition on actioncode +if (! empty($actioncode)) +{ + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'"; + else + { + if ($actioncode == 'AC_OTH') $sql.= " AND c.type != 'systemauto'"; + if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND c.type = 'systemauto'"; + } + } + else + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'"; + else + { + $sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')"; + } + } +} if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; @@ -402,6 +424,7 @@ if ($resql) { if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto); else { + if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group').' '; if ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' '; if ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' '; if ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' '; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index ae11f06cedd..2dd5d78d9b9 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -365,7 +365,29 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; +// Condition on actioncode +if (! empty($actioncode)) +{ + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + if ($actioncode == 'AC_OTH') $sql.= " AND ca.type != 'systemauto'"; + if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND ca.type = 'systemauto'"; + } + } + else + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; + } + } +} if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index cd5f7d10fa7..5651bca338b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -96,7 +96,6 @@ else $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); - $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); if ($dateselect > 0) { @@ -373,7 +372,29 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; +// Condition on actioncode +if (! empty($actioncode)) +{ + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + if ($actioncode == 'AC_OTH') $sql.= " AND ca.type != 'systemauto'"; + if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND ca.type = 'systemauto'"; + } + } + else + { + if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'"; + elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; + else + { + $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; + } + } +} if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 92dc2726030..d7fd92f365b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -333,7 +333,7 @@ if (empty($reshook)) dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; + $sql.=" SET statut=-1, error_text='".$db->escape($mail->error)."', date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { @@ -668,7 +668,15 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewMailing")); + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + + // Print mail form + print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); @@ -693,21 +701,16 @@ if ($action == 'create') print '
'; - print ''; - print '
'.$langs->trans("Parameters").' '.$langs->trans("Database").''.$langs->trans("Parameters").' '.$langs->trans("Database").''.$langs->trans("Value").''.$langs->trans("Entity").''.$langs->trans("Entity").'
'.$obj->name.''.$obj->value.''.$obj->entity.''.$obj->name.''.$obj->value.''.$obj->entity.'
'.$langs->trans("LinkedObject").''.$langs->trans("Day".(($i+(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)) % 7))."'; + $numdayinweek=(($i+(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)) % 7); + if (! empty($conf->dol_optimize_smallscreen)) + { + $labelshort=array(0=>'SundayMin',1=>'MondayMin',2=>'TuesdayMin',3=>'WednesdayMin',4=>'ThursdayMin',5=>'FridayMin',6=>'SaturdayMin'); + print $langs->trans($labelshort[$numdayinweek]); + } + else print $langs->trans("Day".$numdayinweek); + print "
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
'.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; + + print '
'; + + print '
'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%'); $doleditor->Create(); - print '
'; - + print ''; + dol_fiche_end(); print '
'; @@ -788,17 +791,24 @@ else } } - print ''; - $linkback = ''.$langs->trans("BackToList").''; - print ''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
'; + + print '
'.$langs->trans("Ref").'
'; + +/* print ''; print ''; - +*/ // Description - print ''; @@ -813,10 +823,12 @@ else print ''; // Status + /* print ''; - + */ + // Nb of distinct emails print ''; - print ''; - print ''; - - print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; + print '
'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print'
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -987,11 +999,19 @@ else print '
'; } + + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); - + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); + dol_fiche_head(''); - + print ''; // Subject @@ -1019,16 +1039,11 @@ else /*print '';*/ - + + print '
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'; + // Message - print '
'.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; + print '
'; if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') { $readonly=1; @@ -1038,12 +1053,10 @@ else $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); - print '
'; + print ''; dol_fiche_end(); + } else { @@ -1051,19 +1064,28 @@ else * Mailing en mode edition */ - print ''; - $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
'; + + print '
'; + + /* print ''; print ''; - + */ + // Topic - print ''; + print ''; // From - print ''; + print ''; // To print ''; @@ -1100,21 +1122,29 @@ else - print "\n"; + print "
\n"; + print ''."\n"; print ''; print ''; print ''; - + + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); - + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto,0,0,0,0,1).'
'; // Subject - print ''; + print ''; $trackid=''; // TODO To avoid conflicts with 2 mass emailing, we should set a trackid here, even if we use another one into email header. dol_init_file_process($upload_dir, $trackid); @@ -1159,23 +1189,17 @@ else print ''; - + + print '
'.$langs->trans("MailTopic").'
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'; + // Message - print '
'.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; + print '
'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,120); $doleditor->Create(); - print '
'; dol_fiche_end(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index cc5b16f1935..3767ba17add 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -38,16 +38,17 @@ $langs->load("mails"); if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden(); +// Load variable for pagination $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="email"; +if (! $sortorder) $sortorder="ASC"; $id=GETPOST('id','int'); $rowid=GETPOST('rowid','int'); @@ -178,17 +179,24 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email'); - - print ''; - $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + + print '
'; + + print '
'; +/* print ''; print ''; - - print ''; +*/ + print ''; print ''; @@ -197,10 +205,10 @@ if ($object->fetch($id) >= 0) print ''; // Status - print ''; - +*/ // Nb of distinct emails print ''; // EMail print ''; // Name print ''; // Firstname print ''; // Other print ''; - //Search Icon + // Action column print ''; print ''; @@ -480,9 +488,10 @@ if ($object->fetch($id) >= 0) if ($num) { - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); + $var=!$var; print ""; @@ -537,7 +546,7 @@ if ($object->fetch($id) >= 0) { print ''; print ''; } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 6a7ae2cefbe..dc39c2e9399 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -33,7 +33,8 @@ class Mailing extends CommonObject { public $element='mailing'; public $table_element='mailing'; - + public $picto='email'; + var $titre; var $sujet; var $body; @@ -577,12 +578,14 @@ class Mailing extends CommonObject /** * Renvoi le libelle d'un statut donne + * TODO Add class mailin_target.class.php * * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param strin $desc Desc error * @return string Label */ - static public function libStatutDest($statut,$mode=0) + static public function libStatutDest($statut,$mode=0,$desc='') { global $langs; $langs->load('mails'); @@ -597,28 +600,28 @@ class Mailing extends CommonObject } if ($mode == 2) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 3) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 4) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 5) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index bf7c4624c1e..ba8c2481411 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -56,10 +56,10 @@ print ''; print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("Status").''.$object->getLibStatut(4); +/* print '
'.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print '
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -363,7 +371,7 @@ if ($object->fetch($id) >= 0) } // List of selected targets - $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type"; + $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type, mc.error_text"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.fk_mailing=".$object->id; if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'"; @@ -441,15 +449,15 @@ if ($object->fetch($id) >= 0) print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -468,10 +476,10 @@ if ($object->fetch($id) >= 0) print ''; print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1); print ''; - print ''; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print '
'.$obj->date_envoi.''; - print $object::libStatutDest($obj->statut,2); + print $object::libStatutDest($obj->statut,2,$obj->error_text); print '
'; print ''; print ''; +print $langs->trans("Ref").':'; print ''; print ''; +print $langs->trans("Other").':'; print "
'.$langs->trans("SearchAMailing").'
'; -print $langs->trans("Ref").':
'; -print $langs->trans("Other").':

\n"; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 77245f74766..5280fcfad59 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -43,24 +43,33 @@ llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:M $form = new Form($db); -$mil = new Mailing($db); +$object = new Mailing($db); -if ($mil->fetch($_REQUEST["id"]) >= 0) +if ($object->fetch($_REQUEST["id"]) >= 0) { - $head = emailing_prepare_head($mil); + $head = emailing_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email'); + $linkback = ''.$langs->trans("BackToList").''; - print '
'; - $mil->user_creation=$mil->user_creat; - $mil->date_creation=$mil->date_creat; - $mil->user_validation=$mil->user_valid; - $mil->date_validation=$mil->date_valid; - dol_print_object_info($mil); - print '
'; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '

'; + + //print '
'; + $object->user_creation=$object->user_creat; + $object->date_creation=$object->date_creat; + $object->user_validation=$object->user_valid; + $object->date_validation=$object->date_valid; + dol_print_object_info($object, 0); + //print '
'; + - print ''; + dol_fiche_end(); } llxFooter(); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 7542782f6e7..bd94dd83f5c 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -125,11 +125,11 @@ if ($result) print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print '  
'.$langs->trans("Status").''; - $formpropal->selectProposalStatus($object_statut,0,1,1,$mode); + $formpropal->selectProposalStatus(($object_status!=''?$object_status:-1),0,0,1,$mode,'object_status'); print '
'.$langs->trans("Year").''; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index cc84e87ddba..dd325da7297 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -35,27 +35,44 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("propal"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> -
trans("Proposal"); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?>rights->propale->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
trans("Proposal"); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?>rights->propale->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
trans("Total"); ?>
'; $liststatus=array( - '0'=>$langs->trans("StatusOrderDraftShort"), - '1'=>$langs->trans("StatusOrderValidated"), - '2'=>$langs->trans("StatusOrderSentShort"), - '3'=>$langs->trans("StatusOrderDelivered"), - '-1'=>$langs->trans("StatusOrderCanceledShort") + Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"), + Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), + Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"), + Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), + Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") ); print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4); print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + // Status + print '
'.$langs->trans("Status").''; + if ($mode == 'customer') + { + $liststatus=array( + Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraft"), + Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), + Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSent"), + Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), + Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled") + ); + print $form->selectarray('object_status', $liststatus, GETPOST('object_status'), -4); + } + if ($mode == 'supplier') + { + $formorder->selectSupplierOrderStatus((strstr($object_status, ',')?-1:$object_status), 0, 'object_status'); + } + print '
'.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 98e931db9f8..38efbc91ca2 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -24,41 +24,60 @@ load("orders"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> -
trans("CustomerOrder"); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?>rights->commande->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?>getLibStatut(3); ?> - element != 'shipping') { - ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - -
trans("CustomerOrder"); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?>rights->commande->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?>getLibStatut(3); ?> + element != 'shipping') { + ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + +
trans("Total"); ?>
'.$langs->trans("Label").'label).'">
label).'">
'.$langs->trans("AccountType").''; + print ''; $formbank->selectTypeOfBankAccount((isset($_POST["type"])?$_POST["type"]:$object->type),"type"); print '
'.$langs->trans("Currency"); print ''; print ''; + print ''; $selectedcode=$object->currency_code; if (! $selectedcode) $selectedcode=$conf->currency; print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); @@ -862,8 +862,8 @@ else // Status print '
'.$langs->trans("Status").''; - print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos)); + print ''; + print $form->selectarray("clos", $object->status, (isset($_POST["clos"])?$_POST["clos"]:$object->clos)); print '
'.$langs->trans("Country").''; + print ''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; + print '
'.$langs->trans('State').''; if ($selectedcode) { print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$object->state_id,$selectedcode,'account_state_id'); @@ -909,7 +909,7 @@ else // Web print '
'.$langs->trans("Web").'url).'">'; + print 'url).'">'; print '
'; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70); + $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,'95%'); $doleditor->Create(); print '
'.$langs->trans($ibankey).'
'.$langs->trans($bickey).'
'.$langs->trans("BankAccountDomiciliation").''; - print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; - print "
'; if (! empty($arrayfields['b.ref']['checked'])) print_liste_field_titre($arrayfields['b.ref']['label'],$_SERVER["PHP_SELF"],'b.ref','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.label']['checked'])) print_liste_field_titre($arrayfields['b.label']['label'],$_SERVER["PHP_SELF"],'b.label','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'],$_SERVER["PHP_SELF"],'b.clos','',$param,'align="center"',$sortfield,$sortorder); @@ -300,19 +313,19 @@ if (! empty($arrayfields['b.ref']['checked'])) print ''; print ''; } -// Account type -if (! empty($arrayfields['accountype']['checked'])) -{ - print ''; -} -// Ref +// Label if (! empty($arrayfields['b.label']['checked'])) { print ''; } +// Account type +if (! empty($arrayfields['accountype']['checked'])) +{ + print ''; +} // Number if (! empty($arrayfields['b.number']['checked'])) { @@ -403,10 +416,10 @@ foreach ($accounts as $key=>$type) print ''; print ''; + print ''; print ''; - print ''; print ''; print ''; - print ''; + // Status + print ''; + // print ''; @@ -442,7 +457,7 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; //} } -if (! $found) print ''; +if (! $found) print ''; // Total foreach ($total as $key=>$solde) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2f4f887f652..2bf69038e78 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1433,7 +1433,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; + $tva_tx = $prodcustprice->lines[0]->tva_tx; } } } @@ -2933,17 +2933,17 @@ else if ($id > 0 || ! empty($ref)) } } $morehtmlref.=''; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', $morehtmlright); - + print '
'; print '
'; print '
'; - + print '
'; - print ''; print ''; print ''; + print '
'.$acc->getNomUrl(1).''.$acc->label.''; print $acc->type_lib[$acc->type]; print ''.$acc->bank.''.$acc->number.''; if ($acc->rappro) @@ -421,7 +434,9 @@ foreach ($accounts as $key=>$type) } else print $langs->trans("FeatureDisabled"); print ''.$acc->getLibStatut(2).''.$acc->getLibStatut(5).''; print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; - + // Type print '
' . $langs->trans('Type') . ''; print $object->getLibType(); @@ -3303,7 +3303,7 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
'; - + print ''; print '
'; print '
'; @@ -3328,15 +3328,15 @@ else if ($id > 0 || ! empty($ref)) print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; } - + // Amount - print '' . $langs->trans('AmountHT') . ''; + print '' . $langs->trans('AmountHT') . ''; print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ''; - + // Vat print '' . $langs->trans('AmountVAT') . '' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . ''; print ''; - + // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1 { @@ -3348,7 +3348,7 @@ else if ($id > 0 || ! empty($ref)) print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; print '' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . ''; } - + // Revenue stamp if ($selleruserevenustamp) // Test company use revenue stamp { @@ -3375,14 +3375,14 @@ else if ($id > 0 || ! empty($ref)) } print ''; } - + // Total with tax print '' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . ''; - + print ''; - + // List of payments - + $sign = 1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1; $nbrows = 8; @@ -3491,9 +3491,9 @@ else if ($id > 0 || ! empty($ref)) if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) print ''; } - + print ''; - + // List of payments already done print ''; print ''; @@ -3505,9 +3505,9 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $var = true; - + // Payments already done (from payment on this invoice) $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; $sql .= ' c.code as payment_code, c.libelle as payment_label,'; @@ -3518,12 +3518,12 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; $sql .= ' ORDER BY p.datep, p.tms'; - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; - + // if ($object->type != 2) // { if ($num > 0) { @@ -3563,7 +3563,7 @@ else if ($id > 0 || ! empty($ref)) } else { dol_print_error($db); } - + if ($object->type != Facture::TYPE_CREDIT_NOTE) { // Total already paid print ''; - + $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - + // Loop on each credit note or deposit amount applied $creditnoteamount = 0; $depositamount = 0; @@ -3611,7 +3611,7 @@ else if ($id > 0 || ! empty($ref)) } else { dol_print_error($db); } - + // Paye partiellement 'escompte' if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { print ''; @@ -3667,10 +3667,10 @@ else if ($id > 0 || ! empty($ref)) print ''; - + // Billed print ''; - + // Remainder to pay back print ''; print ''; print ''; - + // Sold credit note // print ''; // print ''; } - + print '
' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '' . $langs->trans('Amount') . ' 
'; @@ -3572,10 +3572,10 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('AlreadyPaid'); print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' 
'; @@ -3647,7 +3647,7 @@ else if ($id > 0 || ! empty($ref)) $resteapayeraffiche = 0; $cssforamountpaymentcomplete = ''; } - + // Billed print '
' . $langs->trans("Billed") . ' :' . price($object->total_ttc) . ' 
'; print $langs->trans('AlreadyPaidBack'); print ' :' . price($sign * $totalpaye) . ' 
' . $langs->trans("Billed") . ' :' . price($sign * $object->total_ttc) . ' 
'; if ($resteapayeraffiche <= 0) @@ -3680,27 +3680,26 @@ else if ($id > 0 || ! empty($ref)) print ' :' . price($sign * $resteapayeraffiche) . ' 
'.$langs->trans('TotalTTC').' :'.price($sign * // $object->total_ttc).' 
'; - + // Margin Infos if (! empty($conf->margin->enabled)) { $formmargin->displayMarginInfos($object); } - print '
'; print '
'; print ''; - + print '

'; - + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $blocname = 'contacts'; $title = $langs->trans('ContactsAddresses'); @@ -3811,8 +3810,7 @@ else if ($id > 0 || ! empty($ref)) print '
'; $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { // Editer une facture deja validee, sans paiement effectue et pas exporte en compta if ($object->statut == 1) diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 8300545cb22..258b2434f60 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -188,7 +188,7 @@ if ($id > 0 || ! empty($ref)) // Remise dispo de type remise fixe (not credit note) $filter='fk_facture_source IS NULL'; print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' - '.$addabsolutediscount); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' - '.$addabsolutediscount, 1); } } else @@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref)) // Remise dispo de type avoir $filter='fk_facture_source IS NOT NULL'; if (! $absolute_discount) print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filter, $resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filter, $resteapayer, '', 1); } } if (! $absolute_discount && ! $absolute_creditnote) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 33da64e3221..c1381be0ea5 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -40,6 +40,7 @@ if (! empty($conf->projet->enabled)) { $langs->load('bills'); $langs->load('compta'); +$langs->load('admin'); // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); @@ -504,7 +505,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; + $tva_tx = $prodcustprice->lines[0]->tva_tx; } } } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 87a27166ae8..879d5abfee4 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -263,7 +263,7 @@ if ($object->id > 0) // Remise dispo de type non avoir $filter='fk_facture_source IS NULL'; print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$object->thirdparty->id,$absolute_discount,$filter,$resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$object->thirdparty->id,$absolute_discount,$filter,$resteapayer,'',1); } } if ($absolute_creditnote > 0) @@ -283,7 +283,7 @@ if ($object->id > 0) // Remise dispo de type avoir $filter='fk_facture_source IS NOT NULL'; if (! $absolute_discount) print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id_for_payment',$object->thirdparty->id,$absolute_creditnote,$filter,$resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id_for_payment',$object->thirdparty->id,$absolute_creditnote,$filter,$resteapayer,'',1); } } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 9ca0c2f7718..5c5aa8489be 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -36,6 +36,8 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->facture->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->fournisseur->facture->lire) accessforbidden(); +$object_status=GETPOST('object_status'); + $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); // Security check @@ -80,7 +82,14 @@ print load_fiche_titre($title, $mesg, 'title_accountancy.png'); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); - +if ($mode == 'customer') +{ + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; +} +if ($mode == 'supplier') +{ + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; +} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) @@ -246,6 +255,19 @@ print '
'; print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print ''; + // Status + print ''.$langs->trans("Status").''; + if ($mode == 'customer') + { + $liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); + print $form->selectarray('object_status', $liststatus, $object_status, 1); + } + if ($mode == 'supplier') + { + $liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid")); + print $form->selectarray('object_status', $liststatus, $object_status, 1); + } + print ''; // Year print ''.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 56e8645b8c7..16aa54e229d 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -24,32 +24,51 @@ load("bills"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("CustomerInvoice"); ?> - getNomUrl(1); ?> - ref_client; ?> - date,'day'); ?> - rights->facture->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - + + trans("CustomerInvoice"); ?> + getNomUrl(1); ?> + ref_client; ?> + date,'day'); ?> + rights->facture->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + \ No newline at end of file diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index ce94e4a1212..781f5609915 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -24,16 +24,21 @@ load("bills"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> > trans("RepeatableInvoice"); ?> diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 1dd1c46299a..0d0552b41ad 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -117,7 +117,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; @@ -577,7 +577,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -663,7 +663,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $i = 0; print '
'.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("DateDue").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").'
'; print ""; - print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 63d4b9930ed..b39e5c47f7f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -534,7 +534,7 @@ if ($modecompta == 'CREANCES-DETTES') print ''; print ''; -if ($mysoc->tva_assuj == 'franchise') // Non assujeti +if ($mysoc->tva_assuj == 'franchise') // Non assujetti { // Total print ''; @@ -572,7 +572,7 @@ if (! empty($conf->salaries->enabled)) $sql.= " WHERE p.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; $sql.= " ORDER BY u.firstname"; @@ -599,7 +599,7 @@ if (! empty($conf->salaries->enabled)) $var = !$var; print ""; - print "\n"; + print "\n"; if ($modecompta == 'CREANCES-DETTES') print ''; print ''; @@ -639,9 +639,8 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='p.date_valid'; - } else { $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -650,12 +649,12 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='pe.datep'; } print ''; - + if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; @@ -709,12 +708,12 @@ if (! empty($conf->expensereport->enabled)) } /* - * Donation + * Donations */ if (! empty($conf->don->enabled)) { - print ''; + print ''; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; @@ -975,7 +974,7 @@ else } -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { print ''; if ($modecompta == 'CREANCES-DETTES') @@ -995,7 +994,7 @@ $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addBalanceLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { // Total print ''; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index fc106de2ad1..6a4f7f836e7 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -40,6 +40,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); $search_ref = GETPOST('search_ref','int'); $search_label = GETPOST('search_label','alpha'); $search_amount = GETPOST('search_amount','alpha'); +$search_status = GETPOST('search_status','int'); $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -52,8 +53,8 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="cs.date_ech"; if (! $sortorder) $sortorder="DESC"; -$year=$_GET["year"]; -$filtre=$_GET["filtre"]; +$year=GETPOST("year",'int'); +$filtre=GETPOST("filtre",'int'); if (empty($_REQUEST['typeid'])) { @@ -75,6 +76,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_ref=""; $search_label=""; $search_amount=""; + $search_status=''; $typeid=""; $year=""; $month=""; @@ -88,7 +90,7 @@ $form = new Form($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static=new ChargeSociales($db); -llxHeader(); +llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid as id, cs.fk_type as type, "; $sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; @@ -99,11 +101,11 @@ $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; - // Search criteria -if ($search_ref) $sql.=" AND cs.rowid=".$search_ref; +if ($search_ref) $sql.=" AND cs.rowid=".$db->escape($search_ref); if ($search_label) $sql.=natural_search("cs.libelle", $search_label); if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1); +if ($search_status != '' && $search_status >= 0) $sql.=" AND cs.paye = ".$db->escape($search_status); if ($year > 0) { $sql .= " AND ("; @@ -118,7 +120,7 @@ if ($filtre) { $sql .= " AND ".$filtre; } if ($typeid) { - $sql .= " AND cs.fk_type=".$typeid; + $sql .= " AND cs.fk_type=".$db->escape($typeid); } $sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; $sql.= $db->order($sortfield,$sortorder); @@ -204,7 +206,10 @@ if ($resql) print ''; print ''; // Status - print ''; + print ''; print ''; print ''; - $numoutput=0; + $nboftypesoutput=0; foreach($object->linkedObjects as $objecttype => $objects) { @@ -5286,23 +5300,28 @@ class Form $dirtpls=array_merge($conf->modules_parts['tpl'],array('/'.$tplpath.'/tpl')); foreach($dirtpls as $reldir) { + if ($nboftypesoutput == ($nbofdifferenttypes - 1)) // No more type to show after + { + global $noMoreLinkedObjectBlockAfter; + $noMoreLinkedObjectBlockAfter=1; + } $res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); if ($res) { - $numoutput++; + $nboftypesoutput++; break; } } } - if (! $numoutput) + if (! $nboftypesoutput) { print ''; } print '
'.$langs->trans("OrdersToBill").' '.$num.''.$langs->trans("OrdersDeliveredToBill").' '.$num.''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").''.price(-$subtotal_ttc).'
 ".$langs->trans("Salaries")." fk_user."\">".$obj->firstname." ".$obj->lastname."".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount).''.price(-$obj->amount).'
'.$langs->trans("ExpenseReport").'
'.$langs->trans("Donation").'
'.$langs->trans("Donations").'
  '; + $liststatus=array('0'=>$langs->trans("Unpaid"), '1'=>$langs->trans("Paid")); + print $form->selectarray('search_status', $liststatus, $search_status, 1); + print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index aab5290a663..83dbd300f60 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -134,7 +134,7 @@ $dolibarr_main_db_type=''; // dolibarr_main_db_character_set -// Database character set used to store data (forced during database creation). +// Database character set used to store data (forced during database creation. value of database is then used). // Default value: depends on database driver // Examples: // dolibarr_main_db_character_set='utf8'; @@ -143,12 +143,12 @@ $dolibarr_main_db_character_set='utf8'; // dolibarr_main_db_collation -// Database character set used to sort data (forced during database creation). +// Database character set used to sort data (forced during database creation. value of database is then used). // Default value: depends on database driver // Examples: -// dolibarr_main_db_collation='utf8_general_ci'; +// dolibarr_main_db_collation='utf8_unicode_ci'; // -$dolibarr_main_db_collation='utf8_general_ci'; +$dolibarr_main_db_collation='utf8_unicode_ci'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4e045ccd449..cd45378ba86 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -123,15 +123,16 @@ class Contact extends CommonObject $sql = "SELECT count(sp.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (sp.fk_soc = s.rowid)"; if (!$user->rights->societe->client->voir && !$user->societe_id) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; + $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= ' '.$clause.' s.entity IN ('.getEntity($this->element, 1).')'; - + $sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')'; + if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id; + $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 86e45ade086..3c29f4e8fca 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -494,7 +494,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } } diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 8e37e392603..836e2fd82f6 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -50,6 +50,7 @@ $search_contract=GETPOST("search_contract"); $search_service=GETPOST("search_service"); $search_status=GETPOST("search_status","alpha"); $statut=GETPOST('statut')?GETPOST('statut'):1; +$search_product_category=GETPOST('search_product_category','int'); $socid=GETPOST('socid','int'); $opouvertureprevuemonth=GETPOST('opouvertureprevuemonth'); @@ -99,6 +100,9 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); +$arrayfields=array(); + + /* * Actions */ @@ -153,8 +157,10 @@ $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."contratdet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; +if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; $sql.= " WHERE c.entity = ".$conf->entity; $sql.= " AND c.rowid = cd.fk_contrat"; +if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; $sql.= " AND c.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == "0") $sql.= " AND cd.statut = 0"; @@ -206,17 +212,67 @@ if ($resql) if ($filter_date2 != '') $param.='&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; if ($filter_datecloture != '') $param.='&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + //if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $title=$langs->trans("ListOfServices"); if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0" if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices"); if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices"); if ($mode == "5") $title=$langs->trans("ListOfClosedServices"); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png'); - - print ''; - print ''; - print ''; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $morefilter = ''; + + // If the user can view categories of products + if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) + { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.='
'; + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; + + + if (! empty($moreforfilter)) + { + print '
'; + print $moreforfilter; + print '
'; + } + + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'."\n"; + print ''; print_liste_field_titre($langs->trans("Contract"),$_SERVER["PHP_SELF"], "c.rowid",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Service"),$_SERVER["PHP_SELF"], "p.description",$param,"","",$sortfield,$sortorder); @@ -308,11 +364,16 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; - print '"; + + // Ref + print ''; @@ -348,7 +409,7 @@ if ($resql) { print ''; @@ -357,7 +418,7 @@ if ($resql) { print ''; } - // Date fin + // End date if (($mode == "" || $mode == -1) || $mode < 5) { print ' > + diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 317b84e0b29..3abd7dd58b5 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -527,7 +527,7 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce); - else $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers); + else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers); if (! $res) { @@ -840,7 +840,7 @@ class CMailFile // Receiver if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2; - if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; + if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ? // Delivery receipt if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index b3b0cc4042b..30ea6639196 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -337,17 +337,17 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); - if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); - return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); + if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); + return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); } else { - if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); - elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); - else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); + if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); + elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); + else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); } } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cdd8b89a1ad..e3e899eceba 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3280,7 +3280,7 @@ abstract class CommonObject { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! - global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove; + global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; // Define usemargins $usemargins=0; @@ -3343,6 +3343,8 @@ abstract class CommonObject // Multicurrency if (!empty($conf->multicurrency->enabled)) print ''; + if ($outputalsopricetotalwithtax) print ''; + print ''; // No width to allow autodim print ''; @@ -4444,12 +4446,12 @@ abstract class CommonObject } if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { - $out .= ''; + $out .= ''; $colspan='0'; } else { - $out .= ''; + $out .= ''; } // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index ef750e70253..90e4970b9d6 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -108,7 +108,7 @@ class DolEditor // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? $modulepart='fckeditor'; - $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file='; + $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9bed1ed9a82..8479bab7563 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -76,14 +76,15 @@ class ExtraFields 'price'=>'ExtrafieldPrice', 'phone'=>'ExtrafieldPhone', 'mail'=>'ExtrafieldMail', + 'url'=>'ExtrafieldUrl', 'select' => 'ExtrafieldSelect', 'sellist' => 'ExtrafieldSelectList', 'radio' => 'ExtrafieldRadio', 'checkbox' => 'ExtrafieldCheckBox', 'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'link' => 'ExtrafieldLink', - 'separate' => 'ExtrafieldSeparator', 'password' => 'ExtrafieldPassword', + 'separate' => 'ExtrafieldSeparator', ); /** @@ -195,6 +196,9 @@ class ExtraFields } elseif($type=='mail') { $typedb='varchar'; $lengthdb='128'; + } elseif($type=='url') { + $typedb='varchar'; + $lengthdb='255'; } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){ $typedb='text'; $lengthdb=''; @@ -425,6 +429,9 @@ class ExtraFields } elseif($type=='mail') { $typedb='varchar'; $lengthdb='128'; + } elseif($type=='url') { + $typedb='varchar'; + $lengthdb='255'; } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) { $typedb='text'; $lengthdb=''; @@ -693,6 +700,10 @@ class ExtraFields //$showsize=10; $showsize = 'minwidth100imp'; } + elseif ($type == 'url') + { + $showsize='minwidth400imp'; + } else { if (round($size) < 12) @@ -738,6 +749,10 @@ class ExtraFields { $out=''; } + elseif (in_array($type, array('mail', 'phone', 'url'))) + { + $out=''; + } elseif ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -754,14 +769,6 @@ class ExtraFields } $out=''; } - elseif ($type == 'mail') - { - $out=''; - } - elseif ($type == 'phone') - { - $out=''; - } elseif ($type == 'price') { $out=' '.$langs->getCurrencySymbol($conf->currency); @@ -1236,11 +1243,15 @@ class ExtraFields } elseif ($type == 'mail') { - $value=dol_print_email($value); + $value=dol_print_email($value,0,0,0,64,1,1); + } + elseif ($type == 'url') + { + $value=dol_print_url($value,'_blank',32,1); } elseif ($type == 'phone') { - $value=dol_print_phone($value); + $value=dol_print_phone($value, '', 0, 0, '', ' ', 1); } elseif ($type == 'price') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 48126c9afed..2b18dab3acd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -181,7 +181,14 @@ class Form else if (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) { $tmp=explode(':',$typeofdata); - $ret.=''; + $cols=$tmp[2]; + $morealt=''; + if (preg_match('/%/',$cols)) + { + $morealt=' style="width: '.$cols.'"'; + $cols=''; + } + $ret.=''; } else if ($typeofdata == 'day' || $typeofdata == 'datepicker') { @@ -211,9 +218,10 @@ class Form if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.='
'; + $contractstatic->id=$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; + + $var=!$var; + + print "
'; print $contractstatic->getNomUrl(1,16); print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); - if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay))) + if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) print ' '.img_picto($langs->trans("Late"),"warning"); else print '    '; print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index aa8d83bb803..9ea21f890fc 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -13,7 +13,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ ?> @@ -22,19 +21,23 @@ load("contracts"); +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $objectlink->fetch_lines(); - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> -
trans("Contract"); ?> getNomUrl(1); ?> '.$langs->trans('TotalHTShortCurrency').''.$langs->trans('TotalTTCShort').'
'; - $ret.=''; - if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
'."\n"; - $ret.=''; + else $ret.='
'; + $ret.=''; + if (preg_match('/ckeditor|textarea/',$typeofdata) && empty($notabletag)) $ret.='
'."\n"; + $ret.=''; if (empty($notabletag)) $ret.='
'."\n"; @@ -734,7 +742,7 @@ class Form } $out.= ''; - $out .= ''; + $out .= ''; if (!empty($page)) { @@ -3910,15 +3918,16 @@ class Form * * @param string $page Page URL where form is shown * @param int $selected Value pre-selected - * @param string $htmlname Nom du formulaire select. Si 'none', non modifiable. Example 'remise_id'. + * @param string $htmlname Name of SELECT component. If 'none', not changeable. Example 'remise_id'. * @param int $socid Third party id * @param float $amount Total amount available * @param string $filter SQL filter on discounts * @param int $maxvalue Max value for lines that can be selected * @param string $more More string to add + * @param int $hidelist 1=Hide list * @return void */ - function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='') + function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0) { global $conf,$langs; if ($htmlname != "none") @@ -3929,25 +3938,30 @@ class Form print '
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice - else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); // If we want deposit to be substracted to payments only and not to total of final invoice + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); } else { - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; - else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; - } - print '
'; - $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles - if ($filter) $newfilter.=' AND ('.$filter.')'; - $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); - if ($nbqualifiedlines > 0) - { - print '   '; + if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); } + if (empty($hidelist)) print ': '; print '
'; + if (empty($hidelist)) + { + print '
'; + $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles + if ($filter) $newfilter.=' AND ('.$filter.')'; + $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); + if ($nbqualifiedlines > 0) + { + print '   '; + } + print '
'; + } if ($more) { print '
'; @@ -4479,7 +4493,7 @@ class Form if ($usecalendar == "eldy") { // Zone de saisie manuelle de la date - $retstring.='trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript $retstring.='>'; @@ -4507,7 +4521,7 @@ class Form { //$retstring.='
'; // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4521,7 +4535,7 @@ class Form $retstring.=""; - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { $retstring.=''; @@ -4539,11 +4553,11 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { - $retstring.=''; + $retstring.=''; for ($year = $syear - 5; $year < $syear + 10 ; $year++) { @@ -4560,7 +4574,7 @@ class Form if ($h) { // Show hour - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($hour = 0; $hour < 24; $hour++) { @@ -4574,7 +4588,7 @@ class Form if ($m) { // Show minutes - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($min = 0; $min < 60 ; $min++) { @@ -5209,7 +5223,7 @@ class Form if (empty($reshook)) { - $num = count($object->linkedObjects); + $nbofdifferenttypes = count($object->linkedObjects); print '
'; print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, ''); @@ -5226,7 +5240,7 @@ class Form print '
'.$langs->trans("None").'
'; - return $num; + return $nbofdifferenttypes; } } @@ -5555,36 +5574,13 @@ class Form //$previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; //$next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; - $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?'<':' ').'':''.(empty($conf->dol_use_jmobile)?'<':' ').''; - $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''.(empty($conf->dol_use_jmobile)?'>':' ').''; + $previous_ref = $object->ref_previous?''.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').''; + $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; - $ret.='
'; - - if ($morehtmlleft) - { - if ($conf->browser->layout == 'phone') $ret.='
'.$morehtmlleft.'
'; - else $ret.='
'.$morehtmlleft.'
'; - } - - $ret.='
'; - - // For thirdparty, contact, user, member, the ref is the id, so we show something else - if ($object->element == 'societe') - { - $ret.=dol_htmlentities($object->name); - } - else if (in_array($object->element, array('contact', 'user', 'member'))) - { - $ret.=dol_htmlentities($object->getFullName($langs)); - } - else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); - if ($morehtmlref) - { - $ret.=' '.$morehtmlref; - } - $ret.='
'; + $ret.='
'; + // Right part of banner if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; if ($previous_ref || $next_ref || $morehtml) @@ -5605,7 +5601,34 @@ class Form $ret.='
'; } if ($morehtmlstatus) $ret.='
'.$morehtmlstatus.'
'; - $ret.='
'; + + // Left part of banner + if ($morehtmlleft) + { + if ($conf->browser->layout == 'phone') $ret.='
'.$morehtmlleft.'
'; // class="center" to have photo in middle + else $ret.='
'.$morehtmlleft.'
'; + } + + //if ($conf->browser->layout == 'phone') $ret.='
'; + $ret.='
'; + + // For thirdparty, contact, user, member, the ref is the id, so we show something else + if ($object->element == 'societe') + { + $ret.=dol_htmlentities($object->name); + } + else if (in_array($object->element, array('contact', 'user', 'member'))) + { + $ret.=dol_htmlentities($object->getFullName($langs)); + } + else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + if ($morehtmlref) + { + $ret.=' '.$morehtmlref; + } + $ret.='
'; + + $ret.='
'; return $ret; } @@ -5779,10 +5802,10 @@ class Form if ($caneditfield) { if ($object->photo) $ret.="
\n"; - $ret.=''; - if ($object->photo) $ret.=''; + $ret.='
'.$langs->trans("Delete").'

'; + if ($object->photo) $ret.=''; $ret.=''; - $ret.=''; + $ret.=''; $ret.='
'.$langs->trans("Delete").'

'.$langs->trans("PhotoFile").'
'; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 503c1fbb739..16b63c16601 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -180,7 +180,10 @@ class FormActions elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter'); else $title=$langs->trans("Actions"); - print load_fiche_titre($title,'',''); + $buttontoaddnewevent = ''; + $buttontoaddnewevent.= $langs->trans("AddEvent"); + $buttontoaddnewevent.= ''; + print load_fiche_titre($title, $buttontoaddnewevent, ''); $page=0; $param=''; $sortfield='a.datep'; @@ -250,13 +253,13 @@ class FormActions * @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too. * @param string $htmlname Name of select field * @param string $excludetype A type to exclude ('systemauto', 'system', '') - * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type + * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual" * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value * @param int $multiselect 1=Allow multiselect of action type * @param int $nooutput 1=No output * @return string */ - function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) + function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) { global $langs,$user,$form,$conf; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ef9141dbc94..ac800d480fc 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -358,9 +358,10 @@ class FormCompany * * @param string $selected Title preselected * @param string $htmlname Name of HTML select combo field + * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - function select_civility($selected='',$htmlname='civility_id') + function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') { global $conf,$langs,$user; $langs->load("dict"); @@ -374,7 +375,7 @@ class FormCompany $resql=$this->db->query($sql); if ($resql) { - $out.= ''; $out.= ''; $num = $this->db->num_rows($resql); $i = 0; @@ -724,9 +725,10 @@ class FormCompany * @param int $fieldsize Field size * @param int $disableautocomplete 1 To disable ajax autocomplete features (browser autocomplete may still occurs) * @param string $moreattrib Add more attribute on HTML input field + * @param string $morecss More css * @return string */ - function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='') + function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') { global $conf; @@ -740,7 +742,7 @@ class FormCompany $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n"; $moreattrib.=' autocomplete="off"'; } - $out.= ''."\n"; + $out.= ''."\n"; return $out; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 109d2c5d23d..d79eaae65f0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -62,7 +62,7 @@ class FormFile * @param int $addcancel 1=Add 'Cancel' button * @param int $sectionid If upload must be done inside a particular ECM section * @param int $perm Value of permission to allow upload - * @param int $size Length of input file area + * @param int $size Length of input file area. Deprecated. * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. @@ -106,7 +106,7 @@ class FormFile if (! empty($options)) $out .= ''.$options.''; - $out .= ''; + $out .= ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu @@ -121,10 +121,10 @@ class FormFile { $out .= ''; } - $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; - $out .= ' '; + $out .= ' '; $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; @@ -183,11 +183,11 @@ class FormFile $out .= '
'; $out .= '
'; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= '
'; $out .= '
'; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= '
'; @@ -776,6 +776,8 @@ class FormFile /** * Show a Document icon with link(s) + * You may want to call this into a div like this: + * print '
'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'
'; * * @param string $modulepart propal, facture, facture_fourn, ... * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. @@ -1449,6 +1451,7 @@ class FormFile else { print ''; + print img_picto('', 'object_globe').' '; print ''; print $link->label; print ''; diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 57dd6336a43..2cfeaadd368 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -50,9 +50,10 @@ class FormPropal * @param int $excludedraft 0=All status, 1=Exclude draft status * @param int $showempty 1=Add empty line * @param string $mode 'customer', 'supplier' + * @param string $htmlname Name of select field * @return void */ - function selectProposalStatus($selected='',$short=0, $excludedraft=0, $showempty=1, $mode='customer') + function selectProposalStatus($selected='',$short=0, $excludedraft=0, $showempty=1, $mode='customer',$htmlname='propal_statut') { global $langs; @@ -63,7 +64,13 @@ class FormPropal $prefix='SupplierProposalStatus'; $langs->load("supplier_proposal"); - $listofstatus=array(0=>array('code'=>'PR_DRAFT'), 1=>array('code'=>'PR_OPEN'), 2=>array('code'=>'PR_SIGNED'), 3=>array('code'=>'PR_NOTSIGNED'), 4=>array('code'=>'PR_CLOSED')); + $listofstatus=array( + 0=>array('id'=>0, 'code'=>'PR_DRAFT'), + 1=>array('id'=>1, 'code'=>'PR_OPEN'), + 2=>array('id'=>2, 'code'=>'PR_SIGNED'), + 3=>array('id'=>3, 'code'=>'PR_NOTSIGNED'), + 4=>array('id'=>4, 'code'=>'PR_CLOSED') + ); } else { @@ -93,7 +100,7 @@ class FormPropal } } - print ''; if ($showempty) print ''; foreach($listofstatus as $key => $obj) @@ -115,15 +122,16 @@ class FormPropal print ''; $i++; diff --git a/htdocs/core/class/html.formsupplier_proposal.class.php b/htdocs/core/class/html.formsupplier_proposal.class.php deleted file mode 100644 index ed8781731a0..00000000000 --- a/htdocs/core/class/html.formsupplier_proposal.class.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * 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/core/class/html.formpropal.class.php - * \ingroup core - * \brief File of class with all html predefined components - */ - - -/** - * Class to manage generation of HTML components for proposal management - */ -class FormSupplierProposal -{ - var $db; - var $error; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - } - - /** - * Return combo list of differents status of a proposal - * Values are id of table c_propalst - * - * @param string $selected Preselected value - * @param int $short Use short labels - * @return void - */ - function selectSupplierProposalStatus($selected='',$short=0) - { - global $langs; - - $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; - $sql .= " WHERE active = 1"; - - dol_syslog(get_class($this)."::selectSupplierProposalStatus", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - print ''; - } - else - { - dol_print_error($this->db); - } - } - -} - diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 39a45ad783b..c8ce225e0c2 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -489,14 +489,20 @@ class SMTPs // and send it out "single file" foreach ( $this->get_RCPT_list() as $_address ) { - /* + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + + /* * TODO - * After each 'RCPT TO:' is sent, we need to make sure it was kosher, - * if not, the whole message will fail - * If any email address fails, we will need to RESET the connection, - * mark the last address as "bad" and start the address loop over again. - * If any address fails, the entire message fails. - */ + * After each 'RCPT TO:' is sent, we need to make sure it was kosher, + * if not, the whole message will fail + * If any email address fails, we will need to RESET the connection, + * mark the last address as "bad" and start the address loop over again. + * If any address fails, the entire message fails. + */ $this->socket_send_str('RCPT TO: <' . $_address . '>', '250'); } @@ -1025,7 +1031,7 @@ class SMTPs /** * Returns an array of addresses for a specific type; TO, CC or BCC * - * @param string $_which Which collection of adresses to return + * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @return string|false Array of emaill address */ function get_email_list($_which = null) @@ -1174,9 +1180,17 @@ class SMTPs if ( $this->getCC() ) $_header .= 'Cc: ' . $this->getCC() . "\r\n"; + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * So it is included into the function sendMsg() but not here. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + /* if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; - + */ + $host=$this->getHost(); $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index b8038056484..c63227e1601 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -36,7 +36,7 @@ abstract class DoliDB implements Database /** @var string Charset used to force charset when creating database */ public $forcecharset='utf8'; /** @var string Collate used to force collate when creating database */ - public $forcecollate='utf8_general_ci'; + public $forcecollate='utf8_unicode_ci'; /** @var resource Resultset of last query */ private $_results; /** @var bool true if connected, else false */ diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 087abf709d9..d7ff764ce7a 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -854,7 +854,7 @@ class DoliDBMysqli extends DoliDB } /** - * Return charset used to store data in database + * Return charset used to store data in current database (same result than using SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "databasename";) * * @return string Charset */ @@ -897,7 +897,7 @@ class DoliDBMysqli extends DoliDB } /** - * Return collation used in database + * Return collation used in current database * * @return string Collation value */ diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 8733e6a7c17..de8b4d7e8bf 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -45,10 +45,12 @@ $Config['Enabled'] = true ; // Path to user files relative to the document root. -$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ; +$extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access +$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&entity='.$extEntity.'&file=' ; $Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website)); + // Fill the following value it you prefer to specify the absolute path for the // user files directory. Useful if you are using a virtual directory, symbolic // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index cdc45de825e..57a4c03c63f 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -108,7 +108,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { $multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } - print $formactions->select_type_actions($actioncode, "actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, $multiselect); + print $formactions->select_type_actions($actioncode, "actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1), 0, $multiselect); print ''; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b0ae91ee3f..0193a33b305 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -35,7 +35,7 @@ * @param string $urloption More parameters on URL request * @param int $minLength Minimum number of chars to trigger that Ajax search * @param int $autoselect Automatic selection if just one value - * @param array $ajaxoptions Multiple options array + * @param array $ajaxoptions Multiple options array * Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * Ex: array('disabled'=> * Ex: array('show'=> @@ -61,8 +61,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("input#search_'.$htmlname.'").keydown(function() { $("#'.$htmlname.'").val(""); }); - - /* I disable this. A call to trigger is already done later into the select action of the autocomplete code + + /* I disable this. A call to trigger is already done later into the select action of the autocomplete code $("input#search_'.$htmlname.'").change(function() { console.log("Call the change trigger on input '.$htmlname.' because of a change on search_'.$htmlname.' was triggered"); $("#'.$htmlname.'").trigger("change"); @@ -291,7 +291,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt needtotrigger="#" + fields[i]; } } - + if (needtotrigger != "") // To force select2 to refresh visible content { // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done @@ -322,7 +322,8 @@ function ajax_dialog($title,$message,$w=350,$h=150) { global $langs; - $msg= '
'; + $newtitle=dol_textishtml($title)?dol_string_nohtmltag($title,1):$title; + $msg= '
'; $msg.= $message; $msg.= '
'."\n"; $msg.= ''; - } - if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; + // 3=??? + // 4=all pages, not only menu + $tmp=basename($_SERVER["PHP_SELF"]); + if ($tmp == 'get_menudiv.php' || $conf->dol_use_jmobile == 4) + { + if (empty($conf->dol_use_jmobile) || ($conf->dol_use_jmobile != 2 && $conf->dol_use_jmobile != 3)) + { + print ''; + } + if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; + } } } @@ -1878,7 +1887,7 @@ if (! function_exists("llxFooter")) print '
'.$msg.'
'; } - define("MAIN_CORE_ERROR",0); + //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant } print "\n\n"; @@ -1898,7 +1907,7 @@ if (! function_exists("llxFooter")) if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent; // Wrapper to show tooltips - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover)) { print "\n\n"; print ' + @@ -52,9 +54,26 @@ if (empty($usedolheader)) } else { - $arraycss=array(); - $arrayjs=array(); - + $arraycss=array(); + $arrayjs=array(); + /* + $arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css', + '/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css', + '/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css' + ); + $arrayjs=array('/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js', + '/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js', + '/includes/jszip/jszip.min.js', + '/includes/pdfmake/pdfmake.min.js', + '/includes/pdfmake/vfs_fonts.js' + ); + */ + llxHeader('','','','',0,0,$arrayjs,$arraycss); } @@ -66,9 +85,9 @@ else

This page is a sample of page using tables. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 960 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
-- dataTables
- tablednd

@@ -79,10 +98,10 @@ This page is a sample of page using tables. It is designed to make test with
- +
- +
@@ -92,10 +111,10 @@ This page is a sample of page using tables. It is designed to make test with
- +
- +
@@ -105,10 +124,10 @@ This page is a sample of page using tables. It is designed to make test with
- + - +
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index a697b371438..a53f812611a 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -17,7 +17,8 @@ llxHeader();

This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)


diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 1d8e9348f72..f6149690b7e 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -62,6 +62,10 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $hookmanager->initHooks(array('thirdpartybancard','globalcard')); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('thirdpartybancard')); + + /* * Actions diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index accff491427..0220f775d7b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -994,10 +994,11 @@ else if ($conf->use_javascript_ajax) { print ''.fieldLabel('FirstName','firstname').''; - print ''; + print ''; print ''; - print ''.fieldLabel('UserTitle','civility_id').''; - print $formcompany->select_civility($object->civility_id).''; + // Title + print ''.fieldLabel('UserTitle','civility_id').''; + print $formcompany->select_civility($object->civility_id, 'civility_id', 'maxwidth100').''; print ''; } @@ -1070,9 +1071,9 @@ else // Zip / Town print ''.fieldLabel('Zip','zipcode').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print ''.fieldLabel('Town','town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print ''; // Country @@ -1092,15 +1093,15 @@ else // Email web print ''.fieldLabel('EMail','email').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').''; - print ''; + print ''; print ''.fieldLabel('Web','url').''; - print ''; - + print ''; + // Skype if (! empty($conf->skype->enabled)) { print ''.fieldLabel('Skype','skype').''; - print ''; + print ''; } // Phone / Fax diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 0658416797e..3ab1c159545 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -34,7 +34,6 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsupplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; @@ -997,7 +996,6 @@ llxHeader('', $langs->trans('CommRequests'), 'EN:Ask_Price_Supplier|FR:Demande_d $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formsupplier_proposal = new FormSupplierProposal($db); $formmargin = new FormMargin($db); $companystatic = new Societe($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } @@ -1478,41 +1476,6 @@ if ($action == 'create') } print ''; - // Project - /* - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - print ''; - print ''; - if ($user->rights->supplier_proposal->creer) { - if ($action != 'classify') - print ''; - print '
'; - print $langs->trans('Project') . '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '
'; - print ''; - if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid'); - } else { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none'); - } - print ''; - } else { - print ''; - if (! empty($object->fk_project)) { - print ''; - $proj = new Project($db); - $proj->fetch($object->fk_project); - print ''; - print $proj->ref; - print ''; - print ''; - } else { - print ' '; - } - } - print ''; - }*/ - // Multicurrency if (! empty($conf->multicurrency->enabled)) { @@ -1596,14 +1559,32 @@ if ($action == 'create') print ''; + if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) + { + // Multicurrency Amount HT + print ''; + print ''; + print ''; + + // Multicurrency Amount VAT + print ''; + print ''; + print ''; + + // Multicurrency Amount TTC + print ''; + print ''; + print ''; + } + // Amount HT - print ''; - print ''; + print ''; + print ''; print ''; // Amount VAT print ''; - print ''; + print ''; print ''; // Amount Local Taxes @@ -1625,27 +1606,6 @@ if ($action == 'create') print ''; print ''; - if (!empty($conf->multicurrency->enabled)) - { - // Multicurrency Amount HT - print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; - } - - // Statut - //print ''; - print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
'; // Margin Infos diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 45dacd3805a..1d249ad627d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2095,11 +2095,12 @@ class SupplierProposal extends CommonObject if ($mode == 0) return $this->labelstatut[$statut]; if ($mode == 1) return $this->labelstatut_short[$statut]; - if ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; + if ($mode == 2) return img_picto($this->labelstatut[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; if ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans); if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; - if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut_short[$statut],$statuttrans); - } + if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + if ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + } /** diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index e51ddfcdceb..a50e8509ba5 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -34,8 +34,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsupplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -191,7 +191,7 @@ llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_p $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formsupplier_proposal = new FormSupplierProposal($db); +$formpropal = new FormPropal($db); $companystatic=new Societe($db); $now=dol_now(); @@ -388,7 +388,7 @@ if ($result) print ''; print ''; print ''; - $formsupplier_proposal->selectSupplierProposalStatus($viewstatut,1); + $formpropal->selectProposalStatus($viewstatut,1,0,1,'supplier'); print ''; // Check boxes print ''; diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index 8f72744486a..8ba1f958918 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -28,27 +28,44 @@ global $user; $langs = $GLOBALS['langs']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("SupplierProposal"); ?> - trans("ShowSupplierProposal"),"supplier_proposal").' '.$objectlink->ref; ?> - - datec,'day'); ?> - rights->supplier_proposal->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - + + trans("SupplierProposal"); ?> + trans("ShowSupplierProposal"),"supplier_proposal").' '.$objectlink->ref; ?> + + datec,'day'); ?> + rights->supplier_proposal->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 2db312ee630..869dace222d 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -184,7 +184,7 @@ function conf($dolibarr_main_document_root) $conf->db->user = trim($dolibarr_main_db_user); $conf->db->pass = trim($dolibarr_main_db_pass); - if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation='utf8_general_ci'; + if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation='utf8_unicode_ci'; return 1; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ae45643c9cb..4f7edd144d2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -71,7 +71,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -257,7 +255,9 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } - +input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { + background-color: #FFF; +} input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; @@ -270,8 +270,6 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; - background: #FFF; - /* color: #111; */ border: 1px solid #C0C0C0; margin: 0px 0px 0px 0px; } @@ -304,7 +302,6 @@ span.timesheetalreadyrecorded input { border: none; /*background: transparent;*/ } - select.flat, form.flat select { font-weight: normal; @@ -339,9 +336,9 @@ input[type=checkbox] { background-color: transparent; border: none; box-shadow: input[type=radio] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -349,9 +346,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -540,12 +534,13 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { text-decoration: line-through; } +/* using a tdoverflowxxx make the min-with not working */ .tdoverflow { max-width: 0; overflow: hidden; @@ -618,19 +613,22 @@ div.myavailability { .minwidth400imp { min-width: 400px !important; } .minwidth500imp { min-width: 500px !important; } } +.maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } -/* Force values for small screen */ +/* Force values for small screen 1400 */ @media only screen and (max-width: 1400px) { .titlefield { width: 30% !important; } @@ -643,6 +641,7 @@ div.myavailability { .minwidth500imp { min-width: 300px !important; } } +/* Force values for small screen 1000 */ @media only screen and (max-width: 1000px) { .maxwidthonsmartphone { max-width: 100px; } @@ -654,16 +653,36 @@ div.myavailability { .minwidth500imp { min-width: 100px !important; } } -/* Force values for small screen */ +/* Force values for small screen 570 */ @media only screen and (max-width: 570px) { - input[type=text] { min-width: 20px; } - + div.titre { + line-height: 2em; + } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { + height: 40px !important; + } + + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { + min-width: 20px; + min-height: 1.4em; + line-height: 1.4em; + padding: .4em .1em; + border: 1px solid #BBB; + /* max-width: inherit; why this ? */ + } + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -675,6 +694,32 @@ div.myavailability { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } + + #tooltip { + position: absolute; + width: px; + } + + /* intput, input[type=text], */ + select { + width: 98%; + min-width: 40px; + } + + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } + } .linkobject { cursor: pointer; } @@ -792,7 +837,7 @@ div.fiche { margin-: px; margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> - dol_use_jmobile)) print ' margin-bottom: 10px;'."\n"; ?> + dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?> } div.fichecenter { width: 100%; @@ -1888,10 +1933,7 @@ div.tabs { } div.tabsElem { margin-top: 1px; - dol_use_jmobile)) { ?>; - margin-bottom: -1px; - -} /* To avoid overlap of tabs when not browser */ +} /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -2316,10 +2358,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 20px; } div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { @@ -2449,7 +2488,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'3':'7'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2485,10 +2524,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile)) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2497,22 +2534,12 @@ div.pagination li { } div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile)) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #000; text-decoration: none; - /* - border-color: #ccc; - background-color: #f5f5f5; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);*/ - background-repeat: repeat-x; - + background-repeat: repeat-x; } div.pagination li.pagination span.inactive { cursor: default; @@ -2544,13 +2571,6 @@ div.pagination li.litext a:hover { background-color: transparent; background-image: none; } -dol_use_jmobile)) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile)) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2610,7 +2630,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -2818,7 +2837,7 @@ form.liste_total div { border-top: 1px solid #DDDDDD; } tr.liste_sub_total, tr.liste_sub_total td { - border-bottom: 2px solid #aaa; + border-bottom: 1px solid #aaa; } .tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair { @@ -4189,11 +4208,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { @@ -4623,30 +4638,6 @@ img.demothumb { div.mainmenu { min-width: 20px; } - - #tooltip { - position: absolute; - width: px; - } - select { - width: 100%; - max-width: 100px; - min-width: 50px; - } - div.divphotoref { - padding-right: 5px; - } - img.photoref, div.photoref { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - padding: 4px; - height: 20px; - width: 20px; - object-fit: contain; - } - } dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -163,14 +162,20 @@ $tmppart=explode(',',$colorbackhmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; else $colortextbackhmenu='000000'; + $tmppart=explode(',',$colorbackvmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } else { $colortextbackvmenu='000000'; } + $tmppart=explode(',',$colorbacktitle1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } -else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } +if ($colortexttitle == '') +{ + $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); + if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } + else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } +} + $tmppart=explode(',',$colorbacktabcard1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } @@ -215,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -251,7 +255,9 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } - +input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { + background-color: #FDFDFD; +} input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; @@ -264,7 +270,6 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; - background: #FDFDFD; border: 1px solid #C0C0C0; margin: 0px 0px 0px 0px; } @@ -286,7 +291,7 @@ input.removedassigned { vertical-align: text-bottom; margin-bottom: -3px; } -input.smallpadd { +input.smallpadd { /* Used for timesheet input */ padding-left: 1px !important; padding-right: 1px !important; } @@ -299,14 +304,9 @@ span.timesheetalreadyrecorded input { /*background: transparent;*/ } - - select.flat, form.flat select { font-weight: normal; } -input:disabled { - background:#f4f4f4; -} .optiongrey, .opacitymedium { opacity: 0.5; } @@ -316,6 +316,10 @@ input:disabled { .opacitytransp { opacity: 0; } +select:invalid { color: gray; } +input:disabled { + background:#f4f4f4; +} input.liste_titre { box-shadow: none !important; @@ -331,14 +335,15 @@ input.removedfile { textarea:disabled { background:#f4f4f4; } +input[type=file ] { background-color: transparent; border-top: none; border-left: none; border-right: none; box-shadow: none; } input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; } input[type=radio] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } input[type=text] { min-width: 20px; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -346,9 +351,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -538,7 +540,7 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { @@ -600,30 +602,37 @@ div.myavailability { .clearboth { clear:both; } .hideobject { display: none; } .minwidth50 { min-width: 50px; } -.minwidth100 { min-width: 100px; } -.minwidth200 { min-width: 200px; } -.minwidth300 { min-width: 300px; } -.minwidth400 { min-width: 400px; } -.minwidth500 { min-width: 500px; } -.minwidth50imp { min-width: 50px !important; } -.minwidth100imp { min-width: 100px !important; } -.minwidth200imp { min-width: 200px !important; } -.minwidth300imp { min-width: 300px !important; } -.minwidth400imp { min-width: 400px !important; } -.minwidth500imp { min-width: 500px !important; } +/* rule to reduce top menu - 3rd reduction */ +@media only screen and (min-width: px) +{ + .minwidth100 { min-width: 100px; } + .minwidth200 { min-width: 200px; } + .minwidth300 { min-width: 300px; } + .minwidth400 { min-width: 400px; } + .minwidth500 { min-width: 500px; } + .minwidth50imp { min-width: 50px !important; } + .minwidth100imp { min-width: 100px !important; } + .minwidth200imp { min-width: 200px !important; } + .minwidth300imp { min-width: 300px !important; } + .minwidth400imp { min-width: 400px !important; } + .minwidth500imp { min-width: 500px !important; } +} +.maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } -/* Force values for small screen */ +/* Force values for small screen 1400 */ @media only screen and (max-width: 1400px) { .titlefield { width: 30% !important; } @@ -636,6 +645,7 @@ div.myavailability { .minwidth500imp { min-width: 300px !important; } } +/* Force values for small screen 1000 */ @media only screen and (max-width: 1000px) { .maxwidthonsmartphone { max-width: 100px; } @@ -647,14 +657,36 @@ div.myavailability { .minwidth500imp { min-width: 100px !important; } } -/* Force values for small screen */ +/* Force values for small screen 570 */ @media only screen and (max-width: 570px) { + div.titre { + line-height: 2em; + } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr { + height: 40px !important; + } + + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { + min-width: 20px; + min-height: 1.4em; + line-height: 1.4em; + padding: .4em .1em; + border: 1px solid #BBB; + /* max-width: inherit; why this */ + } + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -666,6 +698,31 @@ div.myavailability { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } + + #tooltip { + position: absolute; + width: px; + } + + /* intput, input[type=text], */ + select { + width: 98%; + min-width: 40px; + } + + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } } .linkobject { cursor: pointer; } @@ -2083,13 +2140,11 @@ span.butAction, span.butActionDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; - dol_use_jmobile)) { ?> background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; @@ -2214,10 +2269,7 @@ table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr { height: 20px; } @@ -2351,7 +2403,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'3':'14'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2387,10 +2439,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile)) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2400,7 +2450,6 @@ div.pagination li { div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile)) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; @@ -2414,7 +2463,6 @@ div.pagination li.pagination span { background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-repeat: repeat-x; - } div.pagination li.pagination span.inactive { cursor: default; @@ -2427,13 +2475,6 @@ border: none; padding-left: 4px; font-weight: bold; } -dol_use_jmobile)) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile)) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2485,7 +2526,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -4083,11 +4123,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { @@ -4362,6 +4398,8 @@ border-top-right-radius: 6px; img.demothumb { box-shadow: 2px 2px 8px #888; margin-bottom: 4px; + margin-right: 20px; + margin-left: 10px; } @@ -4509,8 +4547,7 @@ img.demothumb { width: px; } select { - width: 100%; - max-width: 100px; + width: 98%; min-width: 0 !important; } div.divphotoref { diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 823f5ad307e..ef7ffd9f70b 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -169,7 +169,7 @@ print ""; print ""; print ""; print ""; -print "'; +print "'; print "'; print ''; print ""; @@ -187,13 +187,13 @@ while ($i <= $MAXAGENDA) $var=!$var; print ""; // Nb - print '"; + print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; @@ -747,7 +747,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print ''; @@ -1802,7 +1802,7 @@ else print ''; print ''; - print ''; print ''; @@ -1902,7 +1902,7 @@ else if(! empty($conf->api->enabled) && $user->admin) { print ''; print ''; @@ -1992,7 +1992,7 @@ else } // Type - print ''; + print ''; print ''; } @@ -2104,7 +2104,7 @@ else print ''; - print ''; + print ''; print ''; // Picto and label of permission - print ''; + print ''; // Permission and tick if (! empty($object->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin @@ -403,7 +403,7 @@ if ($result) } $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); - print ''; + print ''; print ''."\n"; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index b6d33de99ae..6fa65660df1 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -36,7 +36,13 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks // Some value of modulepart can be used to get resources that are public so no login are required. if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) +{ + define("NOLOGIN",'1'); + // For multicompany + $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); + if (is_numeric($entity)) define("DOLENTITY", $entity); +} /** * Header empty diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index e10d089c2a8..d60218fba22 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -82,7 +82,7 @@ if ($key != $conf->global->CRON_KEY) // If param userlogin is reserved word 'firstadmin' if ($userlogin == 'firstadmin') { - $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 ORDER BY entity LIMIT 1'; + $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 and statut = 1 ORDER BY entity LIMIT 1'; $resql=$db->query($sql); if ($resql) {
".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)".$langs->trans("ExtSiteUrlAgenda").'
'." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)
".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).''.$langs->trans("Color").'
'.$langs->trans("AgendaExtNb",$key)."'.$langs->trans("AgendaExtNb",$key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d2c96ab7950..0cd5b077996 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -733,7 +733,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print '
'; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1817,7 +1817,7 @@ else print ''; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1829,8 +1829,8 @@ else // Photo print '
'.$langs->trans("Photo").''; - print $form->showphoto('userphoto',$object,100,0,$caneditfield,'photowithmargin','small'); + print ''; + print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small'); print '
'.$langs->trans("ApiKey").''; - print ''; + print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"'); print '
'.$langs->trans("Type").'
'.$langs->trans("Type").''; if ($user->id == $object->id || ! $user->admin) { @@ -2035,7 +2035,7 @@ else // State if (empty($conf->global->USER_DISABLE_STATE)) { - print '
'.fieldLabel('State','state_id').''; + print '
'.fieldLabel('State','state_id').''; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print '
'; if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { @@ -2135,7 +2135,7 @@ else print ''; if ($caneditfield) { - print ''; + print ''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 997933e234b..75af1dae8e3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1659,38 +1659,48 @@ class User extends CommonObject $outputlangs->load("users"); $outputlangs->load("other"); - $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword"); + $appli=constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + + $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current if (! $changelater) { + $url = $urlwithroot.'/'; + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; - $url = $urlwithroot.'/'; - $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n"; + + $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg.= "--\n"; $mesg.= $user->getFullName($outputlangs); // Username that make then sending + + dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } else { + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; - $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); $mesg.= $url."\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; - dol_syslog(get_class($this)."::send_password url=".$url); + + dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } + $mailfile = new CMailFile( $subject, $this->email, diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 36338f03e10..d1922371909 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -96,6 +96,7 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('usercard','globalcard')); + /* * Actions */ @@ -108,6 +109,7 @@ if (empty($reshook)) { include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } + /* * View */ @@ -144,20 +146,21 @@ if ($object->id) } - print ''; + print '
'; // Login - print ''; + print ''; - // Nbre fichiers - print ''; + // Nbre files + print ''; //Total taille - print ''; + print ''; print '
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - print ''; + dol_fiche_end(); + $modulepart = 'user'; $permission = $user->rights->user->user->creer; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 3240ae2d5ec..87d96a46638 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -329,8 +329,8 @@ if ($result) { // On affiche ligne pour modifier droits print '
'.img_object('',$picto).' '.$objMod->getName(); - print ' '.img_object('',$picto).' '.$objMod->getName(); + print ''; print ''.$langs->trans("All").""; print '/'; @@ -344,7 +344,7 @@ if ($result) print '
'.img_object('',$picto).' '.$objMod->getName().''.img_object('',$picto).' '.$objMod->getName().''.$permlabel. ''.$permlabel.'