diff --git a/ChangeLog b/ChangeLog index 4b97d3a6b89..31ddbd56bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,8 +11,32 @@ Following changes may create regression for some external modules, but were nece * The trigger USER_SETINGROUP and USER_REMOVEFROMGROUP has been replaced with trigger USER_MODIFY. * The page societe/soc.php was renamed into societe/card.php to match page naming conventions. * The page compta/facture.php was renamed into compta/facture/card.php to match page naming conventions. +* The signature of method ->delete() of class Product and PriceExpression was changed from + ->delete($id, notrigger) to ->delete(User, notrigger) to match standard dev rules. +***** ChangeLog for 5.0.1 compared to 5.0.0 ***** +FIX: #6503: SQL error in "Last pending payment invoices" +FIX: #6505 Project elements page shows greyed-out links even if the option to show actions not available is disabled +FIX: #6507: Statistics counter show wrong total Contract numbers when the user does not have full access +FIX: #6533 #6590 +FIX: #6535 +FIX: bank account not visible on payment card +FIX: colspan +FIX: Data lost during merge of thirdparties +FIX: Detection of color brightness +FIX: Filter on date lost after submit on time spent page +FIX: forgottent fk_unit field on llx_supplier_propaldet +FIX: list of projects +FIX: LOG_ERROR does not exists. Use LOG_ERR. +FIX: Missing total on project overview. +FIX: multicurrency management on supplier order/invoice +FIX: Notification sending was broken. +FIX: origin & origin id on supplier order line +FIX: param php doc +FIX: Picto of project on dol_banner and box +FIX: Some errors when downloading files. + ***** ChangeLog for 5.0.0 compared to 4.0.* ***** For users: NEW: Add module mulicurrency. @@ -165,6 +189,42 @@ Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful o feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0. +***** ChangeLog for 4.0.5 to 4.0.4 ***** +FIX: #6234 +FIX: #6259 +FIX: #6330 +FIX: #6360 +FIX: #6411 +FIX: #6443 +FIX: #6444 +FIX: #6453 +FIX: #6503: SQL error in "Last pending payment invoices" +FIX: #6505 Project elements page shows greyed-out links even if the option to show actions not available is disabled +FIX: #6507: Statistics counter show wrong total Contract numbers when the user does not have full access +FIX: #6533 #6590 +FIX: #6619 Template invoices list do not respect restricted thirdparty user rights +FIX: #6621 Documents tab shows greyed out upload form even if the option to show actions not available is disabled +FIX: add entity param to document link +FIX: Can use quote into supplier ref on order line add +FIX: Change the customer code only if error on duplicate +FIX: Creation of credit note on invoice with deposit stole the discount. +FIX: delete bank class lines when we delete bank_categ +FIX: deletion of bank tag +FIX: detail of deposit and credit not was not visible into final invoice +FIX: Error management during bank account creation +FIX: error management in bank account deletion. +FIX: event status is not modified when assign an user +FIX: forgotten fk_facture_fourn attribute on supplierinvoice line object +FIX: If bank module on, field must be required to register payment of expense report. +FIX: load multicurrency informations on supplier order and bill lines fetch +FIX: Missing total on project overview. +FIX: multicurrency_subprice +FIX: param billed when we change page +FIX: protection against infinite loop on hierarchy +FIX: Supplier Order list filter by project +FIX: the dolCopyDir fails if target dir does not exists. +FIX: use param for http links + ***** ChangeLog for 4.0.4 to 4.0.3 ***** FIX: #6227 Document models table header "Unit" is shown in 2 lines in Spanish FIX: #6230 diff --git a/build/debian/control b/build/debian/control index 75ffb43b2c0..970f192f094 100755 --- a/build/debian/control +++ b/build/debian/control @@ -10,12 +10,13 @@ Build-Depends: debhelper (>= 9), po-debconf Package: dolibarr Architecture: all -Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, - php5-cli, +# For debian 7 or 8 or 9 +Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php, + php5-cli | php-cli, # Required PHP extensions - php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, + php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd, # Required PHP libraries - php-pear, php-mail-mime, + php-pear, php-mail-mime, # php-tcpdf, # libfpdf-tpl-php, php-fpdf, # libphp-adodb, @@ -30,7 +31,9 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | ${misc:Depends}, ${perl:Depends} Recommends: apache2 | lighttpd | httpd, - mariadb-server | virtual-mysql-server + mariadb-server | virtual-mysql-server, +# Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8 + php-xml, php-mbstring Suggests: www-browser, php5-geoip Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software package for diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 4b946fda433..6ee2a89931f 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -61,7 +61,7 @@ apache_install() { # Enable dolibarr conf if which a2enconf >/dev/null 2>&1 ;then # a2enconf exists for ubuntu only - echo "Enable link for Apache config file with a3enconf" + echo "Enable link for Apache config file with a2enconf" a2enconf dolibarr else if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index ff580fad58c..c1a56beacd7 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -40,6 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); * Main */ +$includecustom=0; $includeconstants=array(); if (empty($argv[1])) @@ -67,8 +68,6 @@ while ($i < $argc) if (empty($includecustom)) { - $includecustom=0; - if (DOL_VERSION != $release) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n"; @@ -80,7 +79,7 @@ else { if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release)) { - print 'Error: When parameter "includecustom" is not set, version declared into ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n"; + print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; exit -1; } @@ -124,16 +123,21 @@ foreach ($includeconstants as $countrycode => $tmp) fputs($fp, ''."\n"); -// TODO Replace RecursiveDirectoryIterator with dol_dir_list -$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/'); +/*$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/'); $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); +*/ +$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; +$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs +$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; $needtoclose=0; -foreach ($files as $file) { - $newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file)); - if ($newdir!=$dir) { +foreach ($files as $filetmp) { + $file = $filetmp['fullname']; + //$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file)); + $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); + if ($newdir!=$dir) { if ($needtoclose) fputs($fp, ' '."\n"); fputs($fp, ' '."\n"); @@ -161,14 +165,21 @@ $checksumconcat=array(); fputs($fp, ''."\n"); // TODO Replace RecursiveDirectoryIterator with dol_dir_list -$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/'); +/*$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/'); $iterator2 = new RecursiveIteratorIterator($dir_iterator2); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); +*/ +$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; +$regextoexclude='(custom|documents|conf|install)$'; // Exclude dirs +$files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; $needtoclose=0; -foreach ($files as $file) { - $newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); +foreach ($files as $filetmp) { + $file = $filetmp['fullname']; + //$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); + $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); + $newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); if ($newdir!=$dir) { if ($needtoclose) fputs($fp, ' '."\n"); diff --git a/dev/skeletons/README.md b/dev/skeletons/README.md new file mode 100644 index 00000000000..68fe9c093fb --- /dev/null +++ b/dev/skeletons/README.md @@ -0,0 +1 @@ +Files and tools were moved into htdocs/modulebuilder/skeletons \ No newline at end of file diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index f566938d7e0..bb3430eb22c 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -300,6 +300,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0; // install.lang if (preg_match('/^KeepDefaultValues/', $value)) $qualifiedforclean=0; + // mail.lang + if (preg_match('/MailingModuleDesc/i', $value)) $qualifiedforclean=0; // main.lang if (preg_match('/^Duration/', $value)) $qualifiedforclean=0; if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0; diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 4e05b019d08..7f909cd2f13 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -242,20 +242,8 @@ if ($resql) print '
'; print ''."\n"; - print ''; - - if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder); - - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - // Line for search fields - print ''; + print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print ''; if (! empty($arrayfields['aa.label']['checked'])) print ''; if (! empty($arrayfields['aa.account_parent']['checked'])) print ''; @@ -268,8 +256,16 @@ if ($resql) print ''; print ''; - $var = false; - + print ''; + if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder); + if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; + $accountstatic = new AccountingAccount($db); $accountparent = new AccountingAccount($db); @@ -281,7 +277,7 @@ if ($resql) $accountstatic->label = $obj->label; $accountstatic->account_number = $obj->account_number; - print ''; + print ''; // Account number if (! empty($arrayfields['aa.account_number']['checked'])) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 75d3be10444..d2b039a28e0 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -911,11 +911,9 @@ if ($id) // Lines with values while ($i < $num) { - $var = ! $var; - $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { print ''; @@ -1198,14 +1196,13 @@ else { if ($showemptyline) { - $var=!$var; - print ''; + print ''; $showemptyline=0; } - $var=!$var; + $value=$tabname[$i]; - print ''; + print ''; print ''; print ''; print ''; // Title line with search boxes - print ''; + print ''; $filterfound=0; foreach ($fieldlist as $field => $value) { @@ -831,25 +831,25 @@ if ($id) } if ($id == 4) print ''; print ''; - print ''; + print ''; + print ''; - print ''; + print ''; if ($num) { // Lines with values while ($i < $num) { - $var = ! $var; - $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -860,7 +860,9 @@ if ($id) // Show fields if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); - print ''; + print ''; + print ''; print '\n"; if (! empty($user->admin)) { // TO DO Mutualize code for yes/no constants - $var = ! $var; - print ""; + print ''; print ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { print ''; - $var = ! $var; - print ""; + print ''; print ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { print ''; - $var = ! $var; - print ""; - print ''; - if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; - } else { - print ''; - } - print ''; - - $var = ! $var; - print ""; + print ''; + print ''; + if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { + print ''; + } else { + print ''; + } + print ''; + + print ''; print ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { print ''; + print ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue; diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php index 2a868969c3d..8e19a3e3e87 100644 --- a/htdocs/accountancy/admin/journal.php +++ b/htdocs/accountancy/admin/journal.php @@ -125,9 +125,8 @@ print ''; print "\n"; foreach ( $list as $key ) { - $var = ! $var; - print ''; + print ''; // Param $label = $langs->trans($key); @@ -167,8 +166,6 @@ if ($resql) { while ( $i < $numr ) { $objp = $db->fetch_object($resql); - $var = ! $var; - $bankaccountstatic->rowid = $objp->rowid; $bankaccountstatic->id = $objp->rowid; $bankaccountstatic->ref = $objp->ref; @@ -177,7 +174,7 @@ if ($resql) { $bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->accountancy_journal = $objp->accountancy_journal; - print ''; + print ''; // Param print ''; + + print ''; print ''; print ''; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index ae128d940e8..d2254b4afd6 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -295,8 +295,8 @@ if ($mode) foreach ($data as $val) { $year = $val['year']; - $var=!$var; - print ''; + + print ''; print ''; if ($label2) print ''; print ''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 6acdd1e56b7..d1a8e707e43 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -141,7 +141,7 @@ if (! $mesg) $head = member_stats_prepare_head($adh); -dol_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), 0, 'user'); +dol_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), -1, 'user'); print '
'; @@ -183,7 +183,7 @@ foreach ($data as $val) while ($oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print '
'; print ''; print ''; } - $var=!$var; + print ''; print '"; + + print ''; $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; print ''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index d8116c79e94..750ad483461 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -40,6 +40,8 @@ $search_account=GETPOST('search_account','int'); $search_amount=GETPOST('search_amount','alpha'); $optioncss = GETPOST('optioncss','alpha'); +$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"]; + $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -51,7 +53,19 @@ $pagenext = $page + 1; if (! $sortorder) { $sortorder="DESC"; } if (! $sortfield) { $sortfield="c.dateadh"; } -$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"]; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('subscriptionlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('subscription'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( +); +$arrayfields=array( +); // Security check $result=restrictedArea($user,'adherent','','','cotisation'); @@ -61,16 +75,32 @@ $result=restrictedArea($user,'adherent','','','cotisation'); * Actions */ -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } + +$parameters=array('socid'=>$socid); +$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'); + +if (empty($reshook)) { - $search=""; - $search_ref=""; - $search_lastname=""; - $search_firstname=""; - $search_login=""; - $search_note=""; - $search_amount=""; - $search_account=""; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers + { + $search=""; + $search_ref=""; + $search_lastname=""; + $search_firstname=""; + $search_login=""; + $search_note=""; + $search_amount=""; + $search_account=""; + $toselect=''; + $search_array_options=array(); + } } @@ -84,7 +114,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu // List of subscriptions -$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,"; +$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,"; $sql.= " c.rowid as crowid, c.subscription,"; $sql.= " c.dateadh,"; $sql.= " c.datef,"; @@ -123,7 +153,10 @@ $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - $i = 0; + + $arrayofselected=is_array($toselect)?$toselect:array(); + + $i = 0; $title=$langs->trans("ListOfSubscriptions"); if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')'; @@ -139,6 +172,16 @@ if ($result) if ($search_amount) $param.="&search_amount=".$search_amount; if ($optioncss != '') $param.='&optioncss='.$optioncss; + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); + if ($user->rights->adherent->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + //if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + print ''; if ($optioncss != '') print ''; print ''; @@ -146,8 +189,9 @@ if ($result) print ''; print ''; print ''; + print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit); if ($sall) { @@ -156,39 +200,27 @@ if ($result) $moreforfilter = ''; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + print '
'; print '
   
   
'; + print '
'; if (! empty($tabcond[$i])) { print ''.$langs->trans($tablib[$i]).''; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 85c342992c0..19c33d848c8 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -146,8 +146,7 @@ if ($action == 'display' || $action == 'delete') { if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) { foreach ( $accountingcategory->lines_display as $cpt ) { - $var = ! $var; - print '
' . length_accountg($cpt->account_number) . '' . $cpt->label . ''; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 3a775149987..0580a9688ed 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -806,7 +806,7 @@ if ($id) print '
'; + print ''; if ($filterfound) { $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; } print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 1c49b65bac8..4b733bee5a6 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -39,6 +39,7 @@ $langs->load("bills"); $langs->load("admin"); $langs->load("accountancy"); $langs->load("salaries"); +$langs->load("loan"); // Security check if (! empty($user->rights->accountancy->chartofaccount)) @@ -134,9 +135,8 @@ print ''; print ''; foreach ( $list_account as $key ) { - $var = ! $var; - print ''; + print ''; // Param $label = $langs->trans($key); print ''; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 9e57830b94d..f7bbbb97969 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -148,9 +148,8 @@ $var = ! $var; $num = count($main_option); if ($num) { foreach ( $main_option as $key ) { - $var = ! $var; - print ''; + print ''; // Param $label = $langs->trans($key); @@ -178,7 +177,7 @@ print ''; $var = ! $var; -print ''; +print ''; print ''; if (! $conf->use_javascript_ajax) { print ''; } - print ''; + print ''; print ''; if (! $conf->use_javascript_ajax) { print '"; - foreach ( $model_option as $key ) { - $var = ! $var; - - print ''; + foreach ( $model_option as $key ) { + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 4b2b57ee7db..507a68a3c01 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -125,7 +125,7 @@ if ($result) { while ( $i < $num && $i < $max ) { $obj = $db->fetch_object($result); $fiscalyearstatic->id = $obj->rowid; - print ''; + print ''; print ''; print ''; print ''; @@ -136,7 +136,7 @@ if ($result) { $i ++; } } else { - print ''; + print ''; } print '
' . $label . '
' . $langs->trans("Selectmodelcsv") . ''; @@ -212,7 +211,7 @@ if ($num2) { print '
' . $langs->trans('OptionsDeactivatedForThisExportModel') . '
' . $langs->trans("Selectformat") . ''; @@ -230,10 +229,8 @@ if ($num2) { } print "
' . img_object($langs->trans("ShowFiscalYear"), "technic") . ' ' . $obj->rowid . '' . $obj->label . '' . dol_print_date($db->jdate($obj->date_start), 'day') . '
' . $langs->trans("None") . '
' . $langs->trans("None") . '
'; } else { diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 99b491688cb..4a6c82cb581 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -145,8 +145,7 @@ if ($result) { $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); - $var = ! $var; - print ''; + print '
'; print $objp->accounting; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 74479a9d39f..3ea77a24b43 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -142,18 +142,17 @@ if ($action == 'setmanagezero') { } if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + $setdisabledirectinput = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } - /* * View */ @@ -215,8 +214,7 @@ print "
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ''; @@ -229,8 +227,7 @@ if (! empty($user->admin)) } print '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ''; @@ -243,22 +240,20 @@ if (! empty($user->admin)) } print '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; @@ -276,9 +271,7 @@ if (! empty($user->admin)) // Param a user $user->rights->accountancy->chartofaccount can access foreach ($list as $key) { - $var = ! $var; - - print '
' . $langs->trans('Journaux') . '
'.$memberstatic->getmorphylib($val['label']).''.$val['nb'].''.dol_print_date($val['lastdate'],'dayhour').'
'.$val['label'].''.$val['label2'].''.$val['nb'].'
'; print ''; @@ -195,7 +195,7 @@ foreach ($data as $val) print '0
'; //print ''; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0c9c8467f1f..cc7fbef58f5 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -825,8 +825,8 @@ if ($rowid > 0) while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print "
'.$subscriptionstatic->getNomUrl(1).'
'."\n"; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder); - if (! empty($conf->banque->enabled)) - { - print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder); - } - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre(''); - print "\n"; - - // Line for filters fields - print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; if (! empty($conf->banque->enabled)) { @@ -202,65 +234,83 @@ if ($result) print ''; print ''; // Action column print ''; print "\n"; + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) + { + print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder); + } + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder); + //print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; + + // Static objects $subscription=new Subscription($db); $adherent=new Adherent($db); $accountstatic=new Account($db); - $var=true; $total=0; while ($i < min($num, $limit)) { - $objp = $db->fetch_object($result); - $total+=$objp->subscription; + $obj = $db->fetch_object($result); + $total+=$obj->subscription; - $subscription->ref=$objp->crowid; - $subscription->id=$objp->crowid; + $subscription->ref=$obj->crowid; + $subscription->id=$obj->crowid; - $adherent->lastname=$objp->lastname; - $adherent->firstname=$objp->firstname; - $adherent->ref=$adherent->getFullName($langs); - $adherent->id=$objp->rowid; - $adherent->login=$objp->login; + $adherent->lastname=$obj->lastname; + $adherent->firstname=$obj->firstname; + $adherent->ref=$obj->rowid; + $adherent->id=$obj->rowid; + $adherent->statut=$obj->statut; + $adherent->login=$obj->login; + $adherent->photo=$obj->photo; - $var=!$var; + - print ""; + print ''; // Ref print ''; // Lastname - print ''; + print ''; // Login print ''; // Libelle print ''; // Banque if (! empty($conf->banque->enabled)) { - if ($objp->fk_account) + if ($obj->fk_account) { - $accountstatic->id=$objp->fk_account; - $accountstatic->fetch($objp->fk_account); - //$accountstatic->label=$objp->label; + $accountstatic->id=$obj->fk_account; + $accountstatic->fetch($obj->fk_account); + //$accountstatic->label=$obj->label; print ''; } else @@ -271,13 +321,13 @@ if ($result) } // Date start - print '\n"; + print '\n"; // Date end - print '\n"; + print '\n"; // Price - print ''; + print ''; print ''; @@ -287,7 +337,7 @@ if ($result) } // Total - $var=!$var; + print ''; print "\n"; print "\n"; diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index f593e72faa9..19324812beb 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -33,7 +33,7 @@ $var=true; $total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + ?> > diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 846b0dab7a9..164c921d766 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -210,8 +210,8 @@ if (! $rowid && $action != 'create' && $action != 'edit') while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; print ''; print ''; print ''; @@ -530,8 +530,8 @@ if ($rowid > 0) $adh->firstname=$objp->firstname; // Lastname - $var=!$var; - print ''; + + print ''; if ($objp->societe != '') { print ''."\n"; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c11cbeff3a4..d076fcf7e26 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -173,8 +173,8 @@ if (! empty($triggers)) if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; - $var=!$var; - print ''; + + print ''; print ''; print ''; print '"; print ""; // Show external agenda -$var=!$var; -print ""; + +print ''; print ""; print '"; print ""; // Nb of agenda -$var=!$var; -print ""; + +print ''; print ""; print '"; + + print ''; // Nb print '"; // Name diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 9bf3a4ddc16..6e0a62610aa 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -265,7 +265,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) require_once $dir.'/'.$file; $module = new $classname($db, new ActionComm($db)); - $var=!$var; + print "\n"; print "'."\n"; print ''."\n"; // Manual or automatic -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $var=!$var; + print ''; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; + +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_VIEW -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA NOTIFICATION if ($conf->global->MAIN_FEATURES_LEVEL > 0) { - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''."\n"; print ''."\n"; print ''; + print ''; print ''; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 29475d712df..db81c9a325f 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -215,7 +215,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - print '\n"; - $var=!$var; + $i++; } } @@ -312,8 +312,8 @@ print ''; // Chemin du binaire genbarcode sous linux if (! isset($_SERVER['WINDIR'])) { - $var=!$var; - print ''; + + print ''; print ''; print '"; + + print ''; print ''; print '"; + + print ''; print ''; print ''; + print ''; print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 9785e945a6a..c76c35dfdeb 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -342,7 +342,7 @@ print "\n"; $var=true; foreach($boxtoadd as $box) { - $var=!$var; + if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) { @@ -354,7 +354,7 @@ foreach($boxtoadd as $box) } print "\n".''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -421,7 +421,7 @@ foreach($boxactivated as $key => $box) } print "\n".''."\n"; - print ''; + print ''; print ''; @@ -468,7 +468,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''."\n"; @@ -479,8 +479,8 @@ print ''; // Activate FileCache - Developement if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - $var=!$var; - print ''; print ''; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index f319692f27d..3b205f49cd2 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -166,7 +166,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print ''; print ''; print "\n"; -$var=!$var; -print ''; -$var=!$var; -print ''; @@ -471,7 +471,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '\n"; print ''; //Use draft Watermark -$var=!$var; + print ""; print ''; print ""; -print '"; + +print ''; print ''; print ''; print ''; // Ask for payment bank during order if ($conf->banque->enabled) { - $var=!$var; - print ''; } // Ask for warehouse during order if ($conf->stock->enabled) { - $var=!$var; - print ''; } */ @@ -697,7 +697,7 @@ print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0f8efb23da0..8c29fe67a1c 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -51,8 +52,6 @@ $error=0; if ( ($action == 'update' && empty($_POST["cancel"])) || ($action == 'updateedit') ) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); if (! empty($tmparray['id'])) { @@ -76,21 +75,23 @@ if ( ($action == 'update' && empty($_POST["cancel"])) dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["barcode"],'chaine',0,'',$conf->entity); - if ($_FILES["logo"]["tmp_name"]) + + $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; + if ($_FILES[$varforimage]["tmp_name"]) { - if (preg_match('/([^\\/:]+)$/i',$_FILES["logo"]["name"],$reg)) + if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) { $original_file=$reg[1]; $isimage=image_format_supported($original_file); if ($isimage >= 0) { - dol_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->mycompany->dir_output.'/logos/'.$original_file); - if (! is_dir($conf->mycompany->dir_output.'/logos/')) + dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); + if (! is_dir($dirforimage)) { - dol_mkdir($conf->mycompany->dir_output.'/logos/'); + dol_mkdir($dirforimage); } - $result=dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->mycompany->dir_output.'/logos/'.$original_file,1,0,$_FILES['logo']['error']); + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); if ($result > 0) { dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); @@ -101,8 +102,8 @@ if ( ($action == 'update' && empty($_POST["cancel"])) // Create thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... - // Used on logon for example - $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + // Create small thumb, Used on logon for example + $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) { $imgThumbSmall = $reg[1]; // Save only basename @@ -110,9 +111,8 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } else dol_syslog($imgThumbSmall); - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); + // Create mini thumb, Used on menu or for setup page for example + $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) { $imgThumbMini = $reg[1]; // Save only basename @@ -143,6 +143,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } } } + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity); @@ -196,7 +197,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } } -if ($action == 'addthumb') +if ($action == 'addthumb') // Regenerate thumbs { if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) { @@ -208,7 +209,7 @@ if ($action == 'addthumb') // Create thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... - // Used on logon for example + // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) { @@ -217,8 +218,7 @@ if ($action == 'addthumb') } else dol_syslog($imgThumbSmall); - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example + // Create mini thumbs. Used on menu or for setup page for example $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) { @@ -300,7 +300,7 @@ if ($action == 'edit' || $action == 'updateedit') });'; print ''."\n"; - print ''; + print ''; print ''; print ''; $var=true; @@ -309,72 +309,72 @@ if ($action == 'edit' || $action == 'updateedit') print ''."\n"; // Name - $var=!$var; - print ''."\n"; // Addresse - $var=!$var; - print ''."\n"; - $var=!$var; - print ''."\n"; - $var=!$var; - print ''."\n"; // Country - $var=!$var; - print ''."\n"; - $var=!$var; - print ''."\n"; - $var=!$var; - print ''."\n"; - $var=!$var; - print ''; print ''."\n"; - $var=!$var; - print ''; print ''."\n"; - $var=!$var; - print ''; print ''."\n"; // Web - $var=!$var; - print ''; print ''."\n"; // Barcode if (! empty($conf->barcode->enabled)) { - $var=!$var; - print ''; print ''; } // Logo - $var=!$var; + print '\n"; $var=true; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print ''; // Capital - $var=!$var; - print ''; // Juridical Status - $var=!$var; - print ''; // ProfId1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { - $var=!$var; - print ''; + + print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print '
'; - print ''; - print ''; - print ''; - print ' '; - print ''; + print ''; print ''; - $searchpitco=$form->showFilterAndCheckAddButtons(0); + $searchpitco=$form->showFilterButtons(); print $searchpitco; print '
'.$subscription->getNomUrl(1).''.$adherent->getNomUrl(1).''.$adherent->getNomUrl(-1).''.$adherent->login.''; - print dol_trunc($objp->note,32); + print dol_trunc($obj->note,32); print ''.$accountstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($obj->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.dol_print_date($db->jdate($obj->datef),'day')."'.price($objp->subscription).''.price($obj->subscription).'
".$langs->trans("Total")." 
trans("Subscription"); ?>
'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.''.dol_escape_htmltag($objp->libelle).''.yn($objp->subscription).'
'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'
'.$trigger['code'].''.$trigger['label'].''; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 79e6d3dbd6c..1e595b5088e 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -155,8 +155,8 @@ print ''.$langs->trans("Value")."
".$langs->trans("ExtSitesEnableThisTool")."'; if ($conf->use_javascript_ajax) @@ -178,8 +178,8 @@ print "
".$langs->trans("ExtSitesNbOfAgenda")."'; print ''; @@ -210,8 +210,8 @@ while ($i <= $MAXAGENDA) $color='AGENDA_EXT_COLOR'.$key; $enabled='AGENDA_EXT_ENABLED'.$key; - $var=!$var; - print "
'.$langs->trans("AgendaExtNb",$key)."
"; print (empty($module->name)?$name:$module->name); @@ -351,8 +351,8 @@ print ''.$langs->trans("Value").'
'.$langs->trans("AGENDA_USE_EVENT_TYPE").' '."\n"; @@ -369,9 +369,9 @@ print '
'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").' '."\n"; @@ -380,8 +380,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) } // AGENDA_DEFAULT_FILTER_TYPE -$var=!$var; -print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; @@ -389,8 +389,8 @@ $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AG print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").' '."\n"; @@ -398,8 +398,8 @@ $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_ print '
'.$langs->trans("AGENDA_DEFAULT_VIEW").' '."\n"; @@ -410,8 +410,8 @@ print '
'.$langs->trans('AGENDA_NOTIFICATION').' '."\n"; @@ -422,8 +422,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) } else { print ''.img_picto($langs->trans('Enabled'),'switch_on').''; print '
'.$langs->trans('AGENDA_NOTIFICATION_SOUND').' '."\n"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 58d97842017..98cecb2f44b 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -199,7 +199,7 @@ while ($i < $nbofbank) { $var = !$var; - print '
'.$bankorder[$i][0]."\n"; print $bankorder[$i][1]; print '
'; + print '
'; print $obj->libelle; print "\n"; print $langs->trans('BarcodeDesc'.$obj->encoding); @@ -276,7 +276,7 @@ if ($resql) print ''; print $formbarcode->setBarcodeEncoder($obj->coder,$barcodelist,$obj->rowid,'form'.$i); print "
'.$langs->trans("GenbarcodeLocation").''; print ''; @@ -328,8 +328,8 @@ if (! isset($_SERVER['WINDIR'])) // Module products if (! empty($conf->product->enabled)) { - $var=!$var; - print "
'.$langs->trans("SetDefaultBarcodeTypeProducts").''; $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); @@ -339,8 +339,8 @@ if (! empty($conf->product->enabled)) // Module thirdparty if (! empty($conf->societe->enabled)) { - $var=!$var; - print "
'.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); @@ -397,7 +397,7 @@ if ($conf->produit->enabled) $modBarCode = new $file(); $var = !$var; - print '
'.(isset($modBarCode->name)?$modBarCode->name:$modBarCode->nom)."\n"; print $modBarCode->info($langs); print '
'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print '
'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print ''.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("MaxNbOfLinesForBoxes"); print '
'.$langs->trans("EnableFileCache").''; + + print '
'.$langs->trans("EnableFileCache").''; print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; @@ -257,7 +257,7 @@ $var=true; $var=! $var; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnChequeReceipts").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='BANK_CHEQUERECEIPT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index a77fb706a71..060c910753a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -80,16 +80,16 @@ print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("ClickToDialUseTelLink").''; print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'
'; print '
'; print $langs->trans("ClickToDialUseTelLinkDesc"); print '
'; + +print '
'; print $langs->trans("DefaultLink").''; print 'global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'">
'; print '
'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index a9041f5272b..a6ca7871ae4 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -330,8 +330,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -569,7 +569,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnOrders").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='ORDER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -588,11 +588,11 @@ print "
'; +print '
'; print $langs->trans("WatermarkOnDraftOrders").''; print ''; print ''; @@ -603,8 +603,8 @@ print ''; // Shippable Icon in List /* Kept as hidden feature for the moment, result seems bugged. Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ? -$var=!$var; -print "
'.$langs->trans("ShippableOrderIconInList").' '; @@ -623,8 +623,8 @@ print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -645,16 +645,16 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; + + print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -675,8 +675,8 @@ if ($conf->stock->enabled) } else { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').'
 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; + + print '
'; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print '
'; + + print '
'; print $form->selectCurrency($conf->currency,"currency"); print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; print ''; // Note - $var=!$var; - print ''; print ''; @@ -409,18 +409,18 @@ if ($action == 'edit' || $action == 'updateedit') $langs->load("companies"); // Managing Director(s) - $var=!$var; - print ''; // Capital - $var=!$var; - print ''; // Juridical Status - $var=!$var; - print ''; // Object of the company - $var=!$var; - print ''; print ''; @@ -547,8 +547,8 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=true; - $var=!$var; - print ''; print "
'; print ''; @@ -383,7 +383,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { print '   '; - print ''; + print ''; } } else { print ''; @@ -392,8 +392,8 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); } else { @@ -431,8 +431,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfID1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -447,8 +447,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -463,8 +463,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -479,8 +479,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -495,8 +495,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -511,8 +511,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -525,14 +525,14 @@ if ($action == 'edit' || $action == 'updateedit') } // TVA Intra - $var=!$var; - print '
'; + + print '
'; print ''; print '
'; + + print '
'; print '
'; + + print '
'; print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '
"; @@ -563,7 +563,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
'; print ""; @@ -572,7 +572,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "
'; print ""; @@ -596,7 +596,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print "\n"; $var=true; - $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '
 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; @@ -619,7 +619,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; @@ -641,7 +641,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=true; - $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; @@ -661,7 +661,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; @@ -698,23 +698,23 @@ else print ''; $var=true; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; // Web - $var=!$var; - print ''; + + print ''; // Barcode if (! empty($conf->barcode->enabled)) { - $var=!$var; - print ''; + + print ''; } // Logo - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; + + print '
'.$langs->trans("CompanyName").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyCountry").''; + + print '
'.$langs->trans("CompanyCountry").''; if ($mysoc->country_code) { $img=picto_from_langcode($mysoc->country_code); @@ -724,43 +724,43 @@ else else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; print '
'.$langs->trans("State").''; + + print '
'.$langs->trans("State").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE); else print ' '; print '
'.$langs->trans("CompanyCurrency").''; + + print '
'.$langs->trans("CompanyCurrency").''; print currency_name($conf->currency,1); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Logo").''; + + print '
'.$langs->trans("Logo").''; $tagtd='tagtd '; if ($conf->browser->layout == 'phone') $tagtd=''; @@ -775,7 +775,7 @@ else } else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - print ''; + print ''; } else { @@ -785,8 +785,8 @@ else print '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'; @@ -802,26 +802,26 @@ else $var=true; // Managing Director(s) - $var=!$var; - print '
'.$langs->trans("ManagingDirectors").''; + + print '
'.$langs->trans("ManagingDirectors").''; print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '
'.$langs->trans("Capital").''; + + print '
'.$langs->trans("Capital").''; print $conf->global->MAIN_INFO_CAPITAL . '
'.$langs->trans("JuridicalStatus").''; + + print '
'.$langs->trans("JuridicalStatus").''; print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; @@ -836,8 +836,8 @@ else // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { - $var=!$var; - print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; @@ -852,8 +852,8 @@ else // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { - $var=!$var; - print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; @@ -868,8 +868,8 @@ else // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { - $var=!$var; - print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; @@ -884,8 +884,8 @@ else // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { - $var=!$var; - print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; @@ -900,8 +900,8 @@ else // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { - $var=!$var; - print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; + + print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; @@ -914,8 +914,8 @@ else } // VAT - $var=!$var; - print '
'.$langs->trans("VATIntra").'
'.$langs->trans("VATIntra").''; if (! empty($conf->global->MAIN_INFO_TVAINTRA)) { @@ -951,8 +951,8 @@ else print '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'; print ''; @@ -967,8 +967,8 @@ else print "\n"; $var=true; - $var=!$var; - print ''.$langs->trans("FiscalMonthStart").''; + + print ''.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . ''; @@ -985,7 +985,7 @@ else print "\n"; $var=true; - $var=!$var; + print "global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed").""; print ''; print ""; @@ -994,7 +994,7 @@ else print "
"; print "\n"; - $var=!$var; + print "global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed").""; print ''; print ""; @@ -1020,7 +1020,7 @@ else print "\n"; $var=true; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print ''; + print ''; print ''; print ''; print ''; @@ -239,7 +239,7 @@ else print ''; $var=false; - print ''; + print ''; print ''; print '
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; @@ -1048,7 +1048,7 @@ else print "
"; print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; @@ -1071,7 +1071,7 @@ else print "\n"; $var=true; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print ''; + print ''; print ''; print ''; @@ -192,7 +192,7 @@ if ($action == 'edit') print ''; $var=false; - print ''; + print ''; print ''; print '
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; @@ -1100,7 +1100,7 @@ else print "
"; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index abe5663084b..c097b9f39b1 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -148,7 +148,7 @@ print "\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 7fa47724c3d..7d7b8a8510c 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -197,7 +197,7 @@ print "\n"; $var=false; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; + print ''."\n"; // Value print ''; @@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '\n"; $var=true; $var=! $var; -print ''."\n"; //Use draft Watermark -$var=!$var; -print ''."\n"; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php new file mode 100644 index 00000000000..0bc620c41bf --- /dev/null +++ b/htdocs/admin/defaultvalues.php @@ -0,0 +1,309 @@ + + * + * 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/admin/defaultvalues.php + * \brief Page to set default values used used in a create form + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + +$langs->load("companies"); +$langs->load("products"); +$langs->load("admin"); +$langs->load("sms"); +$langs->load("other"); +$langs->load("errors"); + +if (!$user->admin) accessforbidden(); + +$id=GETPOST('rowid','int'); +$action=GETPOST('action','alpha'); + +$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder' + +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$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 (! $sortfield) $sortfield='page,param'; +if (! $sortorder) $sortorder='ASC'; + +$defaulturl = GETPOST('defaulturl'); +$defaultkey = GETPOST('defaultkey','alpha'); +$defaultvalue = GETPOST('defaultvalue'); + +$defaulturl=preg_replace('/^\//', '', $defaulturl); + + +/* + * Actions + */ + +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array('socid'=>$socid); +$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'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +{ + $defaulturl=''; + $defaultkey=''; + $defaultvalue=''; + $toselect=''; + $search_array_options=array(); +} + + +if ($action == 'add' || (GETPOST('add') && $action != 'update')) +{ + $error=0; + + if (empty($defaulturl)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Url")), null, 'errors'); + $error++; + } + if (empty($defaultkey)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors'); + $error++; + } + if (! $error) + { + $db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."default_values(type, user_id, page, param, value, entity) VALUES ('".$db->escape($mode)."', 0, '".$db->escape($defaulturl)."','".$db->escape($defaultkey)."','".$db->escape($defaultvalue)."', ".$db->escape($conf->entity).")"; + $result = $db->query($sql); + if ($result > 0) + { + $db->commit(); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $action=""; + $defaulturl=''; + $defaultkey=''; + $defaultvalue=''; + } + else + { + $db->rollback(); + setEventMessages($db->lasterror(), null, 'errors'); + $action=''; + } + } +} + +// Delete line from delete picto +if ($action == 'delete') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."default_values WHERE rowid = ".$db->escape($id); + // Delete const + $result = $db->query($sql); + if ($result >= 0) + { + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + } + else + { + dol_print_error($db); + } +} + + + + + + +/* + * View + */ + +$form=new Form($db); +$formadmin = new FormAdmin($db); + +$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; +llxHeader('',$langs->trans("Setup"),$wikihelp); + +print load_fiche_titre($langs->trans("DefaultValues"),'','title_setup'); + +print $langs->trans("DefaultValuesDesc")."
\n"; +print "
\n"; + +$param='&mode='.$mode; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($optioncss != '') $param.='&optioncss='.$optioncss; +if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl); +if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey); +if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue); + + +print '
entity) && $debug)?'?debug=1':'').'" method="POST">'; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$head=defaultvalues_prepare_head(); + +dol_fiche_head($head, $mode, '', -1, ''); + + +print ''; +print ''; +print ''; + +print '
'; print ''; print ''; @@ -247,11 +247,11 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; + print "\n"; - print '
'.$obj->name.'
'.$obj->name.''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 487203c9f4d..bc3ea402704 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -266,8 +266,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -503,7 +503,7 @@ print "
'; +print '
'; print $langs->trans("FreeLegalTextOnContracts").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='CONTRACT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -519,8 +519,8 @@ else print '
'; + +print '
'; print $langs->trans("WatermarkOnDraftContractCards").''; print ''; print '
'; +print ''; +$texthelp=$langs->trans("PageUrlForDefaultValues"); +if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php'); +else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php'); +$texturl=$form->textwithpicto($langs->trans("Url"), $texthelp); +print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'defaulturl','',$param,'',$sortfield,$sortorder); +$texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); +if ($mode != 'sortorder') $textkey=$form->textwithpicto($langs->trans("Key"), $texthelp); +else $textkey=$form->textwithpicto($langs->trans("Key"), $texthelp); +print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'defaultkey','',$param,'',$sortfield,$sortorder); +if ($mode != 'sortorder') +{ + $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; + // See list into GETPOST + $texthelp.='__USERID__
'; + $texthelp.='__MYCOUNTRYID__
'; + $texthelp.='__DAY__
'; + $texthelp.='__MONTH__
'; + $texthelp.='__YEAR__
'; + if (! empty($conf->multicompany->enabled)) $texthelp.='__ENTITYID__
'; + $textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp); +} +else +{ + $texthelp='ASC or DESC'; + $textvalue=$form->textwithpicto($langs->trans("SortOrder"), $texthelp); +} +print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'defaultvalue', '', $param, '', $sortfield, $sortorder); +if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder); +print ''; +print "\n"; + + +// Line to add new record +print "\n"; + +print ''; +print ''."\n"; +print ''; +print ''; +// Limit to superadmin +if (! empty($conf->multicompany->enabled) && !$user->entity) +{ + print ''; + print '\n"; +print ''; + + +// Show constants +$sql = "SELECT rowid, entity, type, page, param, value"; +$sql.= " FROM ".MAIN_DB_PREFIX."default_values"; +$sql.= " WHERE type = '".$db->escape($mode)."'"; +$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; +$sql.= $db->order($sortfield, $sortorder); + +dol_syslog("translation::select from table", LOG_DEBUG); +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($result); + + + print "\n"; + + print ''; + + print ''."\n"; + print ''."\n"; + + // Value + print ''; + + print ''; + + print "\n"; + print "\n"; + $i++; + } +} +else +{ + dol_print_error($db); +} + + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + print ''; + print ''; +} +else +{ + print ''; + print ''; +} +print ''; +print "
'.$obj->page.''.$obj->param.''; + /*print ''; + print ''; + print ''; + print ''; + */ + print $obj->value; + print ''; + print ''.img_delete().''; + print '
'; + +dol_fiche_end(); + +print "\n"; + + +llxFooter(); + +$db->close(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 597327c04ba..0280673906b 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -173,9 +173,9 @@ if ($action == 'edit') { foreach($delays as $delay) { - $var=!$var; + $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); - print '
'.img_object('',$delay['img']).''.$langs->trans('Delays_'.$delay['code']).''; print ' '.$langs->trans("days").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '
'; @@ -220,9 +220,9 @@ else { foreach($delays as $delay) { - $var=!$var; + $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); - print '
'.img_object('',$delay['img']).''.$langs->trans('Delays_'.$delay['code']).''.$value.' '.$langs->trans("days").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7392ca23905..95692672523 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -78,6 +78,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $search_country_id = GETPOST('search_country_id','int'); +$search_code = GETPOST('search_code','alpha'); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('admin')); @@ -569,6 +570,7 @@ if ($id == 10) if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) { $search_country_id = ''; + $search_code = ''; } // Actions add or modify an entry into a dictionary @@ -803,7 +805,7 @@ if ($action == $acts[0]) $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -823,7 +825,7 @@ if ($action == $acts[1]) $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -843,7 +845,7 @@ if ($action == 'activate_favorite') $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -863,7 +865,7 @@ if ($action == 'disable_favorite') $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -915,7 +917,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.urlencode($_GET["code"]).'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -927,12 +929,9 @@ if ($id) // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - if ($search_country_id > 0) - { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; - else $sql.=" WHERE "; - $sql.= " c.rowid = ".$search_country_id; - } + if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1"; + if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; + if ($search_code != '') $sql.= natural_search("code", $search_code); if ($sortfield) { @@ -961,16 +960,15 @@ if ($id) print ''; print ''; - print ''; - // Form to add a new line if ($tabname[$id]) { $alabelisused=0; - $var=false; - + $fieldlist=explode(',',$tabfield[$id]); + print '
'; + // Line for title print ''; foreach ($fieldlist as $field => $value) @@ -979,38 +977,40 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class=''; if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='taux') { if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate"); else $valuetoshow=$langs->trans("Amount"); - $align='center'; + $class='center'; } - if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; } - if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $align="center"; } - if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; } - if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $align="center"; } + if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $class="center"; $sortable=0; } + if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $class="center"; } + if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $class="center"; $sortable=0; } + if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $class="center"; } if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); else $valuetoshow=$langs->trans("Type"); } - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } + if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); $class='width100'; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$langs->trans("Label"); - if ($id != 25) $valuetoshow.="*"; + if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + else $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='libelle_facture') { + $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } if ($fieldlist[$field]=='country') { if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } + if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $class="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } - if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; } + if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $class="center"; } if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); } if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); } if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); } @@ -1051,7 +1051,7 @@ if ($id) if ($valuetoshow != '') { - print ''; // Line to enter new values - print ""; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -1087,7 +1087,7 @@ if ($id) $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if ($id == 3) unset($fieldlist[2]); // Remove field ??? if ??? + if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionnary Regions if (empty($reshook)) { @@ -1106,15 +1106,22 @@ if ($id) $colspan=count($fieldlist)+3; if ($id == 4) $colspan++; - if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of * + print '
 '; + print ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); else print $valuetoshow; @@ -1069,7 +1069,7 @@ if ($id) print '
'; + + /*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of * { - print '* '.$langs->trans("LabelUsedByDefault").'.'; - } - print ' '; // Keep   to have a line with enough height + print '* '.$langs->trans("LabelUsedByDefault").'.
'; + }*/ } + print ''; - + print '
'; + + print '
'; + print ''; + print ''; + // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); $resql=$db->query($sql); @@ -1122,10 +1129,10 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; + if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; @@ -1134,13 +1141,56 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); - print ''; } + print ''; + + // Title line with search boxes + print ''; + $filterfound=0; + foreach ($fieldlist as $field => $value) + { + $showfield=1; // By defaut + + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } + + if ($showfield) + { + if ($value == 'country') + { + print ''; + $filterfound++; + } + elseif ($value == 'code') + { + print ''; + $filterfound++; + } + else + { + print ''; + } + } + } + if ($id == 4) print ''; + print ''; + print ''; + print ''; + // Title of lines - print ''; + print ''; foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles @@ -1175,10 +1225,14 @@ if ($id) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$langs->trans("Label"); - if ($id != 25) $valuetoshow.="*"; + //if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + //else $valuetoshow=$langs->trans("Label"); + $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='libelle_facture') { + //$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$langs->trans("LabelOnDocuments"); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } @@ -1229,51 +1283,14 @@ if ($id) print getTitleFieldOfList(''); print ''; - // Title line with search boxes - print ''; - $filterfound=0; - foreach ($fieldlist as $field => $value) - { - $showfield=1; // By defaut - - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - - if ($showfield) - { - if ($value == 'country') - { - print ''; - $filterfound++; - } - else - { - print ''; - } - } - } - if ($id == 4) print ''; - print ''; - print ''; - print ''; - if ($num) { // Lines with values while ($i < $num) { - $var = ! $var; - $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -1295,7 +1312,7 @@ if ($id) else { $tmpaction = 'view'; - $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -1304,7 +1321,6 @@ if ($id) { foreach ($fieldlist as $field => $value) { - $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; @@ -1472,7 +1488,8 @@ if ($id) $class='tddict'; if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto'; - // Show value for field + if ($fieldlist[$field] == 'code') $class.=' width100'; + // Show value for field if ($showfield) print ''; } } @@ -1491,8 +1508,11 @@ if ($id) $canbemodified=$iserasable; if ($obj->code == 'RECEP') $canbemodified=1; + // Url $rowidcol=$tabrowid[$id]; - $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->{$rowidcol})?$obj->{$rowidcol}:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); + // If rowidcol not defined + if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; $url.='&'; @@ -1537,12 +1557,13 @@ if ($id) $i++; } } + + print '
'; + print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); + print ''; + print ''; + print ''; + print ''; + if ($filterfound) + { + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + } + print '
'; - print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); - print ''; - if ($filterfound) - { - $searchpitco=$form->showFilterAndCheckAddButtons(0); - print $searchpitco; - } - print '
'.$valuetoshow.'
'; } else { dol_print_error($db); } - print ''; print '
'; } @@ -1552,7 +1573,6 @@ else * Show list of dictionary to show */ - $var=true; $lastlineisempty=false; print ''; print ''; @@ -1570,14 +1590,14 @@ else { if ($showemptyline) { - $var=!$var; - print ''; + + print ''; $showemptyline=0; } - $var=!$var; + $value=$tabname[$i]; - print ''; } @@ -1725,13 +1745,29 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; } elseif (in_array($fieldlist[$field], array('libelle_facture'))) { - print ''; + print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { - print ''; + print ''; } elseif ($fieldlist[$field]=='unit') { print ''; } } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 41824fea4c6..7b7357ee9eb 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -84,8 +84,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print ''; + +print ''; print ''; print ''; diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 892e0860cbd..161b1aac45d 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -99,8 +99,8 @@ foreach ($eventstolog as $key => $arr) { if ($arr['id']) { - $var=!$var; - print ''; + + print ''; print ''; print ''; @@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir) if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; $var=true; $var=! $var; -print ''."\n"; //Use draft Watermark -$var=!$var; -print ''."\n"; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 8e550f98c99..7f81a5d0fef 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -266,20 +266,20 @@ if ($resql) print ''; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; + + print ''; print ""; print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ""; print ""; -$var=!$var; -print ''; + +print ''; print ""; print "\n"; print ''; -$var=!$var; + print ''; print ''; print ''; -print ''; print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 23ff67f92e7..9f1d3913630 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -159,8 +159,8 @@ else // Si condition non remplie, on ne propose pas l'option if (! $conditions[$const]) continue; - $var=!$var; - print ""; + + print ''; print ''; print ''; print ''; @@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir) { if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -447,7 +447,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; print ''; //Use draft Watermark -$var=!$var; + print ""; print ''; print ""; -print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''; print "\n"; // Synchro utilisateurs/groupes active -$var=!$var; -print ''; // Synchro contact active if (! empty($conf->societe->enabled)) { - $var=!$var; - print ''; print "\n"; // Type -$var=!$var; -print ''; // Version -$var=!$var; -print ''; // Serveur primaire -$var=!$var; -print ''; // Serveur secondaire -$var=!$var; -print ''; // Port -$var=!$var; -print ''; // DNserver -$var=!$var; -print ''; // Utiliser TLS -$var=!$var; -print ''; print "\n"; // DNAdmin -$var=!$var; -print ''; // Pass -$var=!$var; -print '\n"; // DN Pour les contacts -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; @@ -152,112 +152,112 @@ print ''; print "\n"; // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print '"; print ''; // Company -$var=!$var; -print ''; print '"; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone pro -$var=!$var; -print ''; print '"; print ''; // Phone home -$var=!$var; -print ''; print '"; print ''; // Mobile -$var=!$var; -print ''; print '"; print ''; // Skype -$var=!$var; -print ''; print '"; print ''; // Fax -$var=!$var; -print ''; print '"; print ''; // Address -$var=!$var; -print ''; print '"; print ''; // ZIP -$var=!$var; -print ''; print '"; print ''; // TOWN -$var=!$var; -print ''; print '"; print ''; // COUNTRY -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 90946f5ea44..192b11bfd8d 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -116,16 +116,16 @@ print ''; print "\n"; // DN pour les groupes -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; @@ -145,16 +145,16 @@ print "\n"; // Filtre // Common name -$var=!$var; -print ''; print '"; print ''; // Name -/*$var=!$var; -print ''; print '"; @@ -162,16 +162,16 @@ print ''; */ // Description -$var=!$var; -print ''; print '"; print ''; // User group -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 52117961b54..8c7291c3dc4 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -142,24 +142,24 @@ print ''; print "\n"; // DN Pour les adherents -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; print ''; // Filter, used to filter search -$var=!$var; -print ''; print ''; @@ -179,208 +179,208 @@ print "\n"; // Filtre // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print ''; print ''; // Login unix -$var=!$var; -print ''; print '"; print ''; // Login samba -$var=!$var; -print ''; print '"; print ''; // Password not crypted -$var=!$var; -print ''; print ''; print ''; // Password crypted -$var=!$var; -print ''; print ''; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone pro -$var=!$var; -print ''; print ''; print ''; // Phone perso -$var=!$var; -print ''; print ''; print ''; // Mobile -$var=!$var; -print ''; print ''; print ''; // Skype -$var=!$var; -print ''; print ''; print ''; // Fax -$var=!$var; -print ''; print ''; print ''; // Address -$var=!$var; -print ''; print ''; print ''; // ZIP -$var=!$var; -print ''; print ''; print ''; // TOWN -$var=!$var; -print ''; print ''; print ''; // COUNTRY -$var=!$var; -print ''; print ''; print ''; // Description -$var=!$var; -print ''; print ''; print ''; // Public Note -$var=!$var; -print ''; print ''; print ''; // Birthday -$var=!$var; -print ''; print ''; print ''; // Status -$var=!$var; -print ''; print ''; print ''; // First subscription date -$var=!$var; -print ''; print ''; print ''; // First subscription amount -$var=!$var; -print ''; print ''; print ''; // Last subscription date -$var=!$var; -print ''; print ''; print ''; // Last subscription amount -$var=!$var; -print ''; print ''; print ''; // End last subscriptions -$var=!$var; -print ''; print ''; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 45043b8a52b..79f34001a63 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -129,24 +129,24 @@ print ''; print "\n"; // DN Pour les utilisateurs -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; print ''; // Filter, used to filter search -$var=!$var; -print ''; print ''; @@ -164,120 +164,120 @@ print ''; print "\n"; // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print '"; print ''; // Login unix -$var=!$var; -print ''; print '"; print ''; // Login samba -$var=!$var; -print ''; print '"; print ''; // Password not crypted -$var=!$var; -print ''; print '"; print ''; // Password crypted -$var=!$var; -print ''; print '"; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone -$var=!$var; -print ''; print '"; print ''; // Mobile -$var=!$var; -print ''; print '"; print ''; // Skype -$var=!$var; -print ''; print '"; print ''; // Fax -$var=!$var; -print ''; print '"; print ''; // Title -$var=!$var; -print ''; print '"; print ''; // Note -$var=!$var; -print ''; print '"; print ''; // Sid -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 3806258d246..1d4b5cee8d4 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -106,21 +106,21 @@ if ($action == 'edit') print '
   
   
'; + print '
'; if (! empty($tabcond[$i])) { print ''.$langs->trans($tablib[$i]).''; @@ -1657,7 +1677,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); - print ''; + print ''; print ''; print ''; + $transfound=0; + // Special case for labels + if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { + $langs->load("bills"); + $transkey="PaymentCondition".strtoupper($obj->code); + } + if ($langs->trans($transkey) != $transkey) + { + $transfound=1; + print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); + } + if (! $transfound) + { + print ''; + } + print ''; @@ -1769,16 +1805,36 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } else { - print ''; - $size=''; $class=''; - if ($fieldlist[$field]=='code') $class='maxwidth100'; + $classtd=''; $class=''; + if ($fieldlist[$field]=='code') $classtd='width100'; if ($fieldlist[$field]=='affect') $class='maxwidth50'; if ($fieldlist[$field]=='delay') $class='maxwidth50'; if ($fieldlist[$field]=='position') $class='maxwidth50'; if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent'; if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; - print ''; + if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $class='maxwidth50'; + print ''; + $transfound=0; + if (in_array($fieldlist[$field], array('label','libelle'))) + { + // Special case for labels + if ($tabname == MAIN_DB_PREFIX.'c_civility') { + $transkey="Civility".strtoupper($obj->code); + } + if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { + $langs->load("bills"); + $transkey="PaymentCondition".strtoupper($obj->code); + } + if ($langs->trans($transkey) != $transkey) + { + $transfound=1; + print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); + } + } + if (! $transfound) + { + print ''; + } print '
'.$langs->trans("ECMAutoTree").' 
'.$arr['id'].''; $key='MAIN_LOGEVENTS_'.$arr['id']; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index a26a21fbede..eda3c6bd6ae 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -275,8 +275,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -506,7 +506,7 @@ print "
'; +print '
'; print $langs->trans("FreeLegalTextOnExpenseReports").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='EXPENSEREPORT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -522,8 +522,8 @@ else print '
'; + +print '
'; print $langs->trans("WatermarkOnDraftOrders").'
'; print ''; print '
".$langs->trans("Title")."
".$langs->trans("URL")."
".$langs->trans("Status").""; if ($result > 0 && empty($rss->error)) @@ -299,8 +299,8 @@ if ($resql) // Logo if ($result > 0 && empty($rss->error)) { - $var=!$var; - print "
".$langs->trans("Logo")."'; $imageurl=$rssparser->getImageUrl(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 42000e7176d..4e9b007ee14 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -339,7 +339,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print '
'; + print '
'; echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -530,7 +530,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -628,8 +628,8 @@ print ''; print $langs->trans("PaymentMode").'
".$langs->trans("SuggestPaymentByRIBOnAccount").""; if (! empty($conf->banque->enabled)) @@ -638,7 +638,7 @@ if (! empty($conf->banque->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; - $sql.= " AND entity IN (".getEntity('bank', 1).")"; + $sql.= " AND entity IN (".getEntity('bank_account', 1).")"; $resql=$db->query($sql); if ($resql) { @@ -671,8 +671,8 @@ else print $langs->trans("BankModuleNotActive"); } print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; print ''; print ''; -print '
'; +print '
'; print $langs->trans("ForceInvoiceDate"); print ''; print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1); @@ -737,7 +737,7 @@ $var=! $var; print '
'; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='INVOICE_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -755,11 +755,11 @@ print '
'; +print '
'; print $langs->trans("WatermarkOnDraftBill").''; print ''; @@ -800,7 +800,7 @@ print ' 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'.img_object("",$picto[$const]).''.$langs->trans($desc).''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 8d31db0d3af..6c73afcf8f5 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -310,8 +310,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -538,7 +538,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnInterventions").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='FICHINTER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -557,11 +557,11 @@ print "
'; +print '
'; print $langs->trans("WatermarkOnDraftInterventionCards").''; print ''; print ''; @@ -573,7 +573,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')global->FICHINTER_PRINT_PRODUCTS) diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index b4d379e15d1..5a69a356777 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -105,8 +105,8 @@ print ''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").''; if ($geointernal) print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).'
'; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 95917a79ab5..193ee35a80f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -26,6 +26,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; @@ -70,6 +72,26 @@ if (GETPOST('cancel')) $action=''; } +if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; + dol_delete_file($logofile); + dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity); + $mysoc->logo=''; + + /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; + dol_delete_file($logosmallfile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); + $mysoc->logo_small=''; + + $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; + dol_delete_file($logominifile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); + $mysoc->logo_mini='';*/ +} + if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity); @@ -97,7 +119,7 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity); - if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity); + if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); @@ -120,9 +142,78 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); - // This one is not always defined - if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity); - + $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; + if ($_FILES[$varforimage]["tmp_name"]) + { + if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) + { + $original_file=$reg[1]; + + $isimage=image_format_supported($original_file); + if ($isimage >= 0) + { + dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); + if (! is_dir($dirforimage)) + { + dol_mkdir($dirforimage); + } + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); + if ($result > 0) + { + dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity); + + // Create thumbs of logo (Note that PDF use original file and not thumbs) + /* + if ($isimage > 0) + { + // Create thumbs + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + + // Create small thumb, Used on logon for example + $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + { + $imgThumbSmall = $reg[1]; // Save only basename + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbSmall); + + // Create mini thumb, Used on menu or for setup page for example + $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); + if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + { + $imgThumbMini = $reg[1]; // Save only basename + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + } + else dol_syslog($imgThumbMini); + } + else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); + */ + } + else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + { + $error++; + $langs->load("errors"); + $tmparray=explode(':',$result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); + } + else + { + $error++; + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); + } + } + else + { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); + } + } + } + + + $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -152,7 +243,7 @@ if ($action == 'edit') // Edit //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - print ''; + print ''; print ''; print ''; @@ -160,19 +251,19 @@ if ($action == 'edit') // Edit print '
'; print ''; - print ''; + print ''; print ''; print ''; // Default language - print ''; print ''; print ''; // Multilingual GUI - print ''; print ''; @@ -188,10 +279,10 @@ if ($action == 'edit') // Edit if (! empty($searchform)) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Language").' 
'.$langs->trans("DefaultLanguage").''; + print '
'.$langs->trans("DefaultLanguage").''; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300'); print ' 
'.$langs->trans("EnableMultilangInterface").''; + print '
'.$langs->trans("EnableMultilangInterface").''; print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1); print ' 
'; - print ''; + print ''; foreach ($searchform as $key => $value) { - print ''; } @@ -201,7 +292,7 @@ if ($action == 'edit') // Edit // Other print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; + print '
'.$searchformtitle[$key].''; print $form->selectyesno($searchform[$key],$searchformconst[$key],1); print '
'; - print ''; + print ''; print ''; print ''; @@ -215,46 +306,45 @@ if ($action == 'edit') // Edit print ''; print ''; - // Disable javascript and ajax - print ''; + print ''; + print ''; + */ + + // Disable javascript and ajax + print ''; print ''; print ''; - // Activate preview tab on element card - if (class_exists("Imagick")) - { - print ''; - print ''; - print ''; - } - // First day for weeks - print ''; print ''; print ''; // DefaultWorkingDays - print ''; print ''; print ''; // DefaultWorkingHours - print ''; print ''; print ''; // Firstname/Name - print ''; @@ -262,14 +352,14 @@ if ($action == 'edit') // Edit print ''; // Hide unauthorized button - print ''; print ''; print ''; // Show logo - print ''; print ''; @@ -278,7 +368,7 @@ if ($action == 'edit') // Edit // Hide version link /* - print ''; print ''; @@ -286,36 +376,28 @@ if ($action == 'edit') // Edit */ // Show bugtrack link - print ''; print ''; print ''; // Hide wiki link on login page - print ''; print ''; print ''; // Hide helpcenter link on login page - print ''; print ''; print ''; - // Message on login page - print ''."\n"; - // Message of the day on home page - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
 
'.$langs->trans("DisableJavascript").''; + // show input border + /* + print '
'.$langs->trans("showInputBorder").''; + print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1); + print ' 
'.$langs->trans("DisableJavascript").''; print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1); print ' 
'.$langs->trans("UsePreviewTabs").''; - print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1); - print ' 
'.$langs->trans("WeekStartOnDay").''; + print '
'.$langs->trans("WeekStartOnDay").''; print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0); print ' 
'.$langs->trans("DefaultWorkingDays").''; + print '
'.$langs->trans("DefaultWorkingDays").''; print ''; print ' 
'.$langs->trans("DefaultWorkingHours").''; + print '
'.$langs->trans("DefaultWorkingHours").''; print ''; print ' 
'.$langs->trans("FirstnameNamePosition").''; + print '
'.$langs->trans("FirstnameNamePosition").''; $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname")); print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0)); print '
'.$langs->trans("ButtonHideUnauthorized").''; + print '
'.$langs->trans("ButtonHideUnauthorized").''; print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1); print ' 
'.$langs->trans("EnableShowLogo").''; + print '
'.$langs->trans("EnableShowLogo").''; print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1); print ' 
'.$langs->trans("HideVersionLink").''; + print '
'.$langs->trans("HideVersionLink").''; print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1); print ' 
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; + print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); print ' 
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).''; + print '
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).''; print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1); print ' 
'.$langs->trans("DisableLinkToHelpCenter").''; + print '
'.$langs->trans("DisableLinkToHelpCenter").''; print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); print ' 
'.$langs->trans("MessageLogin").''; - - $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); - $doleditor->Create(); - - print '
'.$langs->trans("MessageOfDay").''; + print '
'.$langs->trans("MessageOfDay").''; $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); $doleditor->Create(); @@ -324,6 +406,39 @@ if ($action == 'edit') // Edit print '
'."\n"; + print '
'; + + // Other + print ''; + print ''; + print ''; + print ''; + + // Message on login page + print ''."\n"; + + // Background + + print ''; + + print '
'.$langs->trans("LoginPage").' 
'.$langs->trans("MessageLogin").''; + $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); + $doleditor->Create(); + print '
'; + print '
'; + print ''; + if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) { + print '   '; + print ''; + } + } else { + print ''; + } + print '
'; + print '
'."\n"; + print '
'; print ''; @@ -337,9 +452,9 @@ else // Show { // Language print ''; - print ''; + print ''; - print ''; print ""; - print ''; + print ''; print ''; print ""; @@ -365,11 +480,11 @@ else // Show if (! empty($searchform)) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("Language").' 
'.$langs->trans("DefaultLanguage").''; + print '
'.$langs->trans("DefaultLanguage").''; $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print ($s?$s.' ':''); print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); @@ -349,7 +464,7 @@ else // Show print '
'.$langs->trans("EnableMultilangInterface").'' . yn($conf->global->MAIN_MULTILANGS) . '
'.$langs->trans("EnableMultilangInterface").'' . yn($conf->global->MAIN_MULTILANGS) . ' 
'; - print ''; + print ''; foreach ($searchform as $key => $value) { - print ''; + print ''; print ''; @@ -380,56 +495,52 @@ else // Show // Other print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).'
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''; if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); print '
'; - print ''; + print ''; - print ''; + print ''; print ''; print ""; - print ''; + print ''; print ''; print ""; + /* + print '"; + print ''; + print ""; + */ + // Disable javascript/ajax - - print '"; - print ''; - print ""; - - // Activate preview tab on element card - if (class_exists("Imagick")) - { - - print '"; - print ''; - print ""; - } + print ''; + print ""; // First day for weeks - print ''; print ''; print ''; // DefaultWorkingDays - print ''; print ''; print ''; // DefaultWorkingHours - print ''; print ''; print ''; // Firstname / Name position - print ''; @@ -437,18 +548,18 @@ else // Show print ''; // Hide unauthorized button - print ''; // Show logo - print ''; + print ''; print ''; print ""; // Hide version link /* - print ''; print ''; @@ -456,35 +567,59 @@ else // Show */ // Show bugtrack link - print '"; print ''; print ""; // Link to wiki help - print ''; // Link to help center - print ''; - // Message login - print ''."\n"; - // Message of the day - print ''."\n"; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . ' 
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . ' 
'.$langs->trans("showInputBorder").''; + print yn($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)." 
'.$langs->trans("DisableJavascript").''; + print '
'.$langs->trans("DisableJavascript").''; print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)." 
'.$langs->trans("UsePreviewTabs").''; - print yn(isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0)." 
 
'.$langs->trans("WeekStartOnDay").''; + print '
'.$langs->trans("WeekStartOnDay").''; print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1')); print ' 
'.$langs->trans("DefaultWorkingDays").''; + print '
'.$langs->trans("DefaultWorkingDays").''; print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5'; print ' 
'.$langs->trans("DefaultWorkingHours").''; + print '
'.$langs->trans("DefaultWorkingHours").''; print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18'; print ' 
'.$langs->trans("FirstnameNamePosition").''; + print '
'.$langs->trans("FirstnameNamePosition").''; if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); } else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); } print '
'.$langs->trans("ButtonHideUnauthorized").''; + print '
'.$langs->trans("ButtonHideUnauthorized").''; print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1); print '
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . '
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . ' 
'.$langs->trans("HideVersionLink").''; + print '
'.$langs->trans("HideVersionLink").''; print yn($conf->global->MAIN_HIDE_VERSION); print ' '.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; + print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)." 
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).''; + print '
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).''; print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); print '
'.$langs->trans("DisableLinkToHelpCenter").''; + print '
'.$langs->trans("DisableLinkToHelpCenter").''; print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); print '
'.$langs->trans("MessageLogin").''; - if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME); - else print ' '; - print '
'.$langs->trans("MessageOfDay").''; + print '
'.$langs->trans("MessageOfDay").''; if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD); else print ' '; print '
'."\n"; + print '
'; + + // Login page + print ''; + print ''; + + // Message login + print ''."\n"; + + // Background login + + print ''; + + print '
'.$langs->trans("LoginPage").' 
'.$langs->trans("MessageLogin").''; + if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME); + else print ' '; + print '
'.$langs->trans("BackgroundImageLogin").''; + print '
'; + print $conf->global->MAIN_LOGIN_BACKGROUND; + if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) + { + print ''; + } + else + { + print ''; + } + print '
'; + print '
'."\n"; + print '
'; print ''.$langs->trans("Modify").''; print '
'; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 5c1b0fcad11..770d91d1d11 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -110,8 +110,8 @@ print '
'.$langs->trans("LDAPSynchronization").'
'.$langs->trans("LDAPDnSynchroActive").''; + +print '
'.$langs->trans("LDAPDnSynchroActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr"); @@ -127,8 +127,8 @@ print '
'.$langs->trans("LDAPDnContactActive").''; + + print '
'.$langs->trans("LDAPDnContactActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); @@ -139,8 +139,8 @@ if (! empty($conf->societe->enabled)) // Synchro member active if (! empty($conf->adherent->enabled)) { - $var=!$var; - print '
'.$langs->trans("LDAPDnMemberActive").''; + + print '
'.$langs->trans("LDAPDnMemberActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); @@ -156,8 +156,8 @@ print ''.$langs->trans("Example").'
'.$langs->trans("Type").''; + +print '
'.$langs->trans("Type").''; $arraylist=array(); $arraylist['activedirectory']='Active Directory'; $arraylist['openldap']='OpenLdap'; @@ -166,8 +166,8 @@ print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE); print ' 
'.$langs->trans("Version").''; + +print '
'.$langs->trans("Version").''; $arraylist=array(); $arraylist['3']='Version 3'; $arraylist['2']='Version 2'; @@ -175,22 +175,22 @@ print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global- print ''.$langs->trans("LDAPServerProtocolVersion").'
'; + +print '
'; print $langs->trans("LDAPPrimaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'; + +print '
'; print $langs->trans("LDAPSecondaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'.$langs->trans("LDAPServerPort").''; + +print '
'.$langs->trans("LDAPServerPort").''; if (! empty($conf->global->LDAP_SERVER_PORT)) { print ''; @@ -202,14 +202,14 @@ else print ''.$langs->trans("LDAPServerPortExample").'
'.$langs->trans("LDAPServerDn").''; + +print '
'.$langs->trans("LDAPServerDn").''; print ''; print ''.$langs->trans("LDAPServerDnExample").'
'.$langs->trans("LDAPServerUseTLS").''; + +print '
'.$langs->trans("LDAPServerUseTLS").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("Yes"); @@ -221,14 +221,14 @@ print ''.$langs->trans("ForANonAnonymousAccess").'
'.$langs->trans("LDAPAdminDn").''; + +print '
'.$langs->trans("LDAPAdminDn").''; print ''; print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; + +print '
'.$langs->trans("LDAPPassword").''; if (! empty($conf->global->LDAP_ADMIN_PASS)) { print '';// je le met en visible pour test diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 4901c127e8b..27e32f8cd7c 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -125,16 +125,16 @@ print "
'.$langs->trans("LDAPContactDn").''; + +print '
'.$langs->trans("LDAPContactDn").''; print ''; print ''.$langs->trans("LDAPContactDnExample").' 
'.$langs->trans("LDAPContactObjectClassList").''; + +print '
'.$langs->trans("LDAPContactObjectClassList").''; print ''; print ''.$langs->trans("LDAPContactObjectClassListExample").' '.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked':'').">
'.$langs->trans("LDAPFieldCompany").''; + +print '
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked':'').">
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked':'').">
'.$langs->trans("LDAPFieldHomePhone").''; + +print '
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked':'').">
'.$langs->trans("LDAPFieldAddress").''; + +print '
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked':'').">
'.$langs->trans("LDAPFieldZip").''; + +print '
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked':'').">
'.$langs->trans("LDAPFieldTown").''; + +print '
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked':'').">
'.$langs->trans("LDAPFieldCountry").''; + +print '
'.$langs->trans("LDAPFieldCountry").''; print ''; print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'').">'.$langs->trans("LDAPSynchronizeGroups").'
'.$langs->trans("LDAPGroupDn").''; + +print '
'.$langs->trans("LDAPGroupDn").''; print ''; print ''.$langs->trans("LDAPGroupDnExample").' 
'.$langs->trans("LDAPGroupObjectClassList").''; + +print '
'.$langs->trans("LDAPGroupObjectClassList").''; print ''; print ''.$langs->trans("LDAPGroupObjectClassListExample").' 
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; +/* +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldDescription").''; + +print '
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldGroupMembers").''; + +print '
'.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'').">'.$langs->trans("LDAPSynchronizeMembers").'
'.$langs->trans("LDAPMemberDn").''; + +print '
'.$langs->trans("LDAPMemberDn").''; print ''; print ''.$langs->trans("LDAPMemberDnExample").' 
'.$langs->trans("LDAPMemberObjectClassList").''; + +print '
'.$langs->trans("LDAPMemberObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; + +print '
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").' 
'.$langs->trans("LDAPFieldLoginUnix").''; + +print '
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; + +print '
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldPasswordCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").' 
'.$langs->trans("LDAPFieldHomePhone").''; + +print '
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").' 
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").' 
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").' 
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").' 
'.$langs->trans("LDAPFieldAddress").''; + +print '
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").' 
'.$langs->trans("LDAPFieldZip").''; + +print '
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").' 
'.$langs->trans("LDAPFieldTown").''; + +print '
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").' 
'.$langs->trans("LDAPFieldCountry").''; + +print '
'.$langs->trans("LDAPFieldCountry").''; print ''; print '  
'.$langs->trans("LDAPFieldDescription").''; + +print '
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").' 
'.$langs->trans("LDAPFieldNotePublic").''; + +print '
'.$langs->trans("LDAPFieldNotePublic").''; print ''; print ''.$langs->trans("LDAPFieldNotePublicExample").' 
'.$langs->trans("LDAPFieldBirthdate").''; + +print '
'.$langs->trans("LDAPFieldBirthdate").''; print ''; print '  
'.$langs->trans("LDAPFieldStatus").''; + +print '
'.$langs->trans("LDAPFieldStatus").''; print ''; print '  
'.$langs->trans("LDAPFieldFirstSubscriptionDate").''; + +print '
'.$langs->trans("LDAPFieldFirstSubscriptionDate").''; print ''; print '  
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; + +print '
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; + +print '
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; + +print '
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldEndLastSubscription").''; + +print '
'.$langs->trans("LDAPFieldEndLastSubscription").''; print ''; print '  '.$langs->trans("LDAPSynchronizeUsers").'
'.$langs->trans("LDAPUserDn").''; + +print '
'.$langs->trans("LDAPUserDn").''; print ''; print ''.$langs->trans("LDAPUserDnExample").' 
'.$langs->trans("LDAPUserObjectClassList").''; + +print '
'.$langs->trans("LDAPUserObjectClassList").''; print ''; print ''.$langs->trans("LDAPUserObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; + +print '
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'').">
'.$langs->trans("LDAPFieldLoginUnix").''; + +print '
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; + +print '
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD_CRYPTED)?' checked':'').">
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'').">
'.$langs->trans("LDAPFieldTitle").''; + +print '
'.$langs->trans("LDAPFieldTitle").''; print ''; print ''.$langs->trans("LDAPFieldTitleExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_TITLE)?' checked':'').">
'.$langs->trans("Note").''; + +print '
'.$langs->trans("Note").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldSid").''; + +print '
'.$langs->trans("LDAPFieldSid").''; print ''; print ''.$langs->trans("LDAPFieldSidExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'').">
'; print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; @@ -140,21 +140,21 @@ else print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index e49f25d7ef8..281f1934296 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -258,8 +258,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print ''; @@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir) { if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 541c8aa1b2d..972b7ee73a6 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -113,30 +113,30 @@ print ''; print ''; print "\n"; -$var=!$var; -print ''; -$var=!$var; -print ''; -$var=!$var; -print ''; // Constant to add salt into the unsubscribe and check read tag. // It is also used as a security key parameter. -$var=!$var; -print ''; // Disable - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // Host server - $var=!$var; - print ''; // Port - $var=!$var; - print ''; // STARTTLS - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Default from type - $var=!$var; + $liste = array(); $liste['user'] = $langs->trans('UserEmail'); $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')'; @@ -424,18 +424,18 @@ if ($action == 'edit') print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - $var=!$var; - print ''; + + print ''; print ''; @@ -465,60 +465,60 @@ else print ''; // Disable - $var=!$var; - print ''; + + print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // Host server - $var=!$var; + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print ''; + print ''; } else { - print ''; + print ''; } // Port - $var=!$var; + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print ''; + print ''; } else { - print ''; + print ''; } // SMTPS ID - $var=!$var; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // SMTPS PW - $var=!$var; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS - $var=!$var; - print ''; // STARTTLS - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Default from type - $var=!$var; + print ''; print ''; // Separator - $var=!$var; - print ''; + + print ''; // Errors To - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - $var=!$var; - print ''; + + print ''; print ''; // Menu top - $var=!$var; - print ''; + + print ''; print ''; @@ -190,8 +190,8 @@ if ($action == 'edit') print ''; // Menu smartphone - $var=!$var; - print ''; + + print ''; print ''; @@ -217,8 +217,8 @@ else print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; // Hide unauthorized menu -$var=!$var; -print ""; + +print ''; print ''; print '\n"; - print ''."\n"; - print "\n"; - $atleastoneforfamily=0; + print_fiche_titre($familytext, '', ''); + + print '
'; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.'
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -483,7 +483,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnDeliveryReceipts").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='DELIVERY_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 3213503835d..ee6b9ef74ee 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -96,7 +96,7 @@ print "
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("MailingEMailFrom").''; print ''; if (!empty($conf->global->MAILING_EMAIL_FROM) && ! isValidEmail($conf->global->MAILING_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; + +print '
'; print $langs->trans("MailingEMailError").''; print ''; if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; + +print '
'; print $langs->trans("MailingDelay").''; print ''; print '
'; + +print '
'; print $langs->trans("ActivateCheckReadKey").''; print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 6c01935ec39..219cd85c2fe 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -241,18 +241,18 @@ if ($action == 'edit') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; + + print '
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); print '
 
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) @@ -270,8 +270,8 @@ if ($action == 'edit') print '
'; + + print '
'; if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -303,8 +303,8 @@ if ($action == 'edit') print '
'; + + print '
'; if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -338,7 +338,7 @@ if ($action == 'edit') // ID if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { - $var=!$var; + $mainstmpid=(! empty($conf->global->MAIN_MAIL_SMTPS_ID)?$conf->global->MAIN_MAIL_SMTPS_ID:''); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only @@ -358,7 +358,7 @@ if ($action == 'edit') // PW if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { - $var=!$var; + $mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW)?$conf->global->MAIN_MAIL_SMTPS_PW:''); print '
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -376,8 +376,8 @@ if ($action == 'edit') } // TLS - $var=!$var; - print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) @@ -390,8 +390,8 @@ if ($action == 'edit') print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) @@ -404,17 +404,17 @@ if ($action == 'edit') print '
 
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
 
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
 
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").img_warning(); print $text; print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) @@ -531,8 +531,8 @@ else print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) @@ -545,18 +545,18 @@ else print '
 
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; if($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user'){ @@ -567,19 +567,19 @@ else print '
 
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_ERRORS_TO").''.$conf->global->MAIN_MAIL_ERRORS_TO; if (! empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index f8b89c515aa..ddfb4d0cd62 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -155,7 +155,7 @@ print ''; print ''; print ''; -dol_fiche_head($head, 'handler', $langs->trans("Menus")); +dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); print $langs->trans("MenusDesc")."
\n"; print "
\n"; @@ -179,8 +179,8 @@ if ($action == 'edit') print '
'.$langs->trans("DefaultMenuManager").'
'.$langs->trans("DefaultMenuManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled'); print '
'.$langs->trans("DefaultMenuSmartphoneManager").'
'.$langs->trans("DefaultMenuSmartphoneManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); print '
'.$langs->trans("DefaultMenuManager").'
'.$langs->trans("DefaultMenuManager").''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); print $filelib; @@ -229,8 +229,8 @@ else print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index acfa9d2dccd..ed5f56954c0 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -234,7 +234,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'editor', $langs->trans("Menus")); +dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); print $langs->trans("MenusEditorDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 471edf58e79..82457a27bdf 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -77,7 +77,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'misc', $langs->trans("Menus")); +dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); // Other Options @@ -90,8 +90,8 @@ print '
'.$langs->trans("Status").'
'.$langs->trans("HideUnauthorizedMenu").''; if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 5b428443248..94bfa8e05bb 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -1,12 +1,5 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2017 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud +/* Copyright (C) 2017 Laurent Destailleur * * 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 @@ -292,7 +285,7 @@ if (isset($objMod->langfiles) && is_array($objMod->langfiles)) } } -$var=!$var; + // Version (with picto warning or not) @@ -343,6 +336,15 @@ if ($mode == 'desc') if ($mode == 'feature') { + $text.='
'.$langs->trans("DependsOn").': '; + if (count($objMod->requiredby)) $text.=join(',', $objMod->depends); + else $text.=$langs->trans("None"); + $text.='
'.$langs->trans("RequiredBy").': '; + if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); + else $text.=$langs->trans("None"); + + $text.='


'; + $text.=''.$langs->trans("AddRemoveTabs").': '; if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 52b250e8cf0..4eb82e6183c 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -278,13 +278,12 @@ foreach ($modulesdir as $dir) try { - $res=include_once $dir.$file; + $res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { try { $objMod = new $modName($db); $modNameLoaded[$modName]=$dir; - if (! $objMod->numero > 0 && $modName != 'modUser') { dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR); @@ -471,12 +470,10 @@ if ($mode == 'common') if (! empty($moreforfilter)) { - //print '
'; print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - //print '
'; } @@ -485,8 +482,6 @@ if ($mode == 'common') $moreforfilter=''; // Show list of modules - print '
'; - print ''."\n"; $oldfamily=''; @@ -570,14 +565,15 @@ if ($mode == 'common') // Print a separator if we change family if ($familykey!=$oldfamily) { - print ''."\n"; - print '
'; + if ($oldfamily) print '

'; + $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; - print $familytext; - print "
'.$langs->trans("SetupShort").'
'."\n"; + + $atleastoneforfamily=0; } $atleastoneforfamily++; @@ -588,7 +584,7 @@ if ($mode == 'common') $oldfamily=$familykey; } - $var=!$var; + // Version (with picto warning or not) @@ -606,43 +602,38 @@ if ($mode == 'common') $imginfo="info_black"; } - print '\n"; + print ''."\n"; - // Picto - print ' '; - - // Name - print '\n"; // Desc - print '\n"; // Help - print ''; // Version - print '\n"; @@ -651,8 +642,12 @@ if ($mode == 'common') { $disableSetup = 0; - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''; + print ''; } } else // Module not yet activated { - print '\n"; - print ''; + print ''; } print "\n"; } + print "
'; + // Picto + Name of module + print ' '; $alttext=''; //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); if (! empty($objMod->picto)) { if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); - else print img_object($alttext,$objMod->picto,' width="14px"'); + else print img_object($alttext, $objMod->picto, 'class="valignmiddle" width="14px"'); } else { - print img_object($alttext,'generic'); + print img_object($alttext, 'generic', 'class="valignmiddle"'); } - print ''.$objMod->getName(); + print ' '.$objMod->getName().''; print "'; + print ''; print nl2br($objMod->getDesc()); print "'; - + print ''; //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; - print ''; + print ''; print $versiontrans; print "'; - if (! empty($objMod->disabled)) + print ''; + if (! empty($arrayofwarnings[$modName])) + { + print ''."\n"; + } + if (! empty($objMod->disabled)) { print $langs->trans("Disabled"); } @@ -674,7 +669,7 @@ if ($mode == 'common') { if (is_array($objMod->config_page_url)) { - print ''; + print ''; $i=0; foreach ($objMod->config_page_url as $page) { @@ -700,22 +695,22 @@ if ($mode == 'common') } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; + print ''; if (! empty($objMod->always_enabled)) { // Should never happened @@ -754,17 +749,20 @@ if ($mode == 'common') } } print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print "\n"; } print "'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'
\n"; print '
'; @@ -783,7 +781,7 @@ if ($mode == 'marketplace') print ''.$langs->trans("URL").''; print ''; - $var=!$var; + print "\n"; $url='https://www.dolistore.com'; print ''; @@ -791,7 +789,7 @@ if ($mode == 'marketplace') print ''.$url.''; print ''; - $var=!$var; + print "\n"; $url='https://partners.dolibarr.org'; print ''; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 5b86bcdc1c3..3aa6ad5dc26 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -183,8 +183,8 @@ print ''.$langs->trans("Parameters").''."\n"; print ' '; print ''.$langs->trans("Value").''."\n"; -$var=!$var; -print ''; + +print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").''; print ' '; print ''; @@ -197,8 +197,8 @@ print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").''; print ' '; print ''; @@ -211,8 +211,8 @@ print ''; print ''; /* TODO uncomment when the functionality will integrated -$var=!$var; -print ''; + +print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_buyPriceInCurrency").''; print ' '; print ''; @@ -226,8 +226,8 @@ print ''; */ /* TODO uncomment when the functionality will integrated -$var=!$var; -print ''; + +print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").''; print ' '; print ''; @@ -260,8 +260,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; - $var=!$var; - print ''; + + print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_appId").''; print ' '; print ''; @@ -273,8 +273,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").''; print ' '; print ''; @@ -286,8 +286,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").''; print ' '; print ''; @@ -311,8 +311,8 @@ print ''.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->trans print ' '; print ''.$langs->trans("Rate").''."\n"; -$var=!$var; -print ''; + +print ''; print '
'; print ''; print ''; @@ -323,8 +323,8 @@ print ''; print '
'; -$var=!$var; -print ''; + +print ''; print ''.$conf->currency.$form->textwithpicto(' ', $langs->trans("BaseCurrency")).''; print ' '; print '1'; @@ -334,8 +334,8 @@ foreach ($TCurrency as &$currency) { if($currency->code == $conf->currency) continue; - $var=!$var; - print ''; + + print ''; print ''.$currency->code.' - '.$currency->name.''; print ' '; print ''; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index a3b3eb50df6..c82e64d48ea 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -135,8 +135,8 @@ print ''; print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print "\n"; -$var=!$var; -print ''; + +print ''; print $langs->trans("NotificationEMailFrom").''; print ''; print ''; @@ -165,14 +165,14 @@ print "\n"; $notificationtrigger=new InterfaceNotification($db); $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); -print ''; +print ''; print ''; $var=true; $i=0; foreach($listofnotifiedevents as $notifiedevent) { - $var=!$var; + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); @@ -213,7 +213,7 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); $var=true; foreach($listofnotifiedevents as $notifiedevent) { - $var=!$var; + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); @@ -222,7 +222,7 @@ foreach($listofnotifiedevents as $notifiedevent) elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order'); elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention'); - print ''; + print ''; print ''.$elementLabel.''; print ''.$notifiedevent['code'].''; print ''.$label.''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 2433575e553..06315222825 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -211,7 +211,7 @@ if ($mode == 'setup' && $user->admin) print ''; print "\n"; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("OAuthIDSecret").''; @@ -223,7 +223,7 @@ if ($mode == 'setup' && $user->admin) print ''."\n"; $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("IsTokenGenerated"); @@ -250,7 +250,7 @@ if ($mode == 'setup' && $user->admin) print ''; $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("Token").''; @@ -273,7 +273,7 @@ if ($mode == 'setup' && $user->admin) { // Token refresh $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_REFRESH").''; @@ -284,7 +284,7 @@ if ($mode == 'setup' && $user->admin) // Token expired $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_EXPIRED").''; @@ -295,7 +295,7 @@ if ($mode == 'setup' && $user->admin) // Token expired at $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_EXPIRE_AT").''; @@ -368,8 +368,8 @@ if ($mode == 'userconf' && $user->admin) $sql = 'SELECT p.rowid, p.printer_name, p.printer_location, p.printer_id, p.copy, p.module, p.driver, p.userid, u.login FROM '.MAIN_DB_PREFIX.'printing as p, '.MAIN_DB_PREFIX.'user as u WHERE p.userid=u.rowid'; $resql = $db->query($sql); while ($row=$db->fetch_array($resql)) { - $var=!$var; - print ''; + + print ''; print ''.$row['login'].''; print ''.$row['module'].''; print ''.$row['driver'].''; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 93f7c301519..a5166ec69f2 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -177,7 +177,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print ''; + print ''; echo preg_replace('/\-.*$/','',preg_replace('/mod_payment_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -263,7 +263,7 @@ print "\n"; // Allow payments on different thirdparties bills but same parent company $var=! $var; -print ''; +print ''; print $langs->trans("PaymentOnDifferentThirdBills"); print ''; print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1); @@ -273,7 +273,7 @@ print "\n"; // Add js auto fill amount on paiement form /* always on now $var=! $var; -print ''; +print ''; print $langs->trans("JSOnPaimentBill"); print ''; print $form->selectyesno("INVOICE_AUTO_FILLJS",$conf->global->INVOICE_AUTO_FILLJS,1); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 74684c823e7..b0c32a344ff 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -98,7 +98,7 @@ $formadmin=new FormAdmin($db); $arraydetailsforpdffoot = array( 0 => $langs->trans('NoDetails'), 1 => $langs->trans('DisplayCompanyInfo'), - 2 => $langs->trans('DisplayManagersInfo'), + 2 => $langs->trans('DisplayCompanyManagers'), 3 => $langs->trans('DisplayCompanyInfoAndManagers') ); @@ -128,8 +128,8 @@ if ($action == 'edit') // Edit if (empty($selected)) $selected=dol_getDefaultFormat(); // Show pdf format - $var=!$var; - print ''.$langs->trans("DictionaryPaperFormat").''; + + print ''.$langs->trans("DictionaryPaperFormat").''; print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT'); print ''; @@ -145,13 +145,13 @@ if ($action == 'edit') // Edit print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Hide VAT Intra on address - $var=!$var; - print ''.$langs->trans("ShowVATIntaInAddress").''; + + print ''.$langs->trans("ShowVATIntaInAddress").''; print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1); print ''; // Show prof id 1 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -163,13 +163,13 @@ if ($action == 'edit') // Edit } if ($pid1) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode); print ''; } // Show prof id 2 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -181,13 +181,13 @@ if ($action == 'edit') // Edit } if ($pid2) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode); print ''; } // Show prof id 3 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -199,13 +199,13 @@ if ($action == 'edit') // Edit } if ($pid3) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode); print ''; } // Show prof id 4 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -217,7 +217,7 @@ if ($action == 'edit') // Edit } if ($pid4) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode); print ''; } @@ -233,37 +233,37 @@ if ($action == 'edit') // Edit print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Hide any PDF informations - $var=!$var; - print ''.$langs->trans("HideAnyVATInformationOnPDF").''; + + print ''.$langs->trans("HideAnyVATInformationOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print ''; //Desc - $var=!$var; - print ''.$langs->trans("HideDescOnPDF").''; + + print ''.$langs->trans("HideDescOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1); print ''; //Ref - $var=!$var; - print ''.$langs->trans("HideRefOnPDF").''; + + print ''.$langs->trans("HideRefOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1); print ''; //Details - $var=!$var; - print ''.$langs->trans("HideDetailsOnPDF").''; + + print ''.$langs->trans("HideDetailsOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); print ''; // Place customer adress to the ISO location - $var=!$var; - print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").''; + + print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1); print ''; - $var=!$var; - print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; + + print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); print ''; @@ -287,8 +287,8 @@ else // Show print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Show pdf format - $var=!$var; - print ''.$langs->trans("DictionaryPaperFormat").''; + + print ''.$langs->trans("DictionaryPaperFormat").''; $pdfformatlabel=''; if (empty($conf->global->MAIN_PDF_FORMAT)) @@ -323,13 +323,13 @@ else // Show print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Hide Intra VAT on address - $var=!$var; - print ''.$langs->trans("ShowVATIntaInAddress").''; + + print ''.$langs->trans("ShowVATIntaInAddress").''; print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1); print ''; // Show prof id 1 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -341,13 +341,13 @@ else // Show } if ($pid1) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1); print ''; } // Show prof id 2 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -359,13 +359,13 @@ else // Show } if ($pid2) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1); print ''; } // Show prof id 3 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -377,13 +377,13 @@ else // Show } if ($pid3) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1); print ''; } // Show prof id 4 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -395,7 +395,7 @@ else // Show } if ($pid4) { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1); print ''; } @@ -412,8 +412,8 @@ else // Show // Encrypt and protect PDF - $var=!$var; - print ""; + + print ''; print ''; $text = $langs->trans("ProtectAndEncryptPdfFiles"); $desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); @@ -440,36 +440,36 @@ else // Show print ''; // Hide any PDF informations - $var=!$var; - print ''.$langs->trans("HideAnyVATInformationOnPDF").''; + + print ''.$langs->trans("HideAnyVATInformationOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print ''; //Desc - $var=!$var; - print ''.$langs->trans("HideDescOnPDF").''; + + print ''.$langs->trans("HideDescOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); print ''; //Ref - $var=!$var; - print ''.$langs->trans("HideRefOnPDF").''; + + print ''.$langs->trans("HideRefOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print ''; //Details - $var=!$var; - print ''.$langs->trans("HideDetailsOnPDF").''; + + print ''.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print ''; - $var=!$var; - print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").''; + + print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1); print ''; - $var=!$var; - print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; + + print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS]; print ''; @@ -492,8 +492,8 @@ else // Show $var=false; if (! empty($dolibarr_pdf_force_fpdf)) { - $var=!$var; - print ''."\n"; + + print ''."\n"; print 'dolibarr_pdf_force_fpdf'."\n"; print ''; print $dolibarr_pdf_force_fpdf; @@ -501,8 +501,8 @@ else // Show print ''; } - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''.$langs->trans("LibraryToBuildPDF").''."\n"; print ''; $i=0; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 84cb9ed8bf2..daafab71053 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -186,7 +186,7 @@ if ($result) print "\n"; } - $var=!$var; + print ''; print ''.img_object('',$picto).' '.$objMod->getName(); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 6d5c915dae2..86108be0136 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -313,7 +313,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; + print ''; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -422,7 +422,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + if (!$obj->fk_soc) { $username=dolGetFirstLastname($obj->firstname,$obj->lastname); @@ -495,9 +495,9 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); print ''.$label.''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index c6ccb4f639c..bff56b4f776 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -310,8 +310,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print ''.$module->nom."\n"; + + print ''.$module->nom."\n"; print $module->info(); print ''; @@ -450,7 +450,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; + print ''; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -546,11 +546,11 @@ print ''.$langs->trans("Value")."\n"; print " \n"; print ""; -$var=!$var; + print "
"; print ''; print ""; -print ""; +print ''; print ''.$langs->trans("DefaultProposalDurationValidity").''; print ''."global->PROPALE_VALIDITY_DURATION."\">"; print ''; @@ -562,7 +562,7 @@ $var=! $var; print ''; print ''; print ''; -print ''; +print ''; print $langs->trans("UseCustomerContactAsPropalRecipientIfExist"); print ''; print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1); @@ -576,7 +576,7 @@ $var=! $var; print ''; print ''; print ''; -print ''; +print ''; print $langs->trans("FreeLegalTextOnProposal").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='PROPOSAL_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -594,11 +594,11 @@ print '' print "\n"; print '
'; -$var=!$var; + print "
"; print ''; print ""; -print ''; +print ''; print $langs->trans("WatermarkOnDraftProposal").''; print ''; print ''; @@ -609,8 +609,8 @@ print '
'; /* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. if ($conf->banque->enabled) { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { @@ -631,8 +631,8 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '.$langs->trans('NotAvailable').''; } */ @@ -668,7 +668,7 @@ print ''; print ' '; print "\n"; -print ''; +print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print ''; print "\n"; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 84836407499..224fac14ce7 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -133,8 +133,8 @@ print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Value").''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''.$langs->trans("ConnectionTimeout").''; print ''; print ''; @@ -143,8 +143,8 @@ print ' '.strtolower($langs->trans("Seconds")); print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''.$langs->trans("ResponseTimeout").''; print ''; print ''; @@ -153,8 +153,8 @@ print ' '.strtolower($langs->trans("Seconds")); print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''.$langs->trans("MAIN_PROXY_USE").''; print ''; print ''; @@ -162,7 +162,7 @@ print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); print ''; print ''; -$var=!$var; + print ''; print ''.$langs->trans("MAIN_PROXY_HOST").''; print ''; @@ -171,7 +171,7 @@ print ''; print ''; @@ -180,7 +180,7 @@ print ''; print ''; @@ -189,7 +189,7 @@ print ''; print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index b86023aa49a..1bac9d80bee 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -250,7 +250,7 @@ if ($mode == 'config' && $user->admin) } else { for ($line=0; $line < $nbofprinters; $line++) { $var = !$var; - print ''; + print ''; if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) { print ''; print ''; @@ -381,7 +381,7 @@ if ($mode == 'template' && $user->admin) $max = count($printer->listprinterstemplates); for ($line=0; $line < $max; $line++) { $var = !$var; - print ''; + print ''; if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) { print ''; print ''; @@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin) $max = count($printer->tags); for ($tag=0; $tag < $max; $tag++) { $var = !$var; - print ''; + print ''; print '<'.$printer->tags[$tag].'>'.$langs->trans(strtoupper($printer->tags[$tag])).''; print ''; } diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index d8fdddd2bb5..3f057bbdbb9 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -85,8 +85,8 @@ print ''; // Utilisation formulaire Ajax sur choix produit -$var=!$var; -print ''; + +print ''; print ''.$langs->trans("UseSearchToSelectResource").''; if (empty($conf->use_javascript_ajax)) { @@ -111,8 +111,8 @@ else } print ''; -$var=!$var; -print ''; + +print ''; print ''.$langs->trans('DisabledResourceLinkUser').''; print ''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER'); @@ -120,8 +120,8 @@ print ''; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''.$langs->trans('DisabledResourceLinkContact').''; print ''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY'); diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index b09f4820312..a04b23ce4fe 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -97,7 +97,7 @@ print "\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 3aa0bdf33bf..4d0415dbd01 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -250,7 +250,7 @@ foreach ($arrayhandler as $key => $module) if ($module->isEnabled()) { $var = !$var; - print ''; + print ''; print ucfirst($key); print "\n"; print $module->getDescription().'
'; @@ -283,7 +283,7 @@ print ''; //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) // Patter for Password Perso if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ -$var=!$var; + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); /*$this->length2 = $tabConf[0]; @@ -299,38 +299,38 @@ $var=!$var; print ' '.$langs->trans("PasswordPatternDesc").''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("MinLength").""; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("NbMajMin").""; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("NbNumMin").""; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("NbSpeMin").""; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("NbIteConsecutive").""; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '' . $langs->trans("NoAmbiCaracAutoGeneration").""; print ' '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).''; print ''; @@ -407,8 +407,8 @@ print ''.$langs->trans("Action").''; print ''; // Disable clear password in database -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DoNotStoreClearPassword").''; print ''; if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) @@ -441,8 +441,8 @@ print ""; print ''; // Cryptage du mot de base de la base dans conf.php -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("MainDbPasswordFileConfEncrypted").''; print ''; if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass)) @@ -476,8 +476,8 @@ print ''; // Disable link "Forget password" on logon -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; print ''; if(! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 0114bbb74b8..8c1b1fa5b07 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -136,7 +136,7 @@ print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Value").''; print ''; -print ''; +print ''; print ''.$langs->trans("MaxSizeForUploadedFiles").'.'; $max=@ini_get('upload_max_filesize'); if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; @@ -147,8 +147,8 @@ print ''; print ''.$langs->trans("UMask").''; print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print ''; @@ -158,8 +158,8 @@ print ''; print ''; // Use anti virus -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("AntiVirusCommand").'
'; print $langs->trans("AntiVirusCommandExample"); // Check command in inside safe_mode @@ -181,8 +181,8 @@ print ""; print ''; // Use anti virus -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("AntiVirusParam").'
'; print $langs->trans("AntiVirusParamExample"); print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 9ce79359a7c..e5c66d9e24b 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -116,8 +116,8 @@ print ''.$langs->trans("Status").''; print ''; // Enable Captcha code -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("UseCaptchaCode").''; print ''; if (function_exists("imagecreatefrompng")) @@ -146,8 +146,8 @@ else print ''; // Enable advanced perms -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("UseAdvancedPerms").''; print ''; if (! empty($conf->use_javascript_ajax)) @@ -182,10 +182,10 @@ print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Value").''; print "\n"; -$var=!$var; + $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout; -print ''; +print ''; print ''.$langs->trans("SessionTimeOut").''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print ''; @@ -194,10 +194,10 @@ print ''; print ''; -$var=!$var; + $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE=""; -print ''; +print ''; print ''.$langs->trans("MAIN_APPLICATION_TITLE").''; print ''; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 05fe548daff..faf05b7fb0f 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -175,31 +175,31 @@ if ($action == 'edit') print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - $var=!$var; - print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''; + + print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''; print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1); print ''; // Separator - $var=!$var; - print ' '; + + print ' '; // Method - $var=!$var; - print ''.$langs->trans("MAIN_SMS_SENDMODE").''; + + print ''.$langs->trans("MAIN_SMS_SENDMODE").''; if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1); else print ''.$langs->trans("None").''; print ''; // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''; + + print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''; print ''; // Autocopy to - /*$var=!$var; - print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; + /* + print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; print ''; */ @@ -224,31 +224,31 @@ else print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - $var=!$var; - print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).''; + + print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).''; // Separator - $var=!$var; - print ' '; + + print ' '; // Method - $var=!$var; - print ''.$langs->trans("MAIN_SMS_SENDMODE").''; + + print ''.$langs->trans("MAIN_SMS_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning(); print $text; print ''; // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''; + + print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''; print ''.$conf->global->MAIN_MAIL_SMS_FROM; if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && ! isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone")); print ''; // Autocopy to - /*$var=!$var; - print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; + /* + print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; print ''.$conf->global->MAIN_MAIL_AUTOCOPY_TO; if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); print ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index f2a6d165bd5..1c5a92fb0e8 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -161,8 +161,8 @@ $var=true; $found=0; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DeStockOnBill").''; print ''; if (! empty($conf->facture->enabled)) @@ -181,8 +181,8 @@ else print "\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DeStockOnValidateOrder").''; print ''; if (! empty($conf->commande->enabled)) @@ -203,8 +203,8 @@ $found++; //if (! empty($conf->expedition->enabled)) //{ -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DeStockOnShipment").''; print ''; if (! empty($conf->expedition->enabled)) @@ -223,8 +223,8 @@ else print "\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("DeStockOnShipmentOnClosing").''; print ''; if (! empty($conf->expedition->enabled)) @@ -245,8 +245,8 @@ $found++; /*if (! $found) { - $var=!$var; - print ""; + + print ''; print ''.$langs->trans("NoModuleToManageStockDecrease").''; print "\n"; }*/ @@ -265,8 +265,8 @@ $var=true; $found=0; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("ReStockOnBill").''; print ''; if (! empty($conf->fournisseur->enabled)) @@ -286,8 +286,8 @@ print "\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("ReStockOnValidateOrder").''; print ''; if (! empty($conf->fournisseur->enabled)) @@ -306,8 +306,8 @@ else print "\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("ReStockOnDispatchOrder").''; print ''; if (! empty($conf->fournisseur->enabled)) @@ -328,8 +328,8 @@ $found++; /*if (! $found) { - $var=!$var; - print ""; + + print ''; print ''.$langs->trans("NoModuleToManageStockIncrease").''; print "\n"; }*/ @@ -343,8 +343,8 @@ print " ".$langs->trans("RuleForStockAvailability")."\n"; print "  \n"; print ''."\n"; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("WarehouseAllowNegativeTransfer").''; print ''; print "
"; @@ -359,7 +359,7 @@ print "\n"; // Option to force stock to be enough before adding a line into document if($conf->invoice->enabled) { $var = !$var; - print ""; + print ''; print ''.$langs->trans("StockMustBeEnoughForInvoice").''; print ''; print ""; @@ -374,7 +374,7 @@ if($conf->invoice->enabled) { if($conf->order->enabled) { $var = !$var; - print ""; + print ''; print ''.$langs->trans("StockMustBeEnoughForOrder").''; print ''; print ""; @@ -389,7 +389,7 @@ if($conf->order->enabled) { if($conf->expedition->enabled) { $var = !$var; - print ""; + print ''; print ''.$langs->trans("StockMustBeEnoughForShipment").''; print ''; print ""; @@ -417,7 +417,7 @@ if ($virtualdiffersfromphysical) print "  \n"; print ''."\n"; $var = !$var; - print ""; + print ''; print ''.$langs->trans("UseVirtualStockByDefault").''; print ''; print ""; @@ -441,8 +441,8 @@ print "  \n"; print ''."\n"; if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $var=!$var; - print ""; + + print ''; print ''.$langs->trans("UseDispatchStatus").''; print ''; print ""; @@ -454,9 +454,9 @@ if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULAT print "\n\n"; } -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("UserWarehouseAutoCreate").''; print ''; print ""; @@ -468,9 +468,9 @@ print '
'; print "\n"; print "\n"; -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("AllowAddLimitStockByWarehouse").''; print ''; @@ -489,9 +489,9 @@ print '
'; If not used by a module, I still need to understand in which case user may need this now we can set rule on product page. if ($conf->global->PRODUIT_SOUSPRODUITS) { - $var=!$var; + - print ""; + print ''; print ''.$langs->trans("IndependantSubProductStock").''; print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 7510bfe37ef..2619951e1b5 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -250,8 +250,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print ''.$module->nom."\n"; + + print ''.$module->nom."\n"; print $module->info(); print ''; @@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new FactureFournisseur($db)); - $var=!$var; + print "\n"; print ""; print (empty($module->name)?$name:$module->name); @@ -471,7 +471,7 @@ print ''.$langs->trans("Value").''; print ' '; print "\n"; -print ''; +print ''; print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_INVOICE_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -505,7 +505,7 @@ print ''; print ' '; print "\n"; -print ''; +print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print ''; print "\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 1ac6ae86989..d54f0e367aa 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -279,8 +279,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print ''.$module->nom."\n"; + + print ''.$module->nom."\n"; print $module->info(); print ''; @@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new CommandeFournisseur($db)); - $var=!$var; + print "\n"; print ""; print (empty($module->name)?$name:$module->name); @@ -493,7 +493,7 @@ print "\n"; $var=false; //if ($conf->global->MAIN_FEATURES_LEVEL > 0) //{ - print ''; + print ''; print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; print $langs->trans("IfSetToYesDontForgetPermission"); print ''; @@ -501,15 +501,15 @@ $var=false; print ''; print ''; print "\n"; - $var=!$var; + //} // Ask for payment bank during supplier order /* Kept as hidden for the moment if ($conf->banque->enabled) { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -530,13 +530,13 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '.$langs->trans('NotAvailable').''; } */ -print ''; +print ''; print $langs->trans("FreeLegalTextOnOrders").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_ORDER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -571,7 +571,7 @@ print ''; print ' '; print "\n"; -print ''; +print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print ''; print "\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 933ee22a062..40caa94c8a8 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print ''; + print ''; echo preg_replace('/\-.*$/','',preg_replace('/mod_supplier_payment_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new PaiementFourn($db)); - $var=!$var; + print "\n"; print ""; print (empty($module->name)?$name:$module->name); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 7963aa7fabc..703fbc482e9 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -288,8 +288,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print ''.$module->nom."\n"; + + print ''.$module->nom."\n"; print $module->info(); print ''; @@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; + print ''; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -527,7 +527,7 @@ $var=! $var; print '
'; print ''; print ''; -print ''; +print ''; print $langs->trans("FreeLegalTextOnSupplierProposal").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_PROPOSAL_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -545,11 +545,11 @@ print '' print "\n"; print '
'; -$var=!$var; + print "
"; print ''; print ""; -print ''; +print ''; print $langs->trans("WatermarkOnDraftSupplierProposal").''; print ''; print ''; @@ -559,8 +559,8 @@ print '
'; if ($conf->banque->enabled) { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { @@ -581,8 +581,8 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').''; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index ae32c073349..71d06ae8e64 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -204,8 +204,8 @@ foreach ($syslogModules as $moduleName) //print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."
\n"; if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them) - $var=!$var; - print ''; + + print ''; print ''; print ' '; print $module->getName(); @@ -257,8 +257,8 @@ print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; print "\n"; $var=true; -$var=!$var; -print ''.$langs->trans("SyslogLevel").''; + +print ''.$langs->trans("SyslogLevel").''; print ' '.$langs->trans("LocalSignature").' = '; - print ''; + print ''; print '
'; } else { print ' '.$langs->trans("LocalSignature").' = '; - print ''; + print ''; print ' ('.$langs->trans("AvailableOnlyOnPackagedVersions").')'; print '
'; } @@ -109,7 +109,7 @@ print ''."\n"; if ($enableremotecheck) { print ' '.$langs->trans("RemoteSignature").' = '; - print '
'; + print '
'; } else { diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 706e0215059..68a01340303 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -118,7 +118,7 @@ $rights_ids = array(); foreach($sortorder as $numero=>$name) { $idperms=""; - $var=!$var; + // Module print "'; $alt=$name.' - '.$modules_files[$numero]; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 3e9ccbc895f..6bb431bfdfb 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -82,8 +82,8 @@ foreach($phparray as $key => $value) { if (! is_array($keyvalue)) { - $var=!$var; - print ''; + + print ''; print ''.$keyparam.''; $valtoshow=$keyvalue; if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80); @@ -97,8 +97,8 @@ foreach($phparray as $key => $value) } else { - $var=!$var; - print ''; + + print ''; print ''.$keyparam.''; $i=0; foreach($keyvalue as $keyparam2 => $keyvalue2) diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 00bf0635293..788d8604584 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -204,7 +204,7 @@ print "\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index 5a142f3e51e..68d56bd2ded 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -174,7 +174,7 @@ function create_script_table($list) foreach($list as $script) { $var = ! $var; - print ''; + print ''; print ''.dol_trunc($script['file'],80,'left').''; print ''.dol_print_date($script['mtime'],'dayhour').''; print ''.number_format($script['size'] / 1024, 2).'KB'; @@ -207,7 +207,7 @@ function create_key_table($list) foreach($list as $key) { $var = !$var; - print ''; + print ''; print ''.dol_trunc($key['name'],80,'left').''; print ''.dol_print_date($key['created'],'dayhour').''; print ''.number_format($key['size']/1024, 3).'KB'; @@ -239,37 +239,37 @@ print ''; print 'Information'; print ''; $var = !$var; -print ''; +print ''; print 'Caching enabled'; print ''.($info['cache']?'yes':'no').''; print ''; $var = !$var; -print ''; +print ''; print 'Optimizer enabled'; print ''.$info['optimizer']?'yes':'no'.''; print ''; $var = !$var; -print ''; +print ''; print 'Memory usage'; print ''.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)'; print ''; $var = ! $var; -print ''; +print ''; print 'Free memory in reserved cache'; print ''.number_format($info['memoryAvailable']/(1024*1024), 2).'MB'; print ''; $var = ! $var; -print ''; +print ''; print 'Cached scripts'; print ''.$info['cachedScripts'].''; print ''; $var = ! $var; -print ''; +print ''; print 'Removed scripts'; print ''.$info['removedScripts'].''; print ''; $var = ! $var; -print ''; +print ''; print 'Cached keys'; print ''.(isset($info['cachedKeys'])?$info['cachedKeys']:'').''; print ''; @@ -289,12 +289,12 @@ if (is_array($resCached) || is_array($resRemoved)) { if (is_array($resCached)) { $var = ! $var; - print ""; + print ''; print "Caching"; print ''; print ""; $var = ! $var; - print ""; + print ''; print "Optimizer"; print ''; print ""; @@ -302,17 +302,17 @@ if (is_array($resCached) || is_array($resRemoved)) { if (is_array($resRemoved)) { $var = ! $var; - print ""; + print ''; print "Clear cache"; print ''; print ""; $var = ! $var; - print ""; + print ''; print "Clean cache"; print ''; print ""; $var = ! $var; - print ""; + print ''; print "Purge cache"; print ''; print ""; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 4e0651597ee..f5e6afd36b1 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -261,9 +261,9 @@ if ($result) { $obj = $db->fetch_object($result); - $var=!$var; + - print ''; + print ''; // Date print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index c313c91a7bd..56db6eb2ad7 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -141,9 +141,9 @@ if ($savehandler == 'files') foreach ($listofsessions as $key => $sessionentry) { - $var=!$var; + - print ""; + print ''; // Login print ''.$sessionentry['login'].''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4dbfc53c821..6d3ee6ced8e 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -57,10 +57,6 @@ if (! $sortfield) $sortfield='lang,transkey'; if (! $sortorder) $sortorder='ASC'; -/* - * Actions - */ - /* * Actions */ @@ -83,7 +79,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_array_options=array(); } - if ($action == 'add' || (GETPOST('add') && $action != 'update')) { $error=0; @@ -105,18 +100,22 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) } if (! $error) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')"; + $db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".$db->escape($conf->entity).")"; $result = $db->query($sql); if ($result > 0) { - setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $db->commit(); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $transkey=""; $transvalue=""; } else { - dol_print_error($db); + $db->rollback(); + setEventMessages($db->lasterror(), null, 'errors'); $action=''; } } @@ -210,10 +209,9 @@ if ($mode == 'overwrite') // Line to add new record - $var=false; print "\n"; - print ''; + print ''; print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1); print ''."\n"; print ''; @@ -240,18 +238,10 @@ if ($mode == 'overwrite') // Show constants - $sql = "SELECT"; - $sql.= " rowid"; - $sql.= ", lang"; - $sql.= ", transkey"; - $sql.= ", transvalue"; + $sql = "SELECT rowid, entity, lang, transkey, transvalue"; $sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; $sql.= " WHERE 1 = 1"; //$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; - //if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug - //else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits - //if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); - //$sql.= " ORDER BY entity, name ASC"; $sql.= $db->order($sortfield, $sortorder); dol_syslog("translation::select from table", LOG_DEBUG); @@ -260,16 +250,14 @@ if ($mode == 'overwrite') { $num = $db->num_rows($result); $i = 0; - $var=false; while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; print "\n"; - print ''; + print ''; print ''.$obj->lang.''."\n"; print ''.$obj->transkey.''."\n"; @@ -336,8 +324,8 @@ if ($mode == 'searchkey') foreach($filearray as $file) { $tmpfile=preg_replace('/.lang/i', '', basename($file['name'])); - $newlang->load($tmpfile, 0, 0, '', 0); - $newlangfileonly->load($tmpfile, 0, 0, '', 1); + $newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite + $newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only //print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records
'."\n"; } } @@ -376,10 +364,9 @@ if ($mode == 'searchkey') print "\n"; // Line to search new record - $var=false; print "\n"; - print ''; + print ''; //print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1); print $formadmin->select_language($langcode,'langcode', 0, null, 0, 0, 0, 'maxwidthonsmartphone', 1); print ''."\n"; @@ -412,14 +399,12 @@ if ($mode == 'searchkey') // Show result $i=0; - $var=false; foreach($recordtoshow as $key => $val) { $i++; if ($i <= $offset) continue; if ($i > ($offset + $limit)) break; - $var=!$var; - print ''.$langcode.''.$key.''; + print ''.$langcode.''.$key.''; print dol_escape_htmltag($val); print ''; if ($val != $newlangfileonly->tab_translate[$key]) @@ -429,7 +414,7 @@ if ($mode == 'searchkey') } /*if (! empty($conf->multicompany->enabled) && !$user->entity) { - print $val; + print ''.$val.''; }*/ print ''."\n"; } diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index c1224bffe89..0aae9c6915e 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -64,8 +64,8 @@ print ' $var=True; foreach ($triggers as $trigger) { - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index d237ca3e727..42feea8f8ec 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -180,8 +180,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print ''; + +print ''; print ''; print ''; @@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; print ''; print ''; print "\n"; -$var=!$var; -print ''; diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 3cee534e797..d84713d1e62 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -41,9 +41,12 @@ function printBookmarksList($aDb, $aLangs) $langs->load("bookmarks"); $url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:''); - + // TODO Add post param to $url + $ret = ''; + // Menu bookmark + /* $ret.= '
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].'
'.$langs->trans("UserMailRequired").' 
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 72365726d25..db5ef3cbf59 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -231,7 +231,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 1204fded0aa..7aef2671c8d 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -90,7 +90,6 @@ class DolibarrApi // Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses unset($object->linkedObjects); - unset($object->lignes); // should be ->lines unset($object->oldline); unset($object->error); diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index b622aa1d9dd..14b6dabf5e5 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -75,8 +75,8 @@ print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("NbOfBoomarkToShow").''; print ''; print '
'; $ret.= ''.$langs->trans('Bookmarks').''; @@ -56,9 +59,18 @@ function printBookmarksList($aDb, $aLangs) } $ret.= '
'; $ret.= ''; - + */ $ret.= ''."\n"; + $ret.= '
'; + $ret.= ''; + $ret.= '
'; + + $ret.=ajax_combobox('boxbookmark'); + + $ret.=''; $ret .= ''; return $ret; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index cf5a52cf9c6..a9d4a39ef85 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -157,15 +157,19 @@ if ($action == 'create') print ''; - print ''; - - print ''; + print ''; + dol_set_focus('#titlebookmark'); + + // Url + print ''; + // Target print ''; + // Owner print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index d72fb19a6e5..40a316d881b 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -27,32 +27,40 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; $langs->load("bookmarks"); $langs->load("admin"); +$action=GETPOST('action','alpha'); +$massaction=GETPOST('massaction','alpha'); +$show_files=GETPOST('show_files','int'); +$confirm=GETPOST('confirm','alpha'); +$toselect = GETPOST('toselect', 'array'); + // Security check if (! $user->rights->bookmark->lire) { restrictedArea($user, 'bookmarks'); } $optioncss = GETPOST('optioncss','alpha'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; +if ($page == -1) { $page = 0; } +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="position"; -$limit=$conf->liste_limit; +if (! $sortfield) $sortfield='position'; +if (! $sortorder) $sortorder='ASC'; + +$id = GETPOST("bid",'int'); /* * Actions */ -if ($_GET["action"] == 'delete') +if ($action == 'delete') { $bookmark=new Bookmark($db); - $res=$bookmark->remove($_GET["bid"]); + $res=$bookmark->remove($id); if ($res > 0) { header("Location: ".$_SERVER["PHP_SELF"]); @@ -71,9 +79,9 @@ if ($_GET["action"] == 'delete') $userstatic=new User($db); -llxHeader(); +llxHeader('', $langs->trans("ListOfBookmarks")); -print load_fiche_titre($langs->trans("Bookmarks")); +print load_fiche_titre($langs->trans("ListOfBookmarks")); $sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,"; $sql.= " u.login, u.lastname, u.firstname"; @@ -100,12 +108,9 @@ if ($resql) print ""; //print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),'',''); - print ""; + print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Link"),'',''); - print ""; print_liste_field_titre($langs->trans("Target"),'','','','','align="center"'); - print ""; print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder); @@ -117,8 +122,8 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; // Id print ''; $linkintern=0; - $title=dol_trunc($obj->title,24); - $link=dol_trunc($obj->url,24); + $title=$obj->title; + $link=$obj->url; // Title print "\n"; // Url - print "'; + print '
'.$langs->trans("NoPhotoYet")."
"; } - - print '
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("BehaviourOnClick").''; $liste=array(0=>$langs->trans("ReplaceWindow"),1=>$langs->trans("OpenANewWindow")); print $form->selectarray('target',$liste,1); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("Owner").''; print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print ' 
 
'; @@ -126,8 +131,8 @@ if ($resql) print '"; @@ -152,7 +157,7 @@ if ($resql) print ""; + print ''; if (! $linkintern) print 'target?' target="newlink"':'').'>'; print $link; if (! $linkintern) print ''; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index de60e8b80cf..0d1dbf2de53 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -100,27 +100,27 @@ print ''; print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''; if (! empty($conf->banque->enabled)) { - $var=!$var; - print ''; + + print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; @@ -128,8 +128,8 @@ if (! empty($conf->banque->enabled)) if (! empty($conf->stock->enabled)) { - $var=!$var; - print ''; // Force warehouse (this is not a default value) + + print ''; // Force warehouse (this is not a default value) print ''; // Force warehouse (this is not a default value) + + print ''; // Force warehouse (this is not a default value) print ''; + +print ''; print ''; print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 464b9bf3127..b2cd3d3dd31 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -49,9 +49,10 @@ class Categorie extends CommonObject const TYPE_MEMBER = 3; // TODO Replace this value with 'member' const TYPE_CONTACT = 4; // TODO Replace this value with 'contact' const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user' - const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account' - const TYPE_PROJECT = 6; - public $picto = 'category'; + const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account' + const TYPE_PROJECT = 6; + const TYPE_BANK_LINE = 'bank_line'; + public $picto = 'category'; /** @@ -1337,34 +1338,68 @@ class Categorie extends CommonObject $type = $map_type[$type]; } - $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; - $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; - $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type]; - $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")"; - - $res = $this->db->query($sql); - if ($res) + if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code { - while ($obj = $this->db->fetch_object($res)) - { - if ($mode == 'id') { - $cats[] = $obj->rowid; - } else if ($mode == 'label') { - $cats[] = $obj->label; - } else { - $cat = new Categorie($this->db); - $cat->fetch($obj->fk_categorie); - $cats[] = $cat; - } - } - - return $cats; - } - else - { - dol_print_error($this->db); - return -1; + // Load bank groups + $sql = "SELECT c.label, c.rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c"; + $sql.= " WHERE a.lineid=".$id." AND a.fk_categ = c.rowid"; + $sql.= " ORDER BY c.label"; + + $res = $this->db->query($sql); + if ($res) + { + while ($obj = $this->db->fetch_object($res)) + { + if ($mode == 'id') { + $cats[] = $obj->rowid; + } else if ($mode == 'label') { + $cats[] = $obj->label; + } else { + $cat = new Categorie($this->db); + $cat->id = $obj->rowid; + $cat->label = $obj->label; + $cats[] = $cat; + } + } + } + else + { + dol_print_error($this->db); + return -1; + } } + else + { + $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; + $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; + $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type]; + $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")"; + + $res = $this->db->query($sql); + if ($res) + { + while ($obj = $this->db->fetch_object($res)) + { + if ($mode == 'id') { + $cats[] = $obj->rowid; + } else if ($mode == 'label') { + $cats[] = $obj->label; + } else { + $cat = new Categorie($this->db); + $cat->fetch($obj->fk_categorie); + $cats[] = $cat; + } + } + } + else + { + dol_print_error($this->db); + return -1; + } + } + + return $cats; } @@ -1532,14 +1567,14 @@ class Categorie extends CommonObject { while (($file = readdir($handle)) !== false) { - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file)) + if (dol_is_file($dir.$file) && preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file)) { $nbphoto++; $photo = $file; // On determine nom du fichier vignette $photo_vignette=''; - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) + if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) { $photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0]; } @@ -1582,7 +1617,7 @@ class Categorie extends CommonObject dol_delete_file($file,1); // Si elle existe, on efface la vignette - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs)) + if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs)) { $photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_small'.$regs[0]; if (file_exists($dirthumb.$photo_vignette)) diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index ee03f9f4771..100d2d0d48e 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -105,7 +105,7 @@ if ($object->id) $head = categories_prepare_head($object,$type); - dol_fiche_head($head, 'photos', $title, 0, 'category'); + dol_fiche_head($head, 'photos', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; @@ -130,6 +130,7 @@ if ($object->id) print '
'; + print '
'; print '
'; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("CashDeskThirdPartyForSell").'
'.$langs->trans("CashDeskThirdPartyForSell").''; print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0); print '
'.$langs->trans("CashDeskBankAccountForSell").'
'.$langs->trans("CashDeskBankAccountForSell").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1); print '
'.$langs->trans("CashDeskBankAccountForCheque").'
'.$langs->trans("CashDeskBankAccountForCheque").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1); print '
'.$langs->trans("CashDeskBankAccountForCB").'
'.$langs->trans("CashDeskBankAccountForCB").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1); print '
'.$langs->trans("CashDeskDoNotDecreaseStock").'
'.$langs->trans("CashDeskDoNotDecreaseStock").''; if (empty($conf->productbatch->enabled)) { print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1); @@ -145,8 +145,8 @@ if (! empty($conf->stock->enabled)) $disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK; - $var=!$var; - print '
'.$langs->trans("CashDeskIdWareHouse").'
'.$langs->trans("CashDeskIdWareHouse").''; if (! $disabled) { @@ -163,7 +163,7 @@ if (! empty($conf->stock->enabled)) if (! empty($conf->service->enabled)) { $var=! $var; - print '
'; + print '
'; print $langs->trans("CashdeskShowServices"); print ''; print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1); @@ -174,7 +174,7 @@ if (! empty($conf->service->enabled)) if (! empty($conf->receiptprinter->enabled)) { $var=! $var; - print '
'; + print '
'; print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("FeatureNotYetAvailable").')'; print ''; print $form->selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1); diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 9a61a50b38a..8f6af8b6d4d 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -63,7 +63,7 @@ top_htmlhead('','',0,0,'',$arrayofcss); logo_small)) { - print 'Logo company'; + print 'Logo company'; } else { diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index 78ce86f45f7..40be470c429 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -37,7 +37,7 @@ $object->fetch($facid);

name; ?>
diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index d1af6bdafb2..bc27be9bb12 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -96,8 +96,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print '

'.$langs->trans("CategorieRecursiv").''. $form->textwithpicto('',$langs->trans("CategorieRecursivHelp"),1,'help').'
'; @@ -146,7 +147,8 @@ if ($object->id) print ''; print "
\n"; - + print ''; + print dol_fiche_end(); @@ -198,7 +200,7 @@ if ($object->id) $dir = $upload_dir.'/'.$pdir; print '
'; - print ''; + print '
'; foreach ($object->liste_photos($dir) as $key => $obj) { @@ -255,14 +257,12 @@ if ($object->id) $nbphoto++; } + print '
'; + if ($nbphoto < 1) { - print '
'; - print "
".$langs->trans("NoPhotoYet")."

"; - print '
'; } } else diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index a239b357045..7dbe6325e1d 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -167,7 +167,7 @@ if (! empty($object->multilangs)) } } -dol_fiche_head($head, 'translation', $title, 0, 'category'); +dol_fiche_head($head, 'translation', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; @@ -184,6 +184,7 @@ dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', print '
'; +print '
'; print '
'; print ''; @@ -201,6 +202,7 @@ print $formother->showColor($object->color); print ''; print '
'; +print '
'; dol_fiche_end(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a1c33c568f3..ebd5fa9991c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -192,7 +192,7 @@ else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); -dol_fiche_head($head, 'card', $title, 0, 'category'); +dol_fiche_head($head, 'card', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; @@ -219,11 +219,12 @@ if ($action == 'delete') print '
'; +print '
'; print '
'; print ''; // Description -print ''; @@ -241,6 +242,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) } print '
'; +print '
'; print $langs->trans("Description").''; print dol_htmlentitiesbr($object->description); print '
'; +print '
'; dol_fiche_end(); @@ -290,7 +292,7 @@ else $var=true; foreach ($cats as $cat) { - $var=!$var; + print "\t\n"; print "\t\t".''; print "".$cat->label.""; @@ -361,7 +363,7 @@ if ($object->type == Categorie::TYPE_PRODUCT) $var=true; foreach ($prods as $prod) { - $var=!$var; + print "\t\n"; print ''; print $prod->getNomUrl(1); @@ -412,7 +414,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER) $var=true; foreach ($socs as $soc) { - $var=!$var; + print "\t\n"; print ''; @@ -468,7 +470,7 @@ if($object->type == Categorie::TYPE_CUSTOMER) if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself $i++; - $var=!$var; + print "\t\n"; print ''; print $soc->getNomUrl(1); @@ -521,7 +523,7 @@ if ($object->type == Categorie::TYPE_MEMBER) $var=true; foreach ($prods as $key => $member) { - $var=!$var; + print "\t\n"; print ''; $member->ref=$member->login; @@ -576,7 +578,7 @@ if($object->type == Categorie::TYPE_CONTACT) foreach ($contacts as $key => $contact) { $i++; - $var=!$var; + print "\t\n"; print ''; print $contact->getNomUrl(1,'category'); @@ -630,7 +632,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT) $var=true; foreach ($accounts as $key => $account) { - $var=!$var; + print "\t\n"; print ''; print $account->getNomUrl(1,0); @@ -685,7 +687,7 @@ if ($object->type == Categorie::TYPE_PROJECT) $var=true; foreach ($projects as $key => $project) { - $var=!$var; + print "\t\n"; print ''; print $project->getNomUrl(1,0); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f853e88a0df..fc4fc218971 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -752,6 +752,8 @@ if ($action == 'create') print ''; print '

'; + + print ''; // Related company @@ -1184,7 +1186,7 @@ if ($id > 0) } else { - dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); + dol_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action'); // Clone event @@ -1255,6 +1257,8 @@ if ($id > 0) dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref); + print '
'; + print '
'; // Affichage fiche action en mode visu @@ -1320,7 +1324,7 @@ if ($id > 0) print '
'; print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '
'; - if (in_array($user->id,array_keys($listofuserid))) + if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid))) { print '
'; print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody @@ -1345,6 +1349,7 @@ if ($id > 0) print '
'; + print '
'; print '
'; if ($conf->societe->enabled) @@ -1380,21 +1385,6 @@ if ($id > 0) } print ''; } - - // Project - /* - if (! empty($conf->projet->enabled)) - { - print ''; - } - */ // Priority print '
'.$langs->trans("Project").''; - if ($object->fk_project) - { - $project=new Project($db); - $project->fetch($object->fk_project); - print $project->getNomUrl(1,'',1); - } - print '
'.$langs->trans("Priority").''; @@ -1423,7 +1413,9 @@ if ($id > 0) //Extra field if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print '

'; + print '

'; + print '
'; + print '
'; foreach($extrafields->attribute_label as $key=>$label) { if (isset($_POST["options_" . $key])) { @@ -1443,6 +1435,8 @@ if ($id > 0) print '
'; } + print ''; + dol_fiche_end(); } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7140bb09a1e..fc0bbebb901 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -936,7 +936,7 @@ class ActionComm extends CommonObject $response->label = $langs->trans("ActionsToDo"); $response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda'; if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1'; - $response->img = img_object($langs->trans("Actions"),"action"); + $response->img = img_object('',"action"); // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 241843623c2..2caa55bcd59 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -121,7 +121,7 @@ if ($object->id > 0) $now=dol_now(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + dol_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"'); $linkback.= ''.$langs->trans("BackToList").''; @@ -164,6 +164,8 @@ if ($object->id > 0) dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref); + print '
'; + print '
'; // Affichage fiche action en mode visu @@ -236,13 +238,10 @@ if ($object->id > 0) print '
'; - - print '
'; - print ''; // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; foreach($filearray as $key => $file) { @@ -255,7 +254,9 @@ if ($object->id > 0) print '
'; - dol_fiche_end(); + print ''; + + dol_fiche_end(); $modulepart = 'actions'; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 25d410e7bdb..d365acef38b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -306,28 +306,28 @@ $param.="&maxprint=".$maxprint; // Show navigation bar if (empty($action) || $action=='show_month') { - $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')."\n"; + $nav ="  \n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b %Y"); $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')."\n"; + $nav.="   \n"; $nav.="   (".$langs->trans("Today").")"; $picto='calendar'; } if ($action=='show_week') { - $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')."\n"; + $nav ="trans("Previous"))."\">  \n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week; $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')."\n"; + $nav.="   trans("Next"))."\">\n"; $nav.="   (".$langs->trans("Today").")"; $picto='calendarweek'; } if ($action=='show_day') { - $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')."\n"; + $nav ="  \n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"daytextshort"); $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')."\n"; + $nav.="   \n"; $nav.="   (".$langs->trans("Today").")"; $picto='calendarday'; } @@ -364,12 +364,19 @@ if (! empty($conf->use_javascript_ajax)) // If javascript on $s.=''."\n"; $s.='' . "\n"; @@ -384,7 +391,6 @@ if (! empty($conf->use_javascript_ajax)) // If javascript on $s.='jQuery(document).ready(function () { jQuery("table input[name^=\"check_ext\"]").click(function() { var name = $(this).attr("name"); - jQuery(".family_ext" + name.replace("check_ext", "")).toggle(); }); });' . "\n"; @@ -957,7 +963,14 @@ if (count($listofextcals)) // Complete $eventarray with events coming from external module $parameters=array(); $object=null; $reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action); -if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']); +if (! empty($hookmanager->resArray['eventarray'])) { + foreach ($hookmanager->resArray['eventarray'] as $keyDate => $events) { + if (!isset($eventarray[$keyDate])) { + $eventarray[$keyDate]=array(); + } + $eventarray[$keyDate]=array_merge($eventarray[$keyDate], $events); + } +} @@ -1000,10 +1013,10 @@ if (empty($action) || $action == 'show_month') // View by month print $langs->trans($labelshort[$numdayinweek]); } else print $langs->trans("Day".$numdayinweek); - print "\n"; + print ' '."\n"; $i++; } - echo " \n"; + echo ' '."\n"; $todayarray=dol_getdate($now,'fast'); $todaytms=dol_mktime(0, 0, 0, $todayarray['mon'], $todayarray['mday'], $todayarray['year']); @@ -1186,21 +1199,23 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $theme_datacolor; global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused; - print "\n".'
'; + $dateint = sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); + + print "\n"; // Line with title of day $curtime = dol_mktime(0, 0, 0, $month, $day, $year); - print ''."\n"; + print '
'."\n"; - print '
'."\n"; + print ''."\n"; // Line with td contains all div of each events - print ''; + print ''; // td tr - print '
'; - print ''; + print '
'; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; @@ -1211,11 +1226,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print img_picto($langs->trans("NewAction"),'edit_add.png'); print ''; } - print '
'; - print '
'; + print '
'; + print '
'; //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); @@ -1235,26 +1250,26 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa { if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA)) { - $keysofuserassigned=array_keys($event->userassigned); + $keysofuserassigned=array_keys($event->userassigned); $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); // Define $color (Hex string like '0088FF') and $cssclass of event $color=-1; $colorindex=-1; - if (in_array($user->id, $keysofuserassigned)) - { - $nummytasks++; $cssclass='family_mytasks'; - - if (empty($cacheusers[$event->userownerid])) - { - $newuser=new User($db); - $newuser->fetch($event->userownerid); - $cacheusers[$event->userownerid]=$newuser; - } - //var_dump($cacheusers[$event->userownerid]->color); - - // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) - if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; + if (in_array($user->id, $keysofuserassigned)) + { + $nummytasks++; $cssclass='family_mytasks'; + + if (empty($cacheusers[$event->userownerid])) + { + $newuser=new User($db); + $newuser->fetch($event->userownerid); + $cacheusers[$event->userownerid]=$newuser; + } + //var_dump($cacheusers[$event->userownerid]->color); + + // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) + if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; } else if ($event->type_code == 'ICALEVENT') // Event come from external ical file { @@ -1332,7 +1347,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($user->rights->agenda->allactions->create || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { - $cssclass.= " movable"; + $cssclass.= " movable cursormove"; }else{ $cssclass.= " unmovable"; } @@ -1345,19 +1360,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show rect of event print "\n"; - print '
'."\n"; + print '
'; - print '
    '; // always 1 li per ul, 1 ul per event - print '
  • '; - print 'transparency)?'':' cal_event_busy').'" style="'.$h; + print 'background: #'.$color.';'; + print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, 0).'), to(#'.dol_color_minus($color, 1).'));'; //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; - print ' -moz-border-radius:4px;" width="100%">'; - print ''; + print ''; // Status - Percent - print '
    '; + //print ' -moz-border-radius:4px;"'; + //print 'border: 1px solid #ccc" width="100%"'; + print '">'; + print '
    '; + + $daterange=''; + if ($event->type_code == 'BIRTHDAY') // It's a birthday { print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); @@ -1373,9 +1394,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Date if (empty($event->fulldayevent)) { - //print ''; - $daterange=''; - // Show hours (start ... end) $tmpyearstart = date('Y',$event->date_start_in_calendar); $tmpmonthstart = date('m',$event->date_start_in_calendar); @@ -1408,22 +1426,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) $daterange.=dol_print_date($event->date_end_in_calendar,'%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user } - //print $daterange; - if ($event->type_code != 'ICALEVENT') - { - $savlabel=$event->libelle; - $event->libelle=$daterange; - //print ''; - print $event->getNomUrl(0); - //print ''; - $event->libelle=$savlabel; - } - else - { - print $daterange; - } - //print ' '; - print " "; } else { @@ -1434,9 +1436,36 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } // Show title - if ($event->type_code == 'ICALEVENT') print dol_trunc($event->libelle,$maxnbofchar); - else print $event->getNomUrl(0,$maxnbofchar,'cal_event'); + $titletoshow = $daterange; + $titletoshow.=($titletoshow?' ':'').$event->libelle; + + if ($event->type_code == 'ICALEVENT') print $titletoshow; + else + { + $savlabel=$event->libelle; + $event->libelle=$titletoshow; + print $event->getNomUrl(0,$maxnbofchar,'cal_event','',0,1); + $event->libelle=$savlabel; + } + // Loop on each assigned user + $listofusertoshow=''; + $posuserassigned=0; + foreach($event->userassigned as $tmpid => $tmpdata) + { + if (! $posuserassigned && $titletoshow) $listofusertoshow.='
    '; + $posuserassigned++; + if (empty($cacheusers[$tmpid])) + { + $newuser=new User($db); + $newuser->fetch($tmpid); + $cacheusers[$tmpid]=$newuser; + } + + $listofusertoshow.=$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valigntextbottom'); + } + print $listofusertoshow; + if ($event->type_code == 'ICALEVENT') print '
    ('.dol_trunc($event->icalname,$maxnbofchar).')'; // If action related to company / contact @@ -1479,12 +1508,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
    '; - if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); + $withstatus=0; + if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') + { + $withstatus=1; + if ($event->percentage >= 0) $withstatus=2; + } + print ''; + if ($withstatus) print $event->getLibStatut(3,1); else print ' '; print '
    '; - print '
  • '; - print '
'; print '
'."\n"; $i++; } @@ -1526,10 +1559,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''."\n"; } - print '
'; - print '
'."\n"; + print ''; // table + print "\n"; } diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 2ad3f424b12..7bee5550453 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -59,7 +59,7 @@ $object->fetch($id); $object->info($object->id); $head=actions_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action'); +dol_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"'); $linkback.= ''.$langs->trans("BackToList").''; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 0a08b6e55f1..8b1dc424239 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; +include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $langs->load("users"); $langs->load("companies"); @@ -147,6 +148,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $form=new Form($db); $userstatic=new User($db); +$formactions=new FormActions($db); $nav=''; $nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); @@ -227,6 +229,7 @@ if ($type) $sql.= " AND c.id = ".$type; if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started +if ($status == '100') { $sql.= " AND a.percent = 100"; } if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($search_title) $sql.=natural_search("a.label", $search_title); @@ -324,7 +327,6 @@ if ($resql) if ($optioncss != '') $nav.= ''; if ($actioncode) $nav.=''; if ($resourceid) $nav.=''; - if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; if ($filter) $nav.=''; if ($filtert) $nav.=''; if ($socid) $nav.=''; @@ -341,21 +343,7 @@ if ($resql) print '
'; print ''."\n"; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder); - //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre(""); - print "\n"; - - print ''; + print ''; print ''; print ''; print ''; @@ -368,13 +356,29 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; // Action column print ''; print "\n"; + + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder); + //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre(""); + print "\n"; $contactstatic = new Contact($db); $now=dol_now(); @@ -396,7 +400,7 @@ if ($resql) continue; } - $var=!$var; + $actionstatic->id=$obj->id; $actionstatic->ref=$obj->id; @@ -405,7 +409,7 @@ if ($resql) $actionstatic->type_picto=$obj->type_picto; $actionstatic->label=$obj->label; - print ""; + print ''; // Action (type) print '"; + + print ''; print "\n"; print ''; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index aa6c2729745..31def3d1b29 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -460,7 +460,7 @@ if ($id > 0) } else { - print $langs->trans("ThirdpartyNotLinkedToMember"); + print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; } print ''; print "\n"; @@ -639,8 +639,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print '"; + + print ''; print '"; + + print ''; print ''; print '
'; + print $formactions->form_select_status_action('formaction',$status,1,'status',1,2); + print ''; - $searchpitco=$form->showFilterAndCheckAddButtons(0); + $searchpitco=$form->showFilterButtons(); print $searchpitco; print '
'; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f5de3fa6ca3..61bf98634c4 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -242,10 +242,10 @@ $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $tmpday = $first_day; -$nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')."\n"; +$nav ="trans("Previous"))."\">   \n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week; $nav.=" \n"; -$nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')."\n"; +$nav.="   trans("Next"))."\">\n"; $nav.="   (".$langs->trans("Today").")"; $picto='calendarweek'; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 97f255abe14..760d82f0246 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -135,8 +135,8 @@ if ($resql) if ($obj) { - $var=!$var; - print "
".$obj->df."'.$obj->cc.'
'; $propal_static->id = $objp->propalid; $propal_static->ref = $objp->ref; @@ -723,8 +723,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print "
'; $commande_static->id = $objp->cid; $commande_static->ref = $objp->ref; @@ -850,8 +850,8 @@ if ($id > 0) $contrat=new Contrat($db); $objp = $db->fetch_object($resql); - $var=!$var; - print "
'; $contrat->id=$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id; @@ -906,7 +906,7 @@ if ($id > 0) print ''.img_picto($langs->trans("Statistics"),'stats').'
'; print ''; - $var=!$var; + } $i = 0; while ($i < $num && $i < $MAXLIST) @@ -916,13 +916,13 @@ if ($id > 0) $fichinter_static->id=$objp->id; $fichinter_static->statut=$objp->fk_statut; - print ""; + print ''; print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; //print ''.dol_print_date($db->jdate($objp->startdate)).''."\n"; print ''.convertSecondToTime($objp->duration).''."\n"; print ''.$fichinter_static->getLibStatut(5).''."\n"; print ''; - $var=!$var; + $i++; } $db->free($resql); @@ -978,8 +978,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print ''; $facturestatic->id = $objp->facid; $facturestatic->ref = $objp->facnumber; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 7b71e3ade9c..fe66e3ac243 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -150,9 +150,9 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''.img_object($langs->trans("ShowContact"),"contact"); print ' '.$obj->name.''; print "$obj->firstname"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index f8f987f1222..4bd999b1d5a 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -160,15 +160,15 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').''; + $var=true; if ($num > 0) { $i = 0; - $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; $propalstatic->ref_client=$obj->ref_client; @@ -192,14 +192,14 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoProposal").''; + + print ''.$langs->trans("NoProposal").''; } print "
"; @@ -241,15 +241,15 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos print ''; print ''.$langs->trans("SupplierProposalsDraft").($num?' '.$num.'':'').''; + $var=true; if ($num > 0) { $i = 0; - $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $supplierproposalstatic->id=$obj->rowid; $supplierproposalstatic->ref=$obj->ref; $supplierproposalstatic->total_ht = $obj->total_ht; @@ -272,14 +272,14 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoProposal").''; + + print ''.$langs->trans("NoProposal").''; } print "
"; @@ -320,15 +320,15 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print ''; print ''.$langs->trans("DraftOrders").($num?' '.$num.'':'').''; - if ($num) + $var = true; + if ($num > 0) { $i = 0; - $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ''; + print ''; $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; $orderstatic->ref_client=$obj->ref_client; @@ -352,14 +352,14 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoOrder").''; + + print ''.$langs->trans("NoOrder").''; } print "
"; @@ -401,15 +401,15 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande print ''; print ''.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').''; - if ($num) + $var = true; + if ($num > 0) { $i = 0; - $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ''; + print ''; $supplierorderstatic->id=$obj->rowid; $supplierorderstatic->ref=$obj->ref; $supplierorderstatic->ref_supplier=$obj->ref_suppliert; @@ -433,14 +433,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoSupplierOrder").''; + + print ''.$langs->trans("NoSupplierOrder").''; } print "
"; @@ -503,7 +503,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; $companystatic->canvas=$objp->canvas; - print ''; + print ''; print ''.$companystatic->getNomUrl(1,'customer',48).''; print ''; print $companystatic->getLibCustProspStatut(); @@ -511,7 +511,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) print ''.dol_print_date($db->jdate($objp->tms),'day').""; print ''; $i++; - $var=!$var; + } @@ -519,7 +519,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; } @@ -562,18 +562,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; $companystatic->canvas=$objp->canvas; - print ''; + print ''; print ''.$companystatic->getNomUrl(1,'supplier',44).''; print ''.dol_print_date($db->jdate($objp->dm),'day').''; print ''; - $var=!$var; + $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -647,7 +647,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO print $companystatic->getNomUrl(1,'customer',44); print ''."\n"; print "".$staticcontrat->LibStatut($obj->statut,3)."\n"; - $var=!$var; + $i++; } print "
"; @@ -695,8 +695,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; // Ref print ''; @@ -794,8 +794,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; // Ref print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 2ce6a638191..13ea930dc5e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -259,8 +259,8 @@ if (empty($reshook)) } // Fabrication du mail - $trackid=''; // TODO Define a trackid for mass emailing too. We can use source type for this. - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid); + $trackid='emailing-'.$obj2->source_type.$obj2->source_id; + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing'); if ($mail->error) { @@ -433,7 +433,8 @@ if (empty($reshook)) } } - $mailfile = new CMailFile($tmpsujet,$object->sendto,$object->email_from,$tmpbody, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css); + $trackid='emailingtest'; + $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing'); $result=$mailfile->sendfile(); if ($result) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 470ee2a4ec1..16f3f4db561 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -229,7 +229,7 @@ if ($object->fetch($id) >= 0) print "
"; - $var=!$var; + $allowaddtarget=($object->statut == 0); @@ -311,7 +311,7 @@ if ($object->fetch($id) >= 0) if ($qualified) { $var = !$var; - //print ''; + //print ''; // print '
'; if ($allowaddtarget) @@ -523,9 +523,9 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''.$obj->email.''; print ''.$obj->lastname.''; print ''.$obj->firstname.''; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 0ea109960e7..52eacf6c115 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -57,10 +57,10 @@ print '
'; print ''; print ''; print ''; - print ''; print ''; - print ''; print "
'.$langs->trans("SearchAMailing").'
'; + print '
'; print $langs->trans("Ref").':
'; + print '
'; print $langs->trans("Other").':

\n"; @@ -110,7 +110,7 @@ if (is_resource($handle)) foreach ($mailmodule->getSqlArrayForStats() as $sql) { - print ''; + print ''; $result=$db->query($sql); if ($result) @@ -176,9 +176,9 @@ if ($result) while ($i < $num ) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ''; print ''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''; print ''.dol_trunc($obj->titre,38).''; print ''.dol_print_date($db->jdate($obj->date_creat),'day').''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 2d6fae37b98..99af5749963 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -122,18 +122,7 @@ if ($result) print '
'; print ''."\n"; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder); - if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder); - if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); - else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; + print ''; print ''; @@ -151,17 +140,27 @@ if ($result) print ''; print "\n"; - $var=True; - + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder); + if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder); + if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); + else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; + + $email=new Mailing($db); while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ""; print ''; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9b70ee36ace..444669a6f49 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1516,7 +1516,7 @@ if ($action == 'create') // Public note print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '"; + + print ''; print ''; print ''; print "\n"; @@ -176,9 +176,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; @@ -236,10 +236,10 @@ if ($resql) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; + + print ''; // Ref print '"; + print ''; print '"; + print ''; print '"; } print "
'; print ''; print '
'; print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).''.$obj->titre.'
' . $langs->trans('NotePublic') . '' . $langs->trans('NotePublic') . ''; $note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null)); $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); @@ -1526,7 +1526,7 @@ if ($action == 'create') if (empty($user->societe_id)) { print '
' . $langs->trans('NotePrivate') . '' . $langs->trans('NotePrivate') . ''; $note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null)); $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 765179c3d63..3489860e1dd 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3027,7 +3027,7 @@ class Propal extends CommonObject $response->label = $label; $response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals'; $response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc'; - $response->img = img_object($langs->trans("Propals"),"propal"); + $response->img = img_object('',"propal"); // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 82978daf2c1..82244886763 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -92,7 +92,7 @@ if ($object->id > 0) dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal'); // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; foreach($filearray as $key => $file) { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 82d57f721da..145d1891be3 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -66,7 +66,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ''; print ''; - print ''; print "
'.$langs->trans("Search").'
'; + print '
'; print $langs->trans("Proposal").':

\n"; } @@ -122,8 +122,8 @@ if ($resql) $dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); if (! $conf->use_javascript_ajax) { - $var=!$var; - print "
'.$propalstatic->LibStatut($status,0).''.(isset($vals[$status])?$vals[$status]:0).'
'; $propalstatic->id=$obj->rowid; @@ -317,8 +317,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print '
'; @@ -405,9 +405,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print "
'; $propalstatic->id=$obj->rowid; @@ -477,9 +477,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print "
'; $propalstatic->id=$obj->rowid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index aa6df1afb2b..ce6d6e2bc72 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -556,49 +556,12 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + print '
'; print ''."\n"; - - // Fields title - print ''; - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder); - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } - } - // Hook fields - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); - print ''."\n"; - - print ''; + + print ''; if (! empty($arrayfields['p.ref']['checked'])) { print ''; print "\n"; + + // Fields title + print ''; + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print ''."\n"; + $now = dol_now(); $i=0; - $var=true; $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; + $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; - print ''; + print ''; if (! empty($arrayfields['p.ref']['checked'])) { @@ -779,7 +780,7 @@ if ($resql) print ''; } // Other picto tool - print ''; if (! $i) $totalarray['nbfield']++; @@ -977,7 +978,12 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield'])) + if (isset($totalarray['totalhtfield']) + || isset($totalarray['totalvatfield']) + || isset($totalarray['totalttcfield']) + || isset($totalarray['totalamfield']) + || isset($totalarray['totalrtpfield']) + ) { print ''; $i=0; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 04c1af11e1d..abb24b8ffa4 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -242,7 +242,7 @@ $h++; complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats'); -dol_fiche_head($head,'byyear',$langs->trans("Statistics")); +dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; @@ -300,7 +300,7 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print '
'; print ''; print ''; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index dd325da7297..f797025a5de 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -40,7 +40,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index b68bdb9135e..2364672ccf9 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -58,9 +58,9 @@ if (! empty($conf->propal->enabled)) print ''; print '
'; @@ -733,25 +696,63 @@ if ($resql) } // Action column print ''; - $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + $searchpitco=$form->showFilterButtons(); print $searchpitco; print '
'; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -807,7 +808,7 @@ if ($resql) // Thirdparty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; print $companystatic->getNomUrl(1,'customer'); print '
0?'&userid='.$userid:'').'">'.$oldyear.'0
'; print ''; - print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("SearchAProposal").'
'; + print '
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; } @@ -96,8 +96,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print '
'; + + print '
'; print ''; print img_action($langs->trans("Show"),$obj->id).' '; print $langs->trans("StatusProspect".$obj->id); @@ -140,8 +140,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print '
'; + + print '
'; print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.''; print ''; print price($obj->price); @@ -150,7 +150,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $total += $obj->price; } if ($total>0) { - $var=!$var; + print '
'.$langs->trans("Total")."".price($total)."

"; @@ -205,8 +205,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.''; @@ -263,8 +263,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index cf93c87dabb..2be1981c5ae 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -107,7 +107,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company'); + dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), 0, 'company'); dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); @@ -119,7 +119,6 @@ if ($socid > 0) // Discount print ''; print $langs->trans("CustomerRelativeDiscount").''.price2num($object->remise_percent)."%"; - print ''; print '
'; @@ -130,11 +129,11 @@ if ($socid > 0) print ''; // New value - print ''; // Motif/Note - print ''; print "
'; + print '
'; print $langs->trans("NewValue").'%
'; + print '
'; print $langs->trans("NoteReason").'
"; @@ -179,21 +178,26 @@ if ($socid > 0) print ''.$langs->trans("NoteReason").''; print ''.$langs->trans("User").''; print ''; - $i = 0 ; $num = $db->num_rows($resql); - - while ($i < $num ) - { - $obj = $db->fetch_object($resql); - $tag = !$tag; - print ''; - print ''.dol_print_date($db->jdate($obj->dc),"dayhour").''; - print ''.price2num($obj->remise_percent).'%'; - print ''.$obj->note.''; - print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; - print ''; - $i++; + if ($num > 0) + { + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + print ''; + print ''.dol_print_date($db->jdate($obj->dc),"dayhour").''; + print ''.price2num($obj->remise_percent).'%'; + print ''.$obj->note.''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; + print ''; + $i++; + } } + else + { + print ''.$langs->trans("None").''; + } $db->free($resql); print ""; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 8c35c6c9e1f..375b4d0ecb8 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -92,7 +92,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount2->fk_facture=$discount->fk_facture; $newdiscount1->fk_facture_line=$discount->fk_facture_line; $newdiscount2->fk_facture_line=$discount->fk_facture_line; - if ($discount->description == '(CREDIT_NOTE)') + if ($discount->description == '(CREDIT_NOTE)' || $discount->description == '(DEPOSIT)') { $newdiscount1->description=$discount->description; $newdiscount2->description=$discount->description; @@ -235,7 +235,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company'); + dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company'); dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); @@ -274,6 +274,8 @@ if ($socid > 0) } print ''; + print '
'; + if ($user->rights->societe->creer) { print '
'; @@ -294,7 +296,6 @@ if ($socid > 0) print ""; } - print '
'; dol_fiche_end(); @@ -342,8 +343,8 @@ if ($socid > 0) print load_fiche_titre($langs->trans("DiscountStillRemaining")); print ''; print ''; - print ''; // Need 120+ for format with AM/PM - print ''; + print ''; // Need 120+ for format with AM/PM + print ''; print ''; print ''; print ''; @@ -354,73 +355,79 @@ if ($socid > 0) $showconfirminfo=array(); - $var = true; $i = 0; $num = $db->num_rows($resql); - while ($i < $num) + if ($num > 0) { - $obj = $db->fetch_object($resql); - $var = !$var; - print ""; - print ''; - if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) - { - print ''; - } - elseif (preg_match('/\(DEPOSIT\)/',$obj->description)) - { - print ''; - } - elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description)) - { - print ''; - } - else - { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - if ($user->rights->societe->creer || $user->rights->facture->creer) - { - print ''; - } - else print ''; - print ''; - - if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid) - { - $showconfirminfo['rowid']=$obj->rowid; - $showconfirminfo['amount_ttc']=$obj->amount_ttc; - } - $i++; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + print ''; + print ''; + if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) + { + print ''; + } + elseif (preg_match('/\(DEPOSIT\)/',$obj->description)) + { + print ''; + } + elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description)) + { + print ''; + } + else + { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + if ($user->rights->societe->creer || $user->rights->facture->creer) + { + print ''; + } + else print ''; + print ''; + + if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid) + { + $showconfirminfo['rowid']=$obj->rowid; + $showconfirminfo['amount_ttc']=$obj->amount_ttc; + } + $i++; + } } + else + { + print ''; + } $db->free($resql); print "
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").'
'.dol_print_date($db->jdate($obj->dc),'dayhour').''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - print $obj->description; - print ''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; - print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; - print ''; - print 'rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').''; - print '   '; - print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; - print ' 
'.dol_print_date($db->jdate($obj->dc),'dayhour').''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + print $obj->description; + print ''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; + print ''; + print 'rowid.'">'.img_split($langs->trans("SplitDiscount")).''; + print '   '; + print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; + print ' 
'.$langs->trans("None").'
"; @@ -491,8 +498,8 @@ if ($socid > 0) print load_fiche_titre($langs->trans("DiscountAlreadyCounted")); print ''; print ''; - print ''; // Need 120+ for format with AM/PM - print ''; + print ''; // Need 120+ for format with AM/PM + print ''; print ''; print ''; print ''; @@ -501,15 +508,17 @@ if ($socid > 0) print ''; print ''; - $var = true; $tab_sqlobj=array(); $tab_sqlobjOrder=array(); $num = $db->num_rows($resql); - for ($i = 0;$i < $num;$i++) + if ($num > 0) { - $sqlobj = $db->fetch_object($resql); - $tab_sqlobj[] = $sqlobj; - $tab_sqlobjOrder[]=$db->jdate($sqlobj->dc); + for ($i = 0;$i < $num; $i++) + { + $sqlobj = $db->fetch_object($resql); + $tab_sqlobj[] = $sqlobj; + $tab_sqlobjOrder[]=$db->jdate($sqlobj->dc); + } } $db->free($resql); @@ -524,57 +533,64 @@ if ($socid > 0) array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj); $num = count($tab_sqlobj); - $i = 0 ; - while ($i < $num ) + if ($num > 0) { - $obj = array_shift($tab_sqlobj); - $var = !$var; - print ""; - print ''; - if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) - { - print ''; - } - elseif (preg_match('/\(DEPOSIT\)/',$obj->description)) - { - print ''; - } - elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description)) - { - print ''; - } - else - { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $i++; + $i = 0 ; + while ($i < $num ) + { + $obj = array_shift($tab_sqlobj); + print ''; + print ''; + if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) + { + print ''; + } + elseif (preg_match('/\(DEPOSIT\)/',$obj->description)) + { + print ''; + } + elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description)) + { + print ''; + } + else + { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $i++; + } } + else + { + print ''; + } + print "
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").' 
'.dol_print_date($db->jdate($obj->dc),'dayhour').''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; - print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); - print ''; - print $obj->description; - print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; - print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; - print ' 
'.dol_print_date($db->jdate($obj->dc),'dayhour').''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + $facturestatic->id=$obj->fk_facture_source; + $facturestatic->ref=$obj->ref; + $facturestatic->type=$obj->type; + print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); + print ''; + print $obj->description; + print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; + print ' 
'.$langs->trans("None").'
"; } else diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index cf14e1cac48..e369a1a7217 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1255,10 +1255,6 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; - /* - * Send mail - */ - // Actions to send emails $actiontypecode='AC_COM'; $trigger_name='ORDER_SENTBYMAIL'; @@ -1769,7 +1765,7 @@ if ($action == 'create' && $user->rights->commande->creer) $res = $object->fetch_optionals($object->id, $extralabels); $head = commande_prepare_head($object); - dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order'); + dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); $formconfirm = ''; @@ -2589,7 +2585,6 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // ancre // Documents $comref = dol_sanitizeFileName($object->ref); - $file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf'; $relativepath = $comref . '/' . $comref . '.pdf'; $filedir = $conf->commande->dir_output . '/' . $comref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; @@ -2651,6 +2646,7 @@ if ($action == 'create' && $user->rights->commande->creer) $file = $fileparams['fullname']; } + print '
'; print '
'; print '
'; print load_fiche_titre($langs->trans('SendOrderByMail')); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7bad08b2f84..e87923beb8c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3102,6 +3102,8 @@ class Commande extends CommonOrder $error = 0; + dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); + $this->db->begin(); if (! $error && ! $notrigger) @@ -3117,7 +3119,6 @@ class Commande extends CommonOrder { // Delete order details $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { $error++; @@ -3126,7 +3127,6 @@ class Commande extends CommonOrder // Delete order $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { $error++; @@ -3184,7 +3184,6 @@ class Commande extends CommonOrder if (! $error) { - dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); $this->db->commit(); return 1; } @@ -3192,7 +3191,6 @@ class Commande extends CommonOrder { foreach($this->errors as $errmsg) { - dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); $this->error.=($this->error?', '.$errmsg:$errmsg); } $this->db->rollback(); @@ -3233,7 +3231,7 @@ class Commande extends CommonOrder $response->warning_delay=$conf->commande->client->warning_delay/60/60/24; $response->label=$langs->trans("OrdersToProcess"); $response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders'; - $response->img=img_object($langs->trans("Orders"),"order"); + $response->img=img_object('',"order"); $generic_commande = new Commande($this->db); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index f693d09da52..bc257f3ac05 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -143,7 +143,7 @@ if ($id > 0 || ! empty($ref)) $object->fetch_thirdparty(); $head = commande_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order'); + dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); // Order card diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 5f9a5a570ff..b5672f276e7 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -155,9 +155,9 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''; $result=''; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 5ce456fe8e0..ef4f220f3e4 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -92,10 +92,10 @@ if ($id > 0 || ! empty($ref)) $upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref); $head = commande_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order'); + dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), -1, 'order'); // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; foreach($filearray as $key => $file) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index f24202f7fff..9f7f36f78ca 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -70,7 +70,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ''; print ''; - print ''; print "
'.$langs->trans("Search").'
'; + print '
'; print $langs->trans("CustomerOrder").':

\n"; } @@ -141,8 +141,8 @@ if ($resql) { if (! $conf->use_javascript_ajax) { - $var=!$var; - print ""; + + print ''; print ''.$commandestatic->LibStatut($status,$bool,0).''; print ''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print $commandestatic->LibStatut($status,$bool,3); @@ -196,7 +196,7 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); $commandestatic->id=$obj->rowid; @@ -208,7 +208,7 @@ if (! empty($conf->commande->enabled)) $companystatic->code_client=$obj->code_client; $companystatic->canvas=$obj->canvas; - print ""; + print ''; print ''; print $commandestatic->getNomUrl(1); print ""; @@ -220,8 +220,8 @@ if (! empty($conf->commande->enabled)) } else { - $var=!$var; - print ''.$langs->trans("NoOrder").''; + + print ''.$langs->trans("NoOrder").''; } print "
"; } @@ -268,10 +268,10 @@ if ($resql) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; @@ -349,9 +349,9 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; @@ -431,9 +431,9 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 9ee0e85e73e..02b631c4c8a 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -61,7 +61,7 @@ $object->fetch_thirdparty(); $object->info($object->id); $head = commande_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order'); +dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order'); // Order card diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f92836599de..4185518b721 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -199,227 +199,226 @@ if (empty($reshook)) $permtodelete = $user->rights->commande->supprimer; $uploaddir = $conf->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} - -if ($massaction == 'confirm_createbills') { - - $orders = GETPOST('toselect'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('valdate_invoices', 'int'); - - $TFact = array(); - $TFactThird = array(); - - $nb_bills_created = 0; - - $db->begin(); - - foreach($orders as $id_order) { - - $cmd = new Commande($db); - if($cmd->fetch($id_order) <= 0) continue; - - $object = new Facture($db); - if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. - else { - - $object->socid = $cmd->socid; - $object->type = Facture::TYPE_STANDARD; - $object->cond_reglement_id = $cmd->cond_reglement_id; - $object->mode_reglement_id = $cmd->mode_reglement_id; - $object->fk_project = $cmd->fk_project; - - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) - { - $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); - } - - $object->date = $datefacture; - $object->origin = 'commande'; - $object->origin_id = $id_order; - - $res = $object->create($user); - - if($res > 0) $nb_bills_created++; - - } - - if($object->id > 0) { - - $db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; - $sql.= "fk_source"; - $sql.= ", sourcetype"; - $sql.= ", fk_target"; - $sql.= ", targettype"; - $sql.= ") VALUES ("; - $sql.= $id_order; - $sql.= ", '".$object->origin."'"; - $sql.= ", ".$object->id; - $sql.= ", '".$object->element."'"; - $sql.= ")"; - - if ($db->query($sql)) - { - $db->commit(); - } - else - { - $db->rollback(); - } - - $lines = $cmd->lines; - if (empty($lines) && method_exists($cmd, 'fetch_lines')) - { - $cmd->fetch_lines(); - $lines = $cmd->lines; - } - - $fk_parent_line=0; - $num=count($lines); - - for ($i=0;$i<$num;$i++) - { - $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); - if ($lines[$i]->subprice < 0) - { - // Negative line, we create a discount line - $discount = new DiscountAbsolute($db); - $discount->fk_soc=$object->socid; - $discount->amount_ht=abs($lines[$i]->total_ht); - $discount->amount_tva=abs($lines[$i]->total_tva); - $discount->amount_ttc=abs($lines[$i]->total_ttc); - $discount->tva_tx=$lines[$i]->tva_tx; - $discount->fk_user=$user->id; - $discount->description=$desc; - $discountid=$discount->create($user); - if ($discountid > 0) - { - $result=$object->insert_discount($discountid); - //$result=$discount->link_to_invoice($lineid,$id); - } - else - { - setEventMessages($discount->error, $discount->errors, 'errors'); - $error++; - break; - } - } - else - { - // Positive line - $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - // Date start - $date_start=false; - if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue; - if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; - if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; - //Date end - $date_end=false; - if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue; - if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; - if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; - // Reset fk_parent_line for no child products and special product - if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) - { - $fk_parent_line = 0; - } - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $date_start, - $date_end, - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_remise_except, - 'HT', - 0, - $product_type, - $ii, - $lines[$i]->special_code, - $object->origin, - $lines[$i]->rowid, - $fk_parent_line, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - $lines[$i]->label - ); - if ($result > 0) - { - $lineid=$result; - } - else - { - $lineid=0; - $error++; - break; - } - // Defined the new fk_parent_line - if ($result > 0 && $lines[$i]->product_type == 9) - { - $fk_parent_line = $result; - } - } - } - - } - - $cmd->classifyBilled($user); - - if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; - else $TFact[$object->id] = $object; - } - - // Build doc with all invoices - $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; - $toselect = array(); - - if(!empty($validate_invoices)) { - - $massaction = $action = 'builddoc'; - - foreach($TAllFact as &$object) { - $object->validate($user); - $toselect[] = $object->id; // For builddoc action - - // Fac builddoc - $upload_dir = $conf->facture->dir_output; - $permissioncreate=$user->rights->facture->creer; - include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - } - - $objectclass='Facture'; - $objectlabel='Invoice'; - $permtoread = $user->rights->facture->lire; - $permtodelete = $user->rights->facture->supprimer; - $uploaddir = $conf->facture->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - - } - - if (! $error) - { - $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); - } - else - { - $db->rollback(); - $action='create'; - $_GET["origin"]=$_POST["origin"]; - $_GET["originid"]=$_POST["originid"]; - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - + // TODO Move this into mass action include + if ($massaction == 'confirm_createbills') { + + $orders = GETPOST('toselect'); + $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); + $validate_invoices = GETPOST('valdate_invoices', 'int'); + + $TFact = array(); + $TFactThird = array(); + + $nb_bills_created = 0; + + $db->begin(); + + foreach($orders as $id_order) { + + $cmd = new Commande($db); + if($cmd->fetch($id_order) <= 0) continue; + + $object = new Facture($db); + if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. + else { + + $object->socid = $cmd->socid; + $object->type = Facture::TYPE_STANDARD; + $object->cond_reglement_id = $cmd->cond_reglement_id; + $object->mode_reglement_id = $cmd->mode_reglement_id; + $object->fk_project = $cmd->fk_project; + + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($datefacture)) + { + $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); + } + + $object->date = $datefacture; + $object->origin = 'commande'; + $object->origin_id = $id_order; + + $res = $object->create($user); + + if($res > 0) $nb_bills_created++; + + } + + if($object->id > 0) { + + $db->begin(); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; + $sql.= "fk_source"; + $sql.= ", sourcetype"; + $sql.= ", fk_target"; + $sql.= ", targettype"; + $sql.= ") VALUES ("; + $sql.= $id_order; + $sql.= ", '".$object->origin."'"; + $sql.= ", ".$object->id; + $sql.= ", '".$object->element."'"; + $sql.= ")"; + + if ($db->query($sql)) + { + $db->commit(); + } + else + { + $db->rollback(); + } + + $lines = $cmd->lines; + if (empty($lines) && method_exists($cmd, 'fetch_lines')) + { + $cmd->fetch_lines(); + $lines = $cmd->lines; + } + + $fk_parent_line=0; + $num=count($lines); + + for ($i=0;$i<$num;$i++) + { + $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + if ($lines[$i]->subprice < 0) + { + // Negative line, we create a discount line + $discount = new DiscountAbsolute($db); + $discount->fk_soc=$object->socid; + $discount->amount_ht=abs($lines[$i]->total_ht); + $discount->amount_tva=abs($lines[$i]->total_tva); + $discount->amount_ttc=abs($lines[$i]->total_ttc); + $discount->tva_tx=$lines[$i]->tva_tx; + $discount->fk_user=$user->id; + $discount->description=$desc; + $discountid=$discount->create($user); + if ($discountid > 0) + { + $result=$object->insert_discount($discountid); + //$result=$discount->link_to_invoice($lineid,$id); + } + else + { + setEventMessages($discount->error, $discount->errors, 'errors'); + $error++; + break; + } + } + else + { + // Positive line + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + // Date start + $date_start=false; + if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; + //Date end + $date_end=false; + if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; + // Reset fk_parent_line for no child products and special product + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) + { + $fk_parent_line = 0; + } + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start, + $date_end, + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_remise_except, + 'HT', + 0, + $product_type, + $ii, + $lines[$i]->special_code, + $object->origin, + $lines[$i]->rowid, + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + $lines[$i]->label + ); + if ($result > 0) + { + $lineid=$result; + } + else + { + $lineid=0; + $error++; + break; + } + // Defined the new fk_parent_line + if ($result > 0 && $lines[$i]->product_type == 9) + { + $fk_parent_line = $result; + } + } + } + + } + + $cmd->classifyBilled($user); + + if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; + else $TFact[$object->id] = $object; + } + + // Build doc with all invoices + $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; + $toselect = array(); + + if(!empty($validate_invoices)) { + + $massaction = $action = 'builddoc'; + + foreach($TAllFact as &$object) { + $object->validate($user); + $toselect[] = $object->id; // For builddoc action + + // Fac builddoc + $upload_dir = $conf->facture->dir_output; + $permissioncreate=$user->rights->facture->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + } + + $objectclass='Facture'; + $objectlabel='Invoice'; + $permtoread = $user->rights->facture->lire; + $permtodelete = $user->rights->facture->supprimer; + $uploaddir = $conf->facture->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + } + + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + } + else + { + $db->rollback(); + $action='create'; + $_GET["origin"]=$_POST["origin"]; + $_GET["originid"]=$_POST["originid"]; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } } @@ -435,8 +434,9 @@ $formfile = new FormFile($db); $companystatic = new Societe($db); $formcompany=new FormCompany($db); +$title=$langs->trans("Orders"); $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; -llxHeader('',$langs->trans("Orders"),$help_url); +llxHeader('',$title,$help_url); $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; @@ -563,8 +563,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) } $sql.= $db->plimit($limit + 1,$offset); - //print $sql; + $resql = $db->query($sql); if ($resql) { @@ -622,7 +622,6 @@ if ($resql) if ($show_files) $param.='&show_files=' .$show_files; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($billed != '') $param.='&billed='.$billed; - // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -654,6 +653,7 @@ if ($resql) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + // TODO Move this into an invluce if ($massaction == 'presend') { $langs->load("mails"); @@ -679,9 +679,6 @@ if ($resql) print ''; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - dol_fiche_head(null, '', ''); $topicmail="SendOrderRef"; @@ -789,7 +786,6 @@ if ($resql) print ''; print '
'; print '
'; - } if ($sall) @@ -841,49 +837,12 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + print '
'; print ''."\n"; - // Fields title - print ''; - if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'],$_SERVER["PHP_SELF"],'c.ref','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'],$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'],$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'],$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$sortfield,$sortorder); - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } - } - // Hook fields - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,''); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); - print ''."\n"; - - print ''; + print ''; // Ref if (! empty($arrayfields['c.ref']['checked'])) { @@ -1030,12 +989,50 @@ if ($resql) } // Action column print ''; print "\n"; + // Fields title + print ''; + if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'],$_SERVER["PHP_SELF"],'c.ref','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'],$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'],$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'],$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,''); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print ''."\n"; + $total=0; $subtotal=0; $productstat_cache=array(); @@ -1044,13 +1041,12 @@ if ($resql) $generic_product = new Product($db); $i=0; - $var=true; $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $notshippable=0; $warning = 0; @@ -1223,7 +1219,7 @@ if ($resql) // Third party if (! empty($arrayfields['s.nom']['checked'])) { - print ''; $i=0; @@ -1424,8 +1425,6 @@ if ($resql) print ''."\n"; - //print '
'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'
'; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { /* @@ -1436,7 +1435,7 @@ if ($resql) $filedir=$diroutputmassaction; $genallowed=$user->rights->commande->lire; - $delallowed=$user->rights->commande->lire; + $delallowed=$user->rights->commande->supprimer; print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } @@ -1451,6 +1450,5 @@ else dol_print_error($db); } -// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 4d53d8e8d50..79475c75917 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -75,7 +75,7 @@ if ($id > 0 || ! empty($ref)) $head = commande_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order'); + dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order'); // Order card diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 17c73c82698..c6b93cb8f0f 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -653,8 +653,8 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) while ($i < $num) { $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; @@ -335,7 +335,7 @@ foreach ($data as $val) print ''; } - $var=!$var; + print ''; print ''; print ''; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 38efbc91ca2..629cd3c0fb0 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index af63247f48d..cb10fd8c3c7 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -144,7 +144,7 @@ else // Onglets $head=bank_prepare_head($object); -dol_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0,'account'); +dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1, 'account'); $title=$langs->trans("FinancialAccount")." : ".$object->label; $link=($year_start?"".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"')."":""); @@ -203,8 +203,8 @@ print ''; $var=true; for ($mois = 1 ; $mois < 13 ; $mois++) { - $var=!$var; - print ''; + + print ''; print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index de0e6d70b4c..bddf1292214 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -177,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (GETPOST("button_removefilter_x") || 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_dt_start=''; $search_dt_end=''; @@ -297,7 +298,7 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier) if (! $error) { $object->fetch($id); - $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); + $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user); if ($insertid > 0) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); @@ -396,40 +397,37 @@ if ($id > 0 || ! empty($ref)) foreach ($bankcateg->fetchAll() as $bankcategory) { $options[$bankcategory->id] = $bankcategory->label; } - + // Bank card - $head=bank_prepare_head($object); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); - + $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - + dol_fiche_end(); - - /* * Buttons actions */ - if ($action != 'addline' && $action != 'reconcile') + if ($action != 'reconcile') { print '
'; - - if ($action != 'addline') - { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) - { - if ($user->rights->banque->modifier) { - print ''.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } + + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + else + { + print ''.$langs->trans("AddBankRecord").''; + } + if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { @@ -640,49 +638,6 @@ if ($resql) // print '
'; - $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + $searchpitco=$form->showFilterButtons(); print $searchpitco; print '
'; + print ''; print $companystatic->getNomUrl(1,'customer'); // If module invoices enabled and user with invoice creation permissions @@ -1393,7 +1389,12 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield'])) + if (isset($totalarray['totalhtfield']) + || isset($totalarray['totalvatfield']) + || isset($totalarray['totalttcfield']) + || isset($totalarray['totalamfield']) + || isset($totalarray['totalrtpfield']) + ) { print '
'; $generic_commande->id=$objp->rowid; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index d900709b835..dd79ee54ba1 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -253,7 +253,7 @@ if ($mode == 'supplier') $type='supplier_order_stats'; complete_head_from_modules($conf,$langs,null,$head,$h,$type); -dol_fiche_head($head,'byyear',$langs->trans("Statistics")); +dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; @@ -323,7 +323,7 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print '
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'
".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B")."
'; } - // Form to add a transaction with no invoice - if ($user->rights->banque->modifier && $action == 'addline') - { - print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Date").' '.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").' 
'; - $form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction'); - print ''; - $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1); - print ''; - print ''; - print ''; - if ($options) { - print '
'.$langs->trans("Rubrique").': '; - print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); - } - print '
'; - print '
'; - print ''; - print '
'; - print '
'; - } - - /// ajax to adjust value date with plus and less picto print ' '; + + return $out; + } + /** * Return HTML to show the search and clear seach button * @@ -6169,31 +6262,10 @@ class Form */ function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0) { - global $conf, $langs; - - $out='
'; - $out.=''; - $out.=''; - $out.='
'; + $out.=$this->showFilterButtons(); if ($addcheckuncheckall) { - if (! empty($conf->use_javascript_ajax)) $out.=''; - $out.=''; + $out.=$this->showCheckAddButtons($cssclass, $calljsfunction); } return $out; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b44f854087c..b799e0e2359 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -120,7 +120,7 @@ class FormActions { //var_dump($selected); if ($selected == 'done') $selected='100'; - print ''; if ($showempty) print ''; foreach($listofstatus as $key => $val) { @@ -207,8 +207,8 @@ class FormActions $ref=$action->getNomUrl(1,-1); $label=$action->getNomUrl(0,38); - $var=!$var; - print ''; + + print ''; print ''.$ref.''; print ''.$label.''; print ''.$action->type.''; diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index ace00b77caa..f4902e4912e 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -66,6 +66,7 @@ class FormContract //if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")"; if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; + $sql.= " ORDER BY c.ref "; dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); $resql=$db->query($sql); @@ -129,6 +130,14 @@ class FormContract } print ''; $db->free($resql); + + if (!empty($conf->use_javascript_ajax)) + { + // Make select dynamic + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + print ajax_combobox($htmlname); + } + return $num; } else diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 802b547eae8..8d90892cfb6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -89,6 +89,11 @@ class FormFile } else { + //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed + if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { + return 1; + } + $maxlength=$size; $out = "\n\n\n"; @@ -229,7 +234,7 @@ class FormFile * @param integer $allowgenifempty Show warning if no model activated * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) * @param int $iconPDF Show only PDF icon with link (1/0) - * @param int $maxfilenamelength Max length for filename shown + * @param int $notused Not used * @param integer $noform Do not output html form tags * @param string $param More param on http links * @param string $title Title to show on top of form @@ -238,10 +243,10 @@ class FormFile * @return int <0 if KO, number of shown files if OK * @deprecated Use print xxx->showdocuments() instead. */ - function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') { $this->numoffiles=0; - print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang); + print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); return $this->numoffiles; } @@ -259,7 +264,7 @@ class FormFile * @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) * @param int $iconPDF Deprecated, see getDocumentsLink - * @param int $maxfilenamelength Max length for filename shown + * @param int $notused Not used * @param integer $noform Do not output html form tags * @param string $param More param on http links * @param string $title Title to show on top of form @@ -269,7 +274,7 @@ class FormFile * @param Object $object Object when method is called from an object card. * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null) + function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null) { // Deprecation warning if (0 !== $iconPDF) { @@ -297,7 +302,6 @@ class FormFile $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; - $var=true; $headershown=0; $showempty=0; @@ -308,7 +312,7 @@ class FormFile if (preg_match('/massfilesarea_/', $modulepart)) { - $out.='
'; + $out.='

'; $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')'; $title.=' -
+\n"; - //$form=new Form($db); - // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -1403,7 +1405,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logouthtmltext.=$langs->trans("Logout").'
'; $logouttext .=''; - $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + $logouttext .=''; $logouttext .=''; } else @@ -1427,6 +1430,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.='
'; $toprightmenu.=''; + $arrayofselected=is_array($toselect)?$toselect:array(); + + + // List of variants + print ''; + + + // List of mass actions available + /* + $arrayofmassactions = array( + 'presend'=>$langs->trans("SendByMail"), + 'builddoc'=>$langs->trans("PDFMerge"), + ); + if ($user->rights->product->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + */ + + $aaa=''; + if (count($productCombinations)) + { + $aaa = ''; + $aaa .= ''; + $aaa .= ''; + $aaa .= ''; + } + $massactionbutton = $aaa; + + $title = $langs->trans("ProductCombinations"); + + print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $aaa, 0); + + print '
'; ?> - - - - - - - - - + + + + + + + + '; + $searchpitco=$form->showCheckAddButtons('checkforselect', 1); + print $searchpitco; + print ''; + ?> fetch($currcomb->fk_product_child); ?> - > - + - - + + - + '; + if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($prodstatic->id, $arrayofselected)) $selected=1; + print ''; + } + print ''; + ?>
- - - - trans('Product') ?>trans('Combination') ?>trans('PriceImpact') ?>trans('WeightImpact') ?>trans('OnSell') ?>trans('OnBuy') ?>trans('Product') ?>trans('Combination') ?>trans('PriceImpact') ?>trans('WeightImpact') ?>trans('OnSell') ?>trans('OnBuy') ?>
getNomUrl(1) ?> variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?>variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?>variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?>variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?> getLibStatut(2, 0) ?> getLibStatut(2, 1) ?> - - + + +
- - - - '; + print ''; } } llxFooter(); + +$db->close(); diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index b709f240551..7b0358fd176 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -130,6 +130,8 @@ if ($_POST) { } } + + /* * View */ @@ -140,37 +142,21 @@ if (! empty($id) || ! empty($ref)) { llxHeader("", "", $langs->trans("CardProduct".$object->type)); - if ($result) { - $head = product_prepare_head($object); - $titre = $langs->trans("CardProduct".$object->type); - $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); - + if ($result > 0) + { + $showbarcode=empty($conf->barcode->enabled)?0:1; + if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; + + $head=product_prepare_head($object); + $titre=$langs->trans("CardProduct".$object->type); + $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'combinations', $titre, 0, $picto); - - print ''; - - // Reference - print ''; - print ''; - print ''; - - // Label - print ''; - - // Status (to sell) - print ''; - - // Status (to buy) - print ''; - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', '', 0); - print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - print $object->getLibStatut(2, 0); - print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $object->getLibStatut(2, 1); - print '
'; - + + $linkback = ''.$langs->trans("BackToList").''; + $object->next_prev_filter=" fk_product_type = ".$object->type; + + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); + dol_fiche_end(); } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 6fa65660df1..f69c7e4e4aa 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -35,7 +35,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); 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"] == 'mycompany' || $_GET["modulepart"] == 'companylogo')) && ! defined("NOLOGIN")) define("NOLOGIN",'1'); if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) { define("NOLOGIN",'1'); @@ -179,7 +179,7 @@ else // Open and return file dol_syslog("viewimage.php return file $original_file content-type=$type"); // This test is to avoid error images when image is not available (for example thumbs). - if (! dol_is_file($original_file)) + if (! dol_is_file($original_file) && empty($_GET["noalt"])) { $original_file=DOL_DOCUMENT_ROOT.'/public/theme/common/nophoto.png'; /*$error='Error: File '.$_GET["file"].' does not exists or filesystems permissions are not allowed'; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 385c7dc3b95..cf926c6409e 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -872,7 +872,7 @@ function deleteProductOrService($authentication,$listofidstring) } else { - $result=$newobject->delete(); + $result=$newobject->delete($user); if ($result <= 0) { $error++; diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index e6bfec0d84a..b55f81f5b7f 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2016-2017 Laurent Destailleur * * 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 @@ -143,6 +143,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain */ if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid. +if (GETPOST('refreshpage')) $action='preview'; + // Add page if ($action == 'add') @@ -434,7 +436,7 @@ if ($action == 'updatemeta') } // Update page -if ($action == 'updatecontent') +if ($action == 'updatecontent' || GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview')) { $db->begin(); $object->fetch(0, $website); @@ -444,110 +446,123 @@ if ($action == 'updatecontent') $res = $objectpage->fetch($pageid, $object->fk_website); if ($res > 0) { - $objectpage->content = GETPOST('PAGE_CONTENT'); - - // Clean data. We remove all the head section. - $objectpage->content = preg_replace('//s', '', $objectpage->content); - /* $objectpage->content = preg_replace('//s', '', $objectpage->content); */ - - $res = $objectpage->update($user); - if ($res < 0) + if ($action == 'updatecontent') { - $error++; - setEventMessages($objectpage->error, $objectpage->errors, 'errors'); - } - - if (! $error) - { - $db->commit(); - - $filemaster=$pathofwebsite.'/master.inc.php'; - //$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php'; - $filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php'; - - dol_mkdir($pathofwebsite); - - - // Now generate the master.inc.php page - dol_syslog("We regenerate the master file"); - dol_delete_file($filemaster); - - $mastercontent = ''."\n"; - $result = file_put_contents($filemaster, $mastercontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filemaster, octdec($conf->global->MAIN_UMASK)); - - if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); - - - // Now generate the alias.php page - if (! empty($fileoldalias)) - { - dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias); - dol_delete_file($fileoldalias); - } + $objectpage->content = GETPOST('PAGE_CONTENT'); + + // Clean data. We remove all the head section. + $objectpage->content = preg_replace('//s', '', $objectpage->content); + /* $objectpage->content = preg_replace('//s', '', $objectpage->content); */ - $aliascontent = 'id.".tpl.php';\n"; - $aliascontent.= '?>'."\n"; - $result = file_put_contents($filealias, $aliascontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filealias, octdec($conf->global->MAIN_UMASK)); - - if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors'); - - - // Now create the .tpl file with code to be able to make dynamic changes - dol_delete_file($filetpl); - - $tplcontent =''; - $tplcontent.= "\n"; - $tplcontent.= ''."\n"; - $tplcontent.= '
'."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; - $tplcontent.= ''.dol_escape_htmltag($objectpage->title).''."\n"; - $tplcontent.= '
'."\n"; - - $tplcontent.= ''."\n"; - $tplcontent.= $objectpage->content."\n"; - $tplcontent.= ''."\n"; - - $tplcontent.= '"."\n"; - - //var_dump($filetpl);exit; - $result = file_put_contents($filetpl, $tplcontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filetpl, octdec($conf->global->MAIN_UMASK)); - - if ($result) - { - setEventMessages($langs->trans("Saved"), null, 'mesgs'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid); - exit; - } - else setEventMessages('Failed to write file '.$filetpl, null, 'errors'); - } - else - { - $db->rollback(); - } + $res = $objectpage->update($user); + if ($res < 0) + { + $error++; + setEventMessages($objectpage->error, $objectpage->errors, 'errors'); + } + + if (! $error) + { + $db->commit(); + + $filemaster=$pathofwebsite.'/master.inc.php'; + //$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php'; + $filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php'; + + dol_mkdir($pathofwebsite); + + + // Now generate the master.inc.php page + dol_syslog("We regenerate the master file"); + dol_delete_file($filemaster); + + $mastercontent = ''."\n"; + $result = file_put_contents($filemaster, $mastercontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filemaster, octdec($conf->global->MAIN_UMASK)); + + if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); + + + // Now generate the alias.php page + if (! empty($fileoldalias)) + { + dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias); + dol_delete_file($fileoldalias); + } + + $aliascontent = 'id.".tpl.php';\n"; + $aliascontent.= '?>'."\n"; + $result = file_put_contents($filealias, $aliascontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filealias, octdec($conf->global->MAIN_UMASK)); + + if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors'); + + + // Now create the .tpl file with code to be able to make dynamic changes + dol_delete_file($filetpl); + + $tplcontent =''; + $tplcontent.= "\n"; + $tplcontent.= ''."\n"; + $tplcontent.= '
'."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; + $tplcontent.= ''.dol_escape_htmltag($objectpage->title).''."\n"; + $tplcontent.= '
'."\n"; + + $tplcontent.= ''."\n"; + $tplcontent.= $objectpage->content."\n"; + $tplcontent.= ''."\n"; + + $tplcontent.= '"."\n"; + + //var_dump($filetpl);exit; + $result = file_put_contents($filetpl, $tplcontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filetpl, octdec($conf->global->MAIN_UMASK)); + + if ($result) + { + setEventMessages($langs->trans("Saved"), null, 'mesgs'); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid); + exit; + } + else + { + setEventMessages('Failed to write file '.$filetpl, null, 'errors'); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid); + exit; + } + } + else + { + $db->rollback(); + } + } + else + { + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid); + exit; + } } else { @@ -603,7 +618,7 @@ if ($action == 'edit') $style=''; if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5px;'; - +//var_dump($objectpage);exit; print '
'; if (count($object->records) > 0) diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 2116d51e65b..ad70190b689 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -262,7 +262,7 @@ if ($resql) $totalbefore = $total; $total = $total + $objp->amount; - $var=!$var; + // Date operation $dateop=$db->jdate($objp->do); diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index d60218fba22..4360e74cae5 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -128,7 +128,7 @@ if (! empty($id)) { $filter['t.rowid']=$id; } -$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); +$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter, 0); if ($result<0) { echo "Error: ".$object->error; @@ -136,7 +136,7 @@ if ($result<0) exit(-1); } -// TODO This sequence of code must be shared with code into cron_run_jobs.php php page. +// TODO This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page. // current date $now=dol_now(); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index fb8612977a8..27cc22448e6 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -189,6 +189,7 @@ if ($resql) $substitutionisok=true; // Fabrication du mail + $trackid='emailing-'.$obj2->source_type.$obj2->source_id; $mail = new CMailFile( $newsubject, $sendto, @@ -201,7 +202,11 @@ if ($resql) '', 0, $msgishtml, - $errorsto + $errorsto, + '', + $trackid, + '', + 'emailing' ); if ($mail->error) diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 2dfdf4cb5c2..99f9faf260d 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -176,6 +176,9 @@ class AllTests $suite->addTestSuite('ChargeSocialesTest'); require_once dirname(__FILE__).'/HolidayTest.php'; $suite->addTestSuite('HolidayTest'); + require_once dirname(__FILE__).'/ExpenseReportTest.php'; + $suite->addTestSuite('ExpenseReportTest'); + require_once dirname(__FILE__).'/EntrepotTest.php'; $suite->addTestSuite('EntrepotTest'); require_once dirname(__FILE__).'/MouvementStockTest.php'; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 03880a56eca..2d615e0bd06 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -264,7 +264,7 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase * @param Object $localobject Supplier order * @return void * - * @depends testCommandeFournisseurValid + * @depends testCommandeFournisseurApprove * The depends says test is run only if previous is ok */ public function testCommandeFournisseurCancel($localobject) diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php new file mode 100644 index 00000000000..b9af3dc1078 --- /dev/null +++ b/test/phpunit/ExpenseReportTest.php @@ -0,0 +1,316 @@ + + * + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/ExpenseReportTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/expensereport/class/expensereport.class.php'; + +if (empty($user->id)) { + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class ExpenseReportTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return ExpenseReportTest + */ + function __construct() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + + // tear down after class + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + //print $db->getVersion()."\n"; + } + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testExpenseReportCreate + * + * @return void + */ + public function testExpenseReportCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + // Set supplier and product to use + $socid=1; + + // Create supplier order with a too low quantity + $localobject=new ExpenseReport($db); + $localobject->initAsSpecimen(); // Init a speciment with lines + $localobject->status = 0; + $localobject->fk_statut = 0; + $localobject->date_fin = null; // Force bad value + + $result=$localobject->create($user); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(-1, $result); // must be -1 because of missing mandatory fields + + $sql="DELETE FROM ".MAIN_DB_PREFIX."expensereport where ref=''"; + $db->query($sql); + + // Create supplier order + $localobject2=new ExpenseReport($db); + $localobject2->initAsSpecimen(); // Init a speciment with lines + $localobject2->status = 0; + $localobject2->fk_statut = 0; + + $result=$localobject2->create($user); + print __METHOD__." result=".$result."\n"; + $this->assertGreaterThanOrEqual(0, $result); + + return $result; + } + + + /** + * testExpenseReportFetch + * + * @param int $id Id of supplier order + * @return void + * + * @depends testExpenseReportCreate + * The depends says test is run only if previous is ok + */ + public function testExpenseReportFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new ExpenseReport($this->savdb); + $result=$localobject->fetch($id); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject; + } + + /** + * testExpenseReportValid + * + * @param Object $localobject Supplier order + * @return void + * + * @depends testExpenseReportFetch + * The depends says test is run only if previous is ok + */ + public function testExpenseReportValid($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->setValidate($user); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject; + } + + /** + * testExpenseReportApprove + * + * @param Object $localobject Supplier order + * @return void + * + * @depends testExpenseReportValid + * The depends says test is run only if previous is ok + */ + public function testExpenseReportApprove($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->setApproved($user); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject; + } + + /** + * testExpenseReportCancel + * + * @param Object $localobject Supplier order + * @return void + * + * @depends testExpenseReportApprove + * The depends says test is run only if previous is ok + */ + public function testExpenseReportCancel($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->set_cancel($user, 'Because...'); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject; + } + + /** + * testExpenseReportOther + * + * @param Object $localobject Supplier order + * @return void + * + * @depends testExpenseReportCancel + * The depends says test is run only if previous is ok + */ + public function testExpenseReportOther($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + /*$result=$localobject->setstatus(0); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + */ + + /*$localobject->info($localobject->id); + print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; + $this->assertNotEquals($localobject->date_creation, ''); + */ + + return $localobject->id; + } + + /** + * testExpenseReportDelete + * + * @param int $id Id of order + * @return void + * + * @depends testExpenseReportOther + * The depends says test is run only if previous is ok + */ + public function testExpenseReportDelete($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new ExpenseReport($this->savdb); + $result=$localobject->fetch($id); + $result=$localobject->delete($user); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; + } + +} diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 199d397f50d..7985e8f0931 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -1,5 +1,6 @@ + * Copyright (C) 2017 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -259,7 +260,7 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase $localobject=new FactureFournisseur($this->savdb); $result=$localobject->fetch($id); - $result=$localobject->delete($id); + $result=$localobject->delete($user); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index a53f971904c..28e55fd793b 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -712,15 +712,15 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $s=img_picto('title','/fullpath/img.png','',1); print __METHOD__." s=".$s."\n"; - $this->assertEquals('',$s,'testImgPicto3'); + $this->assertEquals('',$s,'testImgPicto3'); $s=img_picto('title','/fullpath/img.png','',true); print __METHOD__." s=".$s."\n"; - $this->assertEquals('',$s,'testImgPicto4'); + $this->assertEquals('',$s,'testImgPicto4'); $s=img_picto('title:alt','/fullpath/img.png','',true); print __METHOD__." s=".$s."\n"; - $this->assertEquals('alt',$s,'testImgPicto5'); + $this->assertEquals('alt',$s,'testImgPicto5'); } /** diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 199aace802c..87f290593f0 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -232,7 +232,7 @@ class ProductTest extends PHPUnit_Framework_TestCase $localobject=new Product($this->savdb); $result=$localobject->fetch($id); - $result=$localobject->delete($id); + $result=$localobject->delete($user); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0);