Merge remote-tracking branch 'Dolibarr/14.0' into 14
This commit is contained in:
commit
789be5e3e2
@ -1296,7 +1296,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
|
||||
*
|
||||
@ -1459,14 +1461,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';
|
||||
}
|
||||
|
||||
@ -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';
|
||||
@ -1024,6 +1027,12 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.code_journal' && !empty($value)) {
|
||||
if (is_array($value)) {
|
||||
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||
} else {
|
||||
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
||||
}
|
||||
} else {
|
||||
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
||||
}
|
||||
@ -1622,7 +1631,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 +1712,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').")";
|
||||
|
||||
@ -47,7 +47,7 @@ $error = 0;
|
||||
*/
|
||||
|
||||
// Action to update or add a constant
|
||||
if ($action == 'settemplates') {
|
||||
if ($action == 'settemplates' && $user->admin) {
|
||||
$db->begin();
|
||||
|
||||
if (!$error && is_array($_POST)) {
|
||||
@ -192,7 +192,8 @@ print "</tr>\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("NotificationEMailFrom").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="32" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
|
||||
print img_picto('', 'email', 'class="pictofixedwidth"');
|
||||
print '<input class="width300" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
|
||||
if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
|
||||
print ' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||
}
|
||||
@ -270,7 +271,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
}
|
||||
|
||||
$helptext = '';
|
||||
form_constantes($constantes, 3, $helptext);
|
||||
form_constantes($constantes, 3, $helptext, 'EmailTemplate');
|
||||
|
||||
print '<div class="opacitymedium">';
|
||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
} else {
|
||||
@ -316,15 +324,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
print '<div class="opacitymedium">';
|
||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||
print '<div class="opacitymedium">';
|
||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -335,6 +342,7 @@ print '<br><br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setfixednotif">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
|
||||
|
||||
@ -376,6 +384,12 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
$elementLabel = $langs->trans('ExpenseReport');
|
||||
}
|
||||
|
||||
$labelfortrigger = 'AmountHT';
|
||||
$codehasnotrigger = 0;
|
||||
if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) {
|
||||
$codehasnotrigger++;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print img_picto('', $elementPicto, 'class="pictofixedwidth"');
|
||||
@ -384,6 +398,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
print '<td>'.$notifiedevent['code'].'</td>';
|
||||
print '<td><span class="opacitymedium">'.$label.'</span></td>';
|
||||
print '<td>';
|
||||
$inputfieldalreadyshown = 0;
|
||||
// Notification with threshold
|
||||
foreach ($conf->global as $key => $val) {
|
||||
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
||||
@ -407,24 +422,35 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
}
|
||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||
print '<br>';
|
||||
|
||||
$inputfieldalreadyshown++;
|
||||
}
|
||||
// New entry input fields
|
||||
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||
if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
|
||||
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
// Notification with threshold
|
||||
$inputfieldalreadyshown = 0;
|
||||
foreach ($conf->global as $key => $val) {
|
||||
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
|
||||
print '<br>';
|
||||
if (!$codehasnotrigger) {
|
||||
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
|
||||
print '<br>';
|
||||
|
||||
$inputfieldalreadyshown++;
|
||||
}
|
||||
}
|
||||
// New entry input fields
|
||||
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
|
||||
if (!$codehasnotrigger) {
|
||||
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
@ -437,7 +463,7 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button button-save reposition" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -79,7 +79,10 @@ $form = new Form($db);
|
||||
$block_static = new BlockedLog($db);
|
||||
$block_static->loadTrackedEvents();
|
||||
|
||||
llxHeader('', $langs->trans("BlockedLogSetup"));
|
||||
$title = $langs->trans("BlockedLogSetup");
|
||||
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$linkback = '';
|
||||
if ($withtab) {
|
||||
|
||||
@ -275,8 +275,9 @@ if (GETPOST('withtab', 'alpha')) {
|
||||
} else {
|
||||
$title = $langs->trans("BrowseBlockedLog");
|
||||
}
|
||||
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
|
||||
|
||||
llxHeader('', $langs->trans("BrowseBlockedLog"));
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$MAXLINES = 10000;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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')),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'contracts', 'companies'));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ09');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
@ -58,7 +60,6 @@ $search_name = GETPOST("search_name", 'alpha');
|
||||
$search_contract = GETPOST("search_contract", 'alpha');
|
||||
$search_service = GETPOST("search_service", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'alpha');
|
||||
$statut = GETPOST('statut', 'int') ?GETPOST('statut', 'int') : 1;
|
||||
$search_product_category = GETPOST('search_product_category', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contractservicelist'.$mode;
|
||||
@ -412,16 +413,16 @@ if (!empty($filter_op2) && $filter_op2 != -1) {
|
||||
if (!empty($filter_opcloture) && $filter_opcloture != -1) {
|
||||
$param .= '&filter_opcloture='.urlencode($filter_opcloture);
|
||||
}
|
||||
if ($filter_dateouvertureprevue != '') {
|
||||
if ($filter_dateouvertureprevue_start != '') {
|
||||
$param .= '&opouvertureprevueday='.$opouvertureprevueday.'&opouvertureprevuemonth='.$opouvertureprevuemonth.'&opouvertureprevueyear='.$opouvertureprevueyear;
|
||||
}
|
||||
if ($filter_date1 != '') {
|
||||
if ($filter_date1_start != '') {
|
||||
$param .= '&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year;
|
||||
}
|
||||
if ($filter_date2 != '') {
|
||||
if ($filter_date2_start != '') {
|
||||
$param .= '&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year;
|
||||
}
|
||||
if ($filter_datecloture != '') {
|
||||
if ($filter_datecloture_start != '') {
|
||||
$param .= '&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year;
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
|
||||
@ -316,7 +316,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($action == 'send' || $action == 'relance') {
|
||||
$actionmsg2 = $langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from, 4, 0, 1).' '.$langs->transnoentities('at').' '.CMailFile::getValidAddress($sendto, 4, 0, 1);
|
||||
$actionmsg2 = $langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from, 4, 0, 1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto, 4, 0, 1);
|
||||
if ($message) {
|
||||
$actionmsg = $langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
|
||||
|
||||
@ -515,7 +515,7 @@ class Notify
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expedition->dir_output."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
|
||||
$object_type = 'expedition';
|
||||
$object_type = 'shipping';
|
||||
$labeltouse = $conf->global->SHIPPING_VALIDATE_TEMPLATE;
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link);
|
||||
break;
|
||||
|
||||
@ -1526,10 +1526,11 @@ function complete_elementList_with_modules(&$elementList)
|
||||
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
|
||||
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
||||
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended)
|
||||
* @param string $helptext Help
|
||||
* @param string $helptext Tooltip help to use for the column name of values
|
||||
* @param string $text Text to use for the column name of values
|
||||
* @return void
|
||||
*/
|
||||
function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
||||
function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Value')
|
||||
{
|
||||
global $db, $langs, $conf, $user;
|
||||
global $_Avery_Labels;
|
||||
@ -1550,7 +1551,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
$text = $langs->trans("Value");
|
||||
$text = $langs->trans($text);
|
||||
print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext');
|
||||
print '</td>';
|
||||
if (empty($strictw3c)) {
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/core/lib/barcode.lib.php
|
||||
* \brief Set of functions used for barcode generation
|
||||
* \brief Set of functions used for barcode generation (internal lib, also code 'phpbarcode')
|
||||
* \ingroup core
|
||||
*/
|
||||
|
||||
@ -69,7 +69,7 @@ if (defined('PHP-BARCODE_PATH_COMMAND')) {
|
||||
* Print barcode
|
||||
*
|
||||
* @param string $code Code
|
||||
* @param string $encoding Encoding
|
||||
* @param string $encoding Encoding ('EAN13', 'ISBN', 'C128', 'UPC', 'CBR', 'QRCODE', 'DATAMATRIX', 'ANY'...)
|
||||
* @param integer $scale Scale
|
||||
* @param string $mode 'png' or 'jpg' ...
|
||||
* @return array|string $bars array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info) or string with error message
|
||||
@ -149,12 +149,10 @@ function barcode_encode($code, $encoding)
|
||||
dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding);
|
||||
$bars = barcode_encode_genbarcode($code, $encoding);
|
||||
} else {
|
||||
print "barcode_encode needs an external programm for encodings other then EAN/ISBN (code=".$code.", encoding=".$encoding.")<BR>\n";
|
||||
print "barcode_encode needs an external program for encodings other then EAN/ISBN (code=".dol_escape_htmltag($code).", encoding=".dol_escape_htmltag($encoding).")<BR>\n";
|
||||
print "<UL>\n";
|
||||
print "<LI>download gnu-barcode from <A href=\"https://www.gnu.org/software/barcode/\">www.gnu.org/software/barcode/</A>\n";
|
||||
print "<LI>compile and install them\n";
|
||||
print "<LI>download genbarcode from <A href=\"http://www.ashberg.de/bar/\">www.ashberg.de/bar/</A>\n";
|
||||
print "<LI>compile and install them\n";
|
||||
print "<LI>specify path the genbarcode in barcode module setup\n";
|
||||
print "</UL>\n";
|
||||
print "<BR>\n";
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/barcode/doc/phpbarcode.modules.php
|
||||
* \ingroup barcode
|
||||
* \brief File with class to generate barcode images using php barcode generator
|
||||
* \brief File with class to generate barcode images using php internal lib barcode generator
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php';
|
||||
@ -126,7 +126,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
*
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $readable Code can be read (What is this ? is this used ?)
|
||||
* @param integer $scale Scale
|
||||
* @param integer $nooutputiferror No output if error
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -163,7 +163,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
if (!is_array($result)) {
|
||||
$this->error = $result;
|
||||
if (empty($nooutputiferror)) {
|
||||
print $this->error;
|
||||
print dol_escape_htmltag($this->error);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
*
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $readable Code can be read (What is this ? is this used ?)
|
||||
* @param integer $scale Scale (not used with this engine)
|
||||
* @param integer $nooutputiferror No output if error (not used with this engine)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -530,7 +530,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->fk_unit,
|
||||
$this->lines[$i]->multicurrency_subprice
|
||||
$this->lines[$i]->multicurrency_subprice,
|
||||
$this->lines[$i]->ref_supplier
|
||||
);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
@ -568,7 +569,15 @@ class FactureFournisseur extends CommonInvoice
|
||||
$line->fk_product,
|
||||
'HT',
|
||||
(!empty($line->info_bits) ? $line->info_bits : ''),
|
||||
$line->product_type
|
||||
$line->product_type,
|
||||
$line->remise_percent,
|
||||
0,
|
||||
$line->date_start,
|
||||
$line->date_end,
|
||||
$line->array_options,
|
||||
$line->fk_unit,
|
||||
$line->multicurrency_subprice,
|
||||
$line->ref_supplier
|
||||
);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
|
||||
@ -721,12 +721,12 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
} else {
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
@ -814,12 +814,12 @@ if ($id > 0 || !empty($ref)) {
|
||||
print $linktoprod;
|
||||
print "</td>";
|
||||
print '<td class="dispatch_batch_number"></td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc"></td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
}
|
||||
} else {
|
||||
print '<td>';
|
||||
print $linktoprod;
|
||||
@ -827,12 +827,12 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<td class="dispatch_batch_number">';
|
||||
print $langs->trans("ProductDoesNotUseBatchSerial");
|
||||
print '</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc"></td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<td colspan="4">';
|
||||
@ -901,7 +901,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<td>';
|
||||
print '<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.GETPOST('lot_number'.$suffix).'">';
|
||||
print '</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="nowraponall">';
|
||||
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
|
||||
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
|
||||
@ -917,8 +917,8 @@ if ($id > 0 || !empty($ref)) {
|
||||
} else {
|
||||
$type = 'dispatch';
|
||||
$colspan = 7;
|
||||
$colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan;
|
||||
$colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan;
|
||||
$colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan;
|
||||
print '<td class="right">';
|
||||
print '</td>'; // Qty to dispatch
|
||||
print '<td>';
|
||||
@ -1140,12 +1140,12 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<td>'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("QtyDispatched").'</td>';
|
||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||
@ -1199,16 +1199,20 @@ if ($id > 0 || !empty($ref)) {
|
||||
$lot = new Productlot($db);
|
||||
$lot->fetch(0, $objp->pid, $objp->batch);
|
||||
print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc">'.dol_print_date($lot->sellby, 'day').'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
|
||||
}
|
||||
} else {
|
||||
print '<td class="dispatch_batch_number"></td>';
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
print '<td class="dispatch_dlc"></td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="dispatch_dlc"></td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="dispatch_dluo"></td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -162,7 +162,7 @@ if (empty($reshook)) {
|
||||
$halfday = 1;
|
||||
}
|
||||
|
||||
$valideur = GETPOST('valideur', 'int');
|
||||
$approverid = GETPOST('valideur', 'int');
|
||||
$description = trim(GETPOST('description', 'restricthtml'));
|
||||
|
||||
// Check that leave is for a user inside the hierarchy or advanced permission for all is set
|
||||
@ -229,7 +229,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// If no validator designated
|
||||
if ($valideur < 1) {
|
||||
if ($approverid < 1) {
|
||||
setEventMessages($langs->transnoentitiesnoconv('InvalidValidatorCP'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -239,7 +239,7 @@ if (empty($reshook)) {
|
||||
if (!$error) {
|
||||
$object->fk_user = $fuserid;
|
||||
$object->description = $description;
|
||||
$object->fk_validator = $valideur;
|
||||
$object->fk_validator = $approverid;
|
||||
$object->fk_type = $type;
|
||||
$object->date_debut = $date_debut;
|
||||
$object->date_fin = $date_fin;
|
||||
@ -315,7 +315,7 @@ if (empty($reshook)) {
|
||||
if ($object->statut == Holiday::STATUS_DRAFT) {
|
||||
// If this is the requestor or has read/write rights
|
||||
if ($cancreate) {
|
||||
$valideur = GETPOST('valideur', 'int');
|
||||
$approverid = GETPOST('valideur', 'int');
|
||||
$description = trim(GETPOST('description', 'restricthtml'));
|
||||
|
||||
// If no start date
|
||||
@ -337,7 +337,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// If no validator designated
|
||||
if ($valideur < 1) {
|
||||
if ($approverid < 1) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&error=Valideur');
|
||||
exit;
|
||||
}
|
||||
@ -352,7 +352,7 @@ if (empty($reshook)) {
|
||||
$object->description = $description;
|
||||
$object->date_debut = $date_debut;
|
||||
$object->date_fin = $date_fin;
|
||||
$object->fk_validator = $valideur;
|
||||
$object->fk_validator = $approverid;
|
||||
$object->halfday = $halfday;
|
||||
|
||||
// Update
|
||||
@ -1100,8 +1100,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
if (($id > 0) || $ref) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
$valideur = new User($db);
|
||||
$valideur->fetch($object->fk_validator);
|
||||
$approverexpected = new User($db);
|
||||
$approverexpected->fetch($object->fk_validator);
|
||||
|
||||
$userRequest = new User($db);
|
||||
$userRequest->fetch($object->fk_user);
|
||||
@ -1314,7 +1314,14 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
print $langs->trans('ReviewedByCP');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$valideur->getNomUrl(-1);
|
||||
print '<td>';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
$approverdone = new User($db);
|
||||
$approverdone->fetch($object->fk_user_valid);
|
||||
print $approverdone->getNomUrl(-1);
|
||||
} else {
|
||||
print $approverexpected->getNomUrl(-1);
|
||||
}
|
||||
$include_users = $object->fetch_users_approver_holiday();
|
||||
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) {
|
||||
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
|
||||
|
||||
@ -85,31 +85,42 @@ class Holiday extends CommonObject
|
||||
public $statut = ''; // 1=draft, 2=validated, 3=approved
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID of user that must approve. TODO: there is no date for validation (date_valid is used for approval), add one.
|
||||
*/
|
||||
public $fk_validator;
|
||||
|
||||
/**
|
||||
* @var int Date of approval. TODO: Add a field for approval date and use date_valid instead for validation.
|
||||
*/
|
||||
public $date_valid = '';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID of user that has approved (empty if not approved)
|
||||
*/
|
||||
public $fk_user_valid;
|
||||
|
||||
|
||||
/**
|
||||
* @var int Date for refuse
|
||||
*/
|
||||
public $date_refuse = '';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID for refuse
|
||||
*/
|
||||
public $fk_user_refuse;
|
||||
|
||||
/**
|
||||
* @var int Date for cancelation
|
||||
*/
|
||||
public $date_cancel = '';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID for cancelation
|
||||
*/
|
||||
public $fk_user_cancel;
|
||||
|
||||
|
||||
public $detail_refuse = '';
|
||||
|
||||
/**
|
||||
@ -2107,7 +2118,7 @@ class Holiday extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT f.rowid,";
|
||||
$sql = "SELECT f.rowid, f.statut as status,";
|
||||
$sql .= " f.date_create as datec,";
|
||||
$sql .= " f.tms as date_modification,";
|
||||
$sql .= " f.date_valid as datev,";
|
||||
@ -2115,8 +2126,8 @@ class Holiday extends CommonObject
|
||||
$sql .= " f.date_refuse as dater,";
|
||||
$sql .= " f.fk_user_create as fk_user_creation,";
|
||||
$sql .= " f.fk_user_modif as fk_user_modification,";
|
||||
$sql .= " f.fk_user_valid,";
|
||||
$sql .= " f.fk_validator as fk_user_approve,";
|
||||
$sql .= " f.fk_user_valid as fk_user_approve_done,";
|
||||
$sql .= " f.fk_validator as fk_user_approve_expected,";
|
||||
$sql .= " f.fk_user_refuse as fk_user_refuse";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as f";
|
||||
$sql .= " WHERE f.rowid = ".((int) $id);
|
||||
@ -2153,10 +2164,19 @@ class Holiday extends CommonObject
|
||||
$muser->fetch($obj->fk_user_modification);
|
||||
$this->user_modification = $muser;
|
||||
}
|
||||
if ($obj->fk_user_approve) {
|
||||
$auser = new User($this->db);
|
||||
$auser->fetch($obj->fk_user_approve);
|
||||
$this->user_approve = $auser;
|
||||
|
||||
if ($obj->status == Holiday::STATUS_APPROVED || $obj->status == Holiday::STATUS_CANCELED) {
|
||||
if ($obj->fk_user_approve_done) {
|
||||
$auser = new User($this->db);
|
||||
$auser->fetch($obj->fk_user_approve_done);
|
||||
$this->user_approve = $auser;
|
||||
}
|
||||
} else {
|
||||
if ($obj->fk_user_approve_expected) {
|
||||
$auser = new User($this->db);
|
||||
$auser->fetch($obj->fk_user_approve_expected);
|
||||
$this->user_approve = $auser;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -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 '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("WarningBrowserTooOld")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("WarningBrowserTooOld")."<br>\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 '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror));
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror));
|
||||
$checksok = 0; // 0=error, 1=warning
|
||||
} elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) { // Minimum supported (warning if lower)
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning));
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning));
|
||||
$checksok = 0; // 0=error, 1=warning
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray());
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray());
|
||||
}
|
||||
if (empty($force_install_nophpinfo)) {
|
||||
print ' (<a href="phpinfo.php" target="_blank">'.$langs->trans("MoreInformation").'</a>)';
|
||||
@ -99,58 +100,58 @@ print "<br>\n";
|
||||
|
||||
// Check PHP support for $_GET and $_POST
|
||||
if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) { // We must keep $_GET and $_POST here
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Warning" class="valignmiddle"> '.$langs->trans("PHPSupportPOSTGETKo");
|
||||
print ' (<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?testget=ok">'.$langs->trans("Recheck").'</a>)';
|
||||
print "<br>\n";
|
||||
$checksok = 0;
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n";
|
||||
}
|
||||
|
||||
|
||||
// Check if session_id is enabled
|
||||
if (!function_exists("session_id")) {
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n";
|
||||
$checksok = 0;
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportSessions")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupportSessions")."<br>\n";
|
||||
}
|
||||
|
||||
|
||||
// Check if GD is supported (we need GD for image conversion)
|
||||
if (!function_exists("imagecreate")) {
|
||||
$langs->load("errors");
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportGD")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportGD")."<br>\n";
|
||||
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "GD")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "GD")."<br>\n";
|
||||
}
|
||||
|
||||
|
||||
// Check if Curl is supported
|
||||
if (!function_exists("curl_init")) {
|
||||
$langs->load("errors");
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportCurl")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportCurl")."<br>\n";
|
||||
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "Curl")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "Curl")."<br>\n";
|
||||
}
|
||||
|
||||
// Check if PHP calendar extension is available
|
||||
if (!function_exists("easter_date")) {
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."<br>\n";
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "Calendar")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "Calendar")."<br>\n";
|
||||
}
|
||||
|
||||
|
||||
// Check if UTF8 is supported
|
||||
if (!function_exists("utf8_encode")) {
|
||||
$langs->load("errors");
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."<br>\n";
|
||||
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "UTF8")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "UTF8")."<br>\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 '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportIntl")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupportIntl")."<br>\n";
|
||||
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "Intl")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "Intl")."<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('ZipArchive')) {
|
||||
$langs->load("errors");
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Error" class="valignmiddle"> '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."<br>\n";
|
||||
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "ZIP")."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPSupport", "ZIP")."<br>\n";
|
||||
}
|
||||
|
||||
// Check memory
|
||||
@ -192,9 +193,9 @@ if ($memmaxorig != '') {
|
||||
}
|
||||
}
|
||||
if ($memmax >= $memrequired || $memmax == -1) {
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."<br>\n";
|
||||
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."<br>\n";
|
||||
} else {
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."<br>\n";
|
||||
print '<img src="../theme/eldy/img/warning.png" alt="Warning" class="valignmiddle"> '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,12 +245,12 @@ if (is_readable($conffile) && filesize($conffile) > 8) {
|
||||
|
||||
// File is missing and cannot be created
|
||||
if (!file_exists($conffile)) {
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow);
|
||||
print "<br><br>";
|
||||
print '<img src="../theme/eldy/img/error.png" alt="Error" class="valignmiddle"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow);
|
||||
print '<br><br><div class="error">';
|
||||
print $langs->trans("YouMustCreateWithPermission", $conffiletoshow);
|
||||
print "<br><br>";
|
||||
print '</div><br><br>'."\n";
|
||||
|
||||
print $langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok');
|
||||
print '<span class="opacitymedium">'.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').'</span>';
|
||||
$err++;
|
||||
} else {
|
||||
if (dol_is_dir($conffile)) {
|
||||
@ -380,7 +381,7 @@ if (!file_exists($conffile)) {
|
||||
$choice .= '<br>';
|
||||
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
|
||||
$choice .= '<div class="center"><div class="ok suggestedchoice">'.$langs->trans("InstallChoiceSuggested").'</div></div>';
|
||||
// <img src="../theme/eldy/img/tick.png" alt="Ok"> ';
|
||||
// <img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> ';
|
||||
}
|
||||
|
||||
$choice .= '</td>';
|
||||
|
||||
@ -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%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -1367,7 +1367,7 @@ AccountCodeManager=Options for automatic generation of customer/vendor accountin
|
||||
NotificationsDesc=Email notifications can be sent automatically for some Dolibarr events.<br>Recipients of notifications can be defined:
|
||||
NotificationsDescUser=* per user, one user at a time.
|
||||
NotificationsDescContact=* per third-party contacts (customers or vendors), one contact at a time.
|
||||
NotificationsDescGlobal=* or by setting global email addresses in this setup page.
|
||||
NotificationsDescGlobal=* or by setting global email addresses in the setup page of the module.
|
||||
ModelModules=Document Templates
|
||||
DocumentModelOdt=Generate documents from OpenDocument templates (.ODT / .ODS files from LibreOffice, OpenOffice, KOffice, TextEdit,...)
|
||||
WatermarkOnDraft=Watermark on draft document
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -118,7 +118,7 @@ class Mo extends CommonObject
|
||||
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')),
|
||||
);
|
||||
public $rowid;
|
||||
public $ref;
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -133,12 +133,12 @@ $arrayfields = array(
|
||||
//'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
//'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500)
|
||||
);
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
unset($arrayfields['pl.eatby']);
|
||||
}
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
unset($arrayfields['pl.sellby']);
|
||||
}
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
unset($arrayfields['pl.eatby']);
|
||||
}
|
||||
$objectlist->fields = dol_sort_array($objectlist->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1215,8 +1215,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).'</td><td>';
|
||||
print '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr><tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Stock desired level
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).'</td><td>';
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -343,10 +343,10 @@ if ($resql) {
|
||||
print '<td class="liste_titre center"><input class="flat" type="text" name="search_batch" size="6" value="'.$search_batch.'"></td>';
|
||||
print '<td class="liste_titre right"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -367,12 +367,12 @@ if ($resql) {
|
||||
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", $param, "", '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right );
|
||||
print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
// TODO Add info of running suppliers/customers orders
|
||||
//print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'',$sortfield,$sortorder, 'right ');
|
||||
@ -470,23 +470,30 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
|
||||
}
|
||||
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
|
||||
}
|
||||
|
||||
print '<td class="right">';
|
||||
//if ($objp->seuil_stock_alerte && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' ';
|
||||
print $objp->stock_physique;
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
|
||||
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product_static->id.'&search_warehouse='.$objp->fk_entrepot.'&search_batch='.($objp->batch != 'Undefined' ? $objp->batch : 'Undefined').'">'.$langs->trans("Movements").'</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right nowrap">'.$product_static->LibStatut($objp->statut, 5, 0).'</td>';
|
||||
|
||||
print '<td class="right nowrap">'.$product_static->LibStatut($objp->tobuy, 5, 1).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -136,12 +136,12 @@ $arrayfields = array(
|
||||
//'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
//'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500)
|
||||
);
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
unset($arrayfields['pl.eatby']);
|
||||
}
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
unset($arrayfields['pl.sellby']);
|
||||
}
|
||||
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
unset($arrayfields['pl.eatby']);
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->stock->mouvement->lire) {
|
||||
|
||||
@ -946,14 +946,14 @@ if (!$variants) {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="right">'.$langs->trans("batch_number").'</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center width100">'.$langs->trans("SellByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
print '<td colspan="'.$colspan.'"></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
@ -1061,16 +1061,16 @@ if (!$variants) {
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="pdluoid" value="'.$pdluo->id.'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.'"><table class="noborder centpercent"><tr><td width="10%"></td>';
|
||||
print '<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="center" width="10%">';
|
||||
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="center" width="10%">';
|
||||
print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="center" width="10%">';
|
||||
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="right" colspan="3">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';
|
||||
print '<td colspan="4"><input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="Cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
@ -1087,14 +1087,14 @@ if (!$variants) {
|
||||
print $product_lot_static->getNomUrl(1);
|
||||
print '</td>';
|
||||
$colspan = 3;
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center">'.dol_print_date($pdluo->eatby, 'day').'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center">'.dol_print_date($pdluo->sellby, 'day').'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
$colspan--;
|
||||
print '<td class="center">'.dol_print_date($pdluo->eatby, 'day').'</td>';
|
||||
}
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
print '<td>';
|
||||
|
||||
@ -463,16 +463,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
|
||||
print '</td></tr>';
|
||||
|
||||
// Eat by
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Sell by
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<tr><td>';
|
||||
@ -483,6 +473,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Eat by
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->PRODUCT_LOT_ENABLE_TRACEABOLITY)) {
|
||||
print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->rights->stock->creer).'</td>';
|
||||
print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->rights->stock->creer, 'datepicker').'</td>';
|
||||
|
||||
@ -120,18 +120,18 @@ if (!empty($conf->productbatch->enabled) &&
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td>'.$langs->trans("EatByDate").'</td><td>';
|
||||
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
|
||||
print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td>'.$langs->trans("SellByDate").'</td><td>';
|
||||
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
|
||||
print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td>'.$langs->trans("EatByDate").'</td><td>';
|
||||
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
|
||||
print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -110,16 +110,16 @@ if (!empty($conf->productbatch->enabled) &&
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td>'.$langs->trans("EatByDate").'</td><td>';
|
||||
print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td>'.$langs->trans("SellByDate").'</td><td>';
|
||||
print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td>'.$langs->trans("EatByDate").'</td><td>';
|
||||
print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -999,12 +999,12 @@ if ($action == 'create') {
|
||||
}
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td class="left">'.$langs->trans("batch_number").'</td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="left">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="left">'.$langs->trans("SellByDate").'</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="left">'.$langs->trans("EatByDate").'</td>';
|
||||
}
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -1153,12 +1153,12 @@ if ($action == 'create') {
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
if (!empty($product->status_batch)) {
|
||||
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td class="nowraponall">';
|
||||
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td class="nowraponall">';
|
||||
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
|
||||
print '</td>';
|
||||
@ -1829,14 +1829,14 @@ if ($action == 'create') {
|
||||
print '<td>'.$formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
|
||||
// Batch number managment
|
||||
if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) {
|
||||
print '<td class="nowraponall"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"></br>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print $langs->trans('EatByDate').' : ';
|
||||
print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'</br>';
|
||||
}
|
||||
print '<td class="nowraponall"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"><br>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print $langs->trans('SellByDate').' : ';
|
||||
print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, "");
|
||||
print $form->selectDate($lines[$i]->sellby, 'dlc'.$line_id, '', '', 1, "").'</br>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print $langs->trans('EatByDate').' : ';
|
||||
print $form->selectDate($lines[$i]->eatby, 'dluo'.$line_id, '', '', 1, "");
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -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]) . "'";
|
||||
|
||||
@ -1,191 +0,0 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
@ -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 '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
|
||||
print '<meta name="keywords" content="help, center, dolibarr, doliwamp">'."\n";
|
||||
print '<meta name="description" content="Dolibarr help center">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="default.css">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="../install/default.css">'."\n";
|
||||
print '<title>'.$langs->trans("DolibarrHelpCenter").'</title>'."\n";
|
||||
print '</head>'."\n";
|
||||
|
||||
|
||||
@ -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 '<br>'.$langs->trans("HelpCenterDesc1")."<br>\n";
|
||||
print $langs->trans("HelpCenterDesc2")."<br>\n";
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("HelpCenterDesc1")."<br>\n";
|
||||
print $langs->trans("HelpCenterDesc2")."</span><br>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -80,12 +81,14 @@ print '<table class="login tablesupport" width="100%">';
|
||||
print '<tr class="title" valign="top">';
|
||||
print '<td width="100%" align="left" valign="middle">';
|
||||
|
||||
print '<table summary="who"><tr><td>'.img_picto('', 'who.png', 'class="valigntextbottom"', 1).'</td><td>';
|
||||
print '<table summary="who"><tr><td>'.img_picto('', 'who.png', 'class="valignmiddle"', 1).'</td><td>';
|
||||
|
||||
print '<font style="'.$style1.'">'.$langs->trans("CommunitySupport").'</font>';
|
||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommunauty").'</font>';
|
||||
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
|
||||
print $langs->trans("TypeHelpDev").'/'.img_picto_common('', 'redstar', 'class="valigntextbottom"', 1).img_picto_common('', 'redstar', 'class="valigntextbottom"', 1).'/'.img_picto_common('', 'star', 'class="valigntextbottom"', 1).img_picto_common('', 'star', 'class="valigntextbottom"', 1).img_picto_common('', 'star', 'class="valigntextbottom"', 1).img_picto_common('', 'star', 'class="valigntextbottom"', 1);
|
||||
print '<span class="small">';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> <font style="'.$style2.'">'.$langs->trans("TypeSupportCommunauty").'</font>';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").':</span> ';
|
||||
print $langs->trans("TypeHelpDev").'/'.img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).'/'.img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1);
|
||||
print '</span>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
@ -142,12 +145,14 @@ print '<table class="login tablesupport" width="100%">';
|
||||
print '<tr class="title" valign="top">';
|
||||
print '<td width="100%" align="left" valign="middle">';
|
||||
|
||||
print '<table summary="mail"><tr><td>'.img_picto('', 'mail.png', 'class="valigntextbottom"', 1).'</td><td>';
|
||||
print '<table summary="mail"><tr><td>'.img_picto('', 'mail.png', 'class="valignmiddle"', 1).'</td><td>';
|
||||
|
||||
print '<font style="'.$style1.'">'.$langs->trans("EMailSupport").'</font>';
|
||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
||||
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
|
||||
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('', 'redstar', 'class="valigntextbottom"', 1).img_picto_common('', 'redstar', 'class="valigntextbottom"', 1).img_picto_common('', 'redstar', 'class="valigntextbottom"', 1).'/'.img_picto_common('', 'star', 'class="valigntextbottom"', 1).img_picto_common('', 'star', 'class="valigntextbottom"', 1);
|
||||
print '<span class="small">';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").':</span> ';
|
||||
print $langs->trans("TypeHelpOnly").'/'.img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).'/'.img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1);
|
||||
print '</span>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
@ -157,7 +162,7 @@ $urlwiki = 'https://partners.dolibarr.org';
|
||||
print '<td align="center" valign="top">';
|
||||
print '<table class="nocellnopadd">';
|
||||
print '<tr><td align="center">';
|
||||
print '<br>'.$langs->trans("ToSeeListOfAvailableRessources").'<br>';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("ToSeeListOfAvailableRessources").'</span><br>';
|
||||
print '<b><a href="'.$urlwiki.'">'.$langs->trans("ClickHere").'</a></b><br>';
|
||||
print '<br><br>';
|
||||
print '<br><br>';
|
||||
@ -175,13 +180,15 @@ print '<table class="login tablesupport" width="100%">';
|
||||
print '<tr class="title">';
|
||||
print '<td width="100%" align="left" valign="middle">';
|
||||
|
||||
print '<table summary="special"><tr><td>'.img_picto('', 'pagemaster.png', 'class="valigntextbottom"', 1).'</td><td>';
|
||||
print '<table summary="special"><tr><td>'.img_picto('', 'pagemaster.png', 'class="valignmiddle"', 1).'</td><td>';
|
||||
|
||||
print '<font style="'.$style1.'">'.$langs->trans("OtherSupport").'</font>';
|
||||
print '<br>'.$langs->trans("TypeOfSupport").': <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
||||
print '<span class="small">';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> <font style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</font>';
|
||||
//print '<br>'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': '.img_picto_common('','redstar').img_picto_common('','redstar').img_picto_common('','redstar').' / '.img_picto_common('','star');
|
||||
print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").': ';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$langs->trans("Price").':</span> ';
|
||||
print $langs->trans("TypeHelpDevForm").'/?/?';
|
||||
print '</span>';
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
@ -191,7 +198,7 @@ $urlwiki = 'https://partners.dolibarr.org';
|
||||
print '<td align="center" valign="top">';
|
||||
print '<table class="nocellnopadd">';
|
||||
print '<tr><td align="center">';
|
||||
print '<br>'.$langs->trans("ToSeeListOfAvailableRessources").'<br>';
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("ToSeeListOfAvailableRessources").'</span><br>';
|
||||
print '<b><a href="'.$urlwiki.'">'.$langs->trans("ClickHere").'</a></b><br>';
|
||||
print '<br><br>';
|
||||
print '<br><br>';
|
||||
|
||||
@ -226,13 +226,14 @@ if ($result > 0) {
|
||||
// List of notifications enabled for contacts
|
||||
$sql = "SELECT n.rowid, n.type,";
|
||||
$sql .= " a.code, a.label,";
|
||||
$sql .= " c.rowid as userid, c.lastname, c.firstname, c.email";
|
||||
$sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."user c";
|
||||
$sql .= " WHERE a.rowid = n.fk_action";
|
||||
$sql .= " AND c.rowid = n.fk_user";
|
||||
$sql .= " AND c.rowid = ".$object->id;
|
||||
$sql .= " AND c.entity IN (".getEntity('user').')';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
@ -311,6 +312,9 @@ if ($result > 0) {
|
||||
$userstatic->id = $obj->userid;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->status;
|
||||
|
||||
print '<tr class="oddeven"><td>'.$userstatic->getNomUrl(1);
|
||||
if ($obj->type == 'email') {
|
||||
if (isValidEmail($obj->email)) {
|
||||
|
||||
@ -282,10 +282,14 @@ if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $full
|
||||
|
||||
|
||||
if ($modulepart == 'barcode') {
|
||||
$generator = GETPOST("generator", "alpha");
|
||||
$code = GETPOST("code", 'none'); // This can be rich content (qrcode, datamatrix, ...)
|
||||
$encoding = GETPOST("encoding", "alpha");
|
||||
$readable = GETPOST("readable", 'alpha') ?GETPOST("readable", "alpha") : "Y";
|
||||
$generator = GETPOST("generator", "aZ09");
|
||||
$encoding = GETPOST("encoding", "aZ09");
|
||||
$readable = GETPOST("readable", 'aZ09') ? GETPOST("readable", "aZ09") : "Y";
|
||||
if (in_array($encoding, array('EAN8', 'EAN13'))) {
|
||||
$code = GETPOST("code", 'alphanohtml');
|
||||
} else {
|
||||
$code = GETPOST("code", 'none'); // This can be rich content (qrcode, datamatrix, ...)
|
||||
}
|
||||
|
||||
if (empty($generator) || empty($encoding)) {
|
||||
print 'Error: Parameter "generator" or "encoding" not defined';
|
||||
|
||||
@ -254,7 +254,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;
|
||||
@ -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]) . "'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user