diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c8aa1407ddb..d46580b98b2 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1307,7 +1307,9 @@ class AccountancyExport /** * Export format : LD Compta version 10 & higher - * http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf + * Last review for this format : 08-15-2021 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf * * @param array $objectLines data * @@ -1470,14 +1472,14 @@ class AccountancyExport print $date_lim_reglement.$separator; // CNPI if ($line->doc_type == 'supplier_invoice') { - if (($line->debit - $line->credit) > 0) { + if (($line->amount) < 0) { // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. $nature_piece = 'AF'; } else { $nature_piece = 'FF'; } } elseif ($line->doc_type == 'customer_invoice') { - if (($line->debit - $line->credit) < 0) { - $nature_piece = 'AC'; + if (($line->amount) < 0) { + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. } else { $nature_piece = 'FC'; } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index aeaa42154d8..b4d5b6807f8 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -729,7 +729,10 @@ class BookKeeping extends CommonObject $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; - $sql .= " t.date_export,"; + // In llx_accounting_bookkeeping_tmp, field date_export doesn't exist + if ($mode != "_tmp") { + $sql .= " t.date_export,"; + } $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; $sql .= ' WHERE 1 = 1'; @@ -1622,7 +1625,11 @@ class BookKeeping extends CommonObject global $conf; $sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,"; - $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; + $sql .= " date_creation, tms as date_modification, date_validated as date_validation"; + // In llx_accounting_bookkeeping_tmp, field date_export doesn't exist + if ($mode != "_tmp") { + $sql .= ", date_export"; + } $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -1699,7 +1706,11 @@ class BookKeeping extends CommonObject $sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,"; $sql .= " numero_compte, label_compte, label_operation, debit, credit,"; $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,"; - $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; + $sql .= " date_creation, tms as date_modification, date_validated as date_validation"; + // In llx_accounting_bookkeeping_tmp, field date_export doesn't exist + if ($mode != "_tmp") { + $sql .= ", date_export"; + } $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 2cd7492395d..df21938aec5 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -325,7 +325,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 42e53085ea8..407e8b3cf73 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -251,7 +251,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index dccfc852213..1cf964815d5 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -99,7 +99,7 @@ class CashControl extends CommonObject 'fk_user_creat' =>array('type'=>'integer:User', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>600), 'fk_user_valid' =>array('type'=>'integer:User', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>602), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>700), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated')), ); /** diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 2fbf30b1c70..b6c80feadd4 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -116,7 +116,7 @@ class ConferenceOrBoothAttendee extends CommonObject 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0,'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'),), + 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0,'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),), ); public $rowid; public $ref; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 270c87fb15c..9430d2c52ad 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -480,8 +480,8 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -491,10 +491,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index e8e86a2641a..72d66b7fb87 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -253,8 +253,8 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -264,10 +264,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index a509768f4b5..c138dc42fdb 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -26,6 +26,7 @@ * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it */ + include_once 'inc.php'; global $langs; @@ -74,7 +75,7 @@ if (!empty($useragent)) { $browserversion = $tmp['browserversion']; $browsername = $tmp['browsername']; if ($browsername == 'ie' && $browserversion < 7) { - print 'Error '.$langs->trans("WarningBrowserTooOld")."
\n"; + print 'Error '.$langs->trans("WarningBrowserTooOld")."
\n"; } } @@ -83,13 +84,13 @@ if (!empty($useragent)) { $arrayphpminversionerror = array(5, 5, 0); $arrayphpminversionwarning = array(5, 6, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { // Minimum to use (error if lower) - print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); + print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); $checksok = 0; // 0=error, 1=warning } elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) { // Minimum supported (warning if lower) - print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); + print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); $checksok = 0; // 0=error, 1=warning } else { - print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); + print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); } if (empty($force_install_nophpinfo)) { print ' ('.$langs->trans("MoreInformation").')'; @@ -99,58 +100,58 @@ print "
\n"; // Check PHP support for $_GET and $_POST if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) { // We must keep $_GET and $_POST here - print 'Warning '.$langs->trans("PHPSupportPOSTGETKo"); + print 'Warning '.$langs->trans("PHPSupportPOSTGETKo"); print ' ('.$langs->trans("Recheck").')'; print "
\n"; $checksok = 0; } else { - print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; + print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; } // Check if session_id is enabled if (!function_exists("session_id")) { - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; $checksok = 0; } else { - print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; + print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; } // Check if GD is supported (we need GD for image conversion) if (!function_exists("imagecreate")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; } // Check if Curl is supported if (!function_exists("curl_init")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; } // Check if PHP calendar extension is available if (!function_exists("easter_date")) { - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; } else { - print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; } // Check if UTF8 is supported if (!function_exists("utf8_encode")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; } @@ -158,19 +159,19 @@ if (!function_exists("utf8_encode")) { if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { if (!function_exists("locale_get_primary_language") || !function_exists("locale_get_region")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; } } if (!class_exists('ZipArchive')) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; } // Check memory @@ -192,9 +193,9 @@ if ($memmaxorig != '') { } } if ($memmax >= $memrequired || $memmax == -1) { - print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; + print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; } else { - print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; + print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; } } @@ -244,12 +245,12 @@ if (is_readable($conffile) && filesize($conffile) > 8) { // File is missing and cannot be created if (!file_exists($conffile)) { - print 'Error '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow); - print "

"; + print 'Error '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow); + print '

'; print $langs->trans("YouMustCreateWithPermission", $conffiletoshow); - print "

"; + print '


'."\n"; - print $langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok'); + print ''.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; $err++; } else { if (dol_is_dir($conffile)) { @@ -380,7 +381,7 @@ if (!file_exists($conffile)) { $choice .= '
'; //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; - // Ok '; + // Ok '; } $choice .= ''; diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 85a2f4703c2..88967664ad8 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -16,10 +16,22 @@ */ +.center { + text-align: center; +} + +.centpercent { + width: 100%; +} + .paddingright { padding-right: 4px; } +.valignmiddle { + vertical-align: middle; +} + .opacitymedium { opacity: 0.5; } @@ -28,6 +40,10 @@ display: inline-block; } +.small { + font-size: 0.9em; +} + body { font-size:14px; font-family: roboto,arial,tahoma,verdana,helvetica; @@ -36,14 +52,14 @@ body { } table.main-inside { - padding-left: 10px; - padding-right: 10px; + /*padding-left: 10px; + padding-right: 10px;*/ padding-bottom: 10px; margin-bottom: 10px; margin-top: 10px; color: #000000; border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; + /* border-bottom: 1px solid #ccc; */ line-height: 22px; } @@ -418,3 +434,43 @@ a.button:hover { .text-security { -webkit-text-security: disc; } + + + +/* For support section */ + +.tablesupport { + padding: 6px; + width: 500px; +} + +table.login.tablesupport .title { + background: #eee !important; +} + +.blocksupport { + padding: 12px; + /* width: 90%; */ +} + +table.tablesupport { + min-height: 250px; + border: 1px solid #E0E0E0; + background: #FFF; +} + + +/* Force values for small screen 570 */ +@media only screen and (max-width: 570px) +{ + .blocksupport { + width: 90%; + } + + .tablesupport { + padding: 6px; + width: 100%; + } +} + +} diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index f54959024a2..e04183baaf8 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -241,8 +241,8 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -252,10 +252,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index d087bf272db..8f4024342d7 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -293,7 +293,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -303,10 +303,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index bac3528e642..012b43ff61a 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -235,7 +235,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -245,10 +245,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index f5b72dca2d2..e36e94d39c7 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -294,8 +294,8 @@ foreach ($search as $key => $val) { continue; } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index bc2ebdf20b4..2d6b5374caa 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -233,7 +233,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -243,10 +243,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 3398a47dca3..c82c8312b40 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -276,7 +276,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; @@ -286,10 +286,10 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; diff --git a/htdocs/support/default.css b/htdocs/support/default.css deleted file mode 100644 index 735224254d3..00000000000 --- a/htdocs/support/default.css +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2004 Rodolphe Quiedeville - * Copyright (C) 2009 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 - * 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 . - */ - -body { -font-size:14px; -font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; -background: #f9f9f9; -/* background-color: #F4F4F4; */ -margin: 5px 5px; -} - -.center { - text-align: center; -} - -.centpercent { - width: 100%; -} - -.valignmiddle { - vertical-align: middle; -} - -inline-block { - display: inline-block; -} - -div.titre { -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -} - -span.titre { -font-size: 15px; -font-weight: bold; -background: #FFFFFF; -color: #4965B3; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -border: 1px solid #AAAAAA; -} - -div.soustitre { -font-size: 15px; -font-weight: bold; -color: #4965B3; -padding: 0 1.2em 0.5em 2em; -margin: 1.2em 1.2em 1.2em 1.2em; -border-bottom: 1px solid #8CACBB; -border-right: 1px solid #8CACBB; -text-align: right; -} - -input:disabled -{ -background: #FDFDFD; -border: 1px solid #ACBCBB; -padding: 0 0 0 0; -margin: 0 0 0 0; -} - -table.main { -background: #dcdcd3; -text-align: left; -border: 1px solid #8CACBB; -} - -table.tablesupport { - min-height: 250px; -} - -div.ok { -color: #114466; -} - -div.warning { -color: #777711; -} - -div.error { -color: #550000; font-weight: bold; -padding: 0.2em 0.2em 0.2em 0.2em; -margin: 0.5em 0 0.5em 0; -border: 1px solid #6C7C8B; -} - -font.error { -color: #550000; -} - -div.header { -background-color: #dcdff4; -border-bottom: solid black 1px; -padding-left: 5px; -text-align: center; -} - -a:link,a:visited,a:active { - color: #2266DD; - text-decoration:none; -} -a:hover { - color: #2266DD; - text-decoration:underline; -} - -a.titre { -text-decoration:none; -} - - -div.main-inside h2 { -font-size:18px; -font-weight: bold; -color: #4965B3; -} - -tr.bg1 { -background-color: #E5E5E5; -} - -tr.bg2 { -background-color: #B5C5C5; -} - -td.label { -background: #dcdcd3; -color: #5945A3; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -border-bottom: 1px solid #8CACBB; -} - -td.comment { -background: #dcdcd3; -color: black; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -text-decoration:none; -font-size: 13px; -border-bottom: 1px solid #8CACBB; -} - -.install -{ -border: 1px solid #8CACBB; -padding: 4px 4px 4px 4px; -} - -tr.title -{ -background: #EEEEEE; -} - -table.login { border: 1px solid #E0E0E0; background: #FFF; } - -.tablesupport { - padding: 6px; -} - -.blocksupport { - padding: 12px; - /* width: 90%; */ -} -/* Force values for small screen 570 */ -@media only screen and (max-width: 570px) -{ - .blocksupport { - width: 90%; - } -} - -.inline-block -{ - display:inline-block; - vertical-align: top; -} diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 31236ab5fa9..2836650fe71 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -229,10 +229,9 @@ function conf($dolibarr_main_document_root) */ function pHeader($soutitre, $next, $action = 'none') { - global $conf; - global $langs; - $langs->load("main"); - $langs->load("admin"); + global $conf, $langs; + + $langs->loadLangs(array("main", "admin")); // On force contenu dans format sortie header("Content-type: text/html; charset=".$conf->file->character_set_client); @@ -246,7 +245,7 @@ function pHeader($soutitre, $next, $action = 'none') print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''.$langs->trans("DolibarrHelpCenter").''."\n"; print ''."\n"; diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 220da1290ac..4c80445865b 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -40,14 +40,15 @@ if (!defined('DOL_URL_ROOT')) { $langs->loadLangs(array("other", $langs->load("help"))); + /* * View */ pHeader($langs->trans("DolibarrHelpCenter"), $_SERVER["PHP_SELF"]); -print '
'.$langs->trans("HelpCenterDesc1")."
\n"; -print $langs->trans("HelpCenterDesc2")."
\n"; +print '
'.$langs->trans("HelpCenterDesc1")."
\n"; +print $langs->trans("HelpCenterDesc2")."

\n"; print '
'; @@ -80,12 +81,14 @@ print ''; print ''; print '