Merge branch 'develop' into dev_updatedocker

This commit is contained in:
Florian HENRY 2020-08-29 18:41:03 +02:00
commit f21741074c
85 changed files with 484 additions and 212 deletions

View File

@ -292,7 +292,7 @@ if ($action == 'setjournal') {
}
if ($action == 'setdocref') {
$refdoc = trim(GETPOST('doc_ref', 'alpha'));
$refdoc = GETPOST('doc_ref', 'alpha');
$result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');

View File

@ -231,7 +231,7 @@ print '</table>';
dol_fiche_end();
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
//print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</form>';

View File

@ -108,7 +108,7 @@ if ($actionsave)
// Save colors
while ($i <= 2)
{
$color = trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha'));
$color = GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha');
if ($color == '-1') $color = '';
$res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);

View File

@ -62,7 +62,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');

View File

@ -86,7 +86,7 @@ if ($user->socid > 0) // Protection if external user
//$result = restrictedArea($user, 'emailcollector', $id, '');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -80,7 +80,7 @@ if ($user->socid > 0) // Protection if external user
//$result = restrictedArea($user, 'mymodule', $id, '');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -168,6 +168,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementL
if ($conf->projet->enabled) $elementList['project'] = $langs->trans('MailToProject');
if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = $langs->trans('MailToTicket');
if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) $elementList['recruitmentcandidature_send'] = $langs->trans('RecruitmentCandidatures');
if ($conf->agenda->enabled) $elementList['actioncomm_send'] = $langs->trans('MailToSendEventPush');
$elementList['user'] = $langs->trans('MailToUser');
$parameters = array('elementList'=>$elementList);

View File

@ -52,7 +52,7 @@ if ($action == 'update' && !$cancel)
{
dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", GETPOST("MAIN_DISABLE_ALL_SMS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphahtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", GETPOST("MAIN_MAIL_SMS_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity);

View File

@ -33,7 +33,7 @@ $langs->load("admin");
$action = GETPOST('action', 'alpha');
$what = GETPOST('what', 'alpha');
$export_type = GETPOST('export_type', 'alpha');
$file = trim(GETPOST('zipfilename_template', 'alpha'));
$file = GETPOST('zipfilename_template', 'alpha');
$compression = GETPOST('compression');
$file = dol_sanitizeFileName($file);

View File

@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposals", "receptions"));
$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposal", "receptions"));
if (!$user->admin) accessforbidden();
@ -80,16 +80,22 @@ $workflowcodes = array(
// Automatic classification of proposal
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'propal', 'warning'=>''),
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>31, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'propal', 'warning'=>''),
'separator2'=>array('family'=>'separator', 'position'=>35),
// Automatic classification of order
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array('family'=>'classify_order', 'position'=>40, 'enabled'=>'! empty($conf->expedition->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
'separator2'=>array('family'=>'separator', 'position'=>50),
'separator3'=>array('family'=>'separator', 'position'=>50),
// Automatic classification supplier proposal
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''),
'separator4'=>array('family'=>'separator', 'position'=>61),
// Automatic classification supplier order
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''),
//Automatic classification reception
'separator5'=>array('family'=>'separator', 'position'=>63),
// Automatic classification reception
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'),
'separator6'=>array('family'=>'separator', 'position'=>90),
// Automatic classification of intervention
'WORKFLOW_TICKET_CLOSE_INTERVENTION'=>array('family'=>'classify_intervention', 'position'=>100, 'enabled'=>'! empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)', 'picto'=>'intervention'),
);
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
@ -131,8 +137,8 @@ foreach ($workflowcodes as $key => $params)
{
print '<tr class="liste_titre">'."\n";
print ' <td>';
if ($family == 'create')
{
$reg = array();
if ($family == 'create') {
print $langs->trans("AutomaticCreation");
} elseif (preg_match('/classify_(.*)/', $family, $reg))
{
@ -142,17 +148,18 @@ foreach ($workflowcodes as $key => $params)
if ($reg[1] == 'supplier_proposal') print ' - '.$langs->trans('SupplierProposal');
if ($reg[1] == 'supplier_order') print ' - '.$langs->trans('SupplierOrder');
if ($reg[1] == 'reception') print ' - '.$langs->trans('Reception');
if ($reg[1] == 'intervention') print ' - '.$langs->trans('Intervention');
} else {
print $langs->trans("Description");
}
print '</td>';
print ' <td align="center">'.$langs->trans("Status").'</td>';
print ' <td class="center" width="90px">'.$langs->trans("Status").'</td>';
print "</tr>\n";
$oldfamily = $family;
}
print "<tr class=\"oddeven\">\n";
print "<td>".img_object('', $picto).$langs->trans('desc'.$key);
print "<td>".img_object('', $picto, 'class="paddingright"').$langs->trans('desc'.$key);
if (!empty($params['warning']))
{
$langs->load("errors");

View File

@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -81,7 +81,7 @@ if ($user->socid > 0) // Protection if external user
//$result = restrictedArea($user, 'asset', $id,'');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -81,7 +81,7 @@ if ($user->socid > 0) // Protection if external user
//$result = restrictedArea($user, 'bom', $id, '');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -251,7 +251,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
print '</span>';
}
print '</td><td>';
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"]) ? $_POST["url"] : $object->url).'">';
if ($action == 'edit') print '<input class="flat minwidth500" name="url" value="'.(isset($_POST["url"]) ? $_POST["url"] : $object->url).'">';
else print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank"' : '').'>'.$object->url.'</a>';
print '</td></tr>';

View File

@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
@ -64,6 +65,14 @@ $apmin = GETPOST('apmin');
$p2hour = GETPOST('p2hour');
$p2min = GETPOST('p2min');
$addreminder = GETPOST('addreminder');
$offsetvalue = GETPOST('offsetvalue');
$offsetunit = GETPOST('offsetunittype_duration');
$remindertype = GETPOST('selectremindertype');
$modelmail = GETPOST('actioncommsendmodel_mail');
//var_dump($_POST); exit;
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year"));
@ -248,10 +257,10 @@ if (empty($reshook) && $action == 'add')
if (!$error)
{
// Initialisation objet actioncomm
$object->priority = GETPOST("priority") ? GETPOST("priority") : 0;
$object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0;
$object->fulldayevent = (!empty($fulldayevent) ? 1 : 0);
$object->location = GETPOST("location");
$object->label = trim(GETPOST('label'));
$object->location = GETPOST("location", 'alphanohtml');
$object->label = GETPOST('label', 'alphanohtml');
$object->fk_element = GETPOST("fk_element", 'int');
$object->elementtype = GETPOST("elementtype", 'alpha');
if (!GETPOST('label'))
@ -378,6 +387,45 @@ if (empty($reshook) && $action == 'add')
$moreparam = '';
if ($user->id != $object->userownerid) $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
//Create eminder
if ($addreminder == 'on'){
$actionCommReminder = new ActionCommReminder($db);
if ($offsetunit == 'minute'){
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'i');
} elseif ($offsetunit == 'hour'){
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'h');
} elseif ($offsetunit == 'day') {
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'd');
} elseif ($offsetunit == 'week') {
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'w');
} elseif ($offsetunit == 'month') {
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'm');
} elseif ($offsetunit == 'year') {
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'y');
}
$actionCommReminder->dateremind = $db->idate($dateremind);
$actionCommReminder->typeremind = $remindertype;
$actionCommReminder->fk_user = $user;
$actionCommReminder->offsetunit = $offsetunit;
$actionCommReminder->offsetvalue = $offsetvalue;
$actionCommReminder->status = $actionCommReminder::STATUS_TODO;
$actionCommReminder->fk_actioncomm = $object->id;
if ($remindertype == 'email') $actionCommReminder->fk_email_template = $modelmail;
$res = $actionCommReminder->create($user);
if ($res <= 0){
// If error
$db->rollback();
$langs->load("errors");
$error = $langs->trans('ErrorReminderActionCommCreation');
setEventMessages($error, null, 'errors');
$action = 'create'; $donotclearsession = 1;
}
}
$db->commit();
if (!empty($backtopage))
{
@ -439,7 +487,7 @@ if (empty($reshook) && $action == 'update')
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority", "alphanohtml");
$object->priority = GETPOST("priority", "int");
$object->fulldayevent = GETPOST("fullday") ? 1 : 0;
$object->location = GETPOST('location', "alphanohtml");
$object->socid = GETPOST("socid", "int");
@ -791,7 +839,6 @@ if ($action == 'create')
$("#p2").removeAttr("disabled");
}
}
setdatefields();
$("#fullday").change(function() {
console.log("setdatefields");
setdatefields();
@ -805,11 +852,25 @@ if ($action == 'create')
{
$("#doneby").val(-1);
}
});
$("#actioncode").change(function() {
});
$("#actioncode").change(function() {
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else $("#dateend").removeClass("fieldrequired");
});
});
$("#aphour,#apmin").change(function() {
if ($("#actioncode").val() == \'AC_RDV\') {
console.log("Start date was changed, we modify end date "+(parseInt($("#aphour").val()))+" "+$("#apmin").val()+" -> "+("00" + (parseInt($("#aphour").val()) + 1)).substr(-2,2));
$("#p2hour").val(("00" + (parseInt($("#aphour").val()) + 1)).substr(-2,2));
$("#p2min").val($("#apmin").val());
$("#p2day").val($("#apday").val());
$("#p2month").val($("#apmonth").val());
$("#p2year").val($("#apyear").val());
$("#p2").val($("#ap").val());
}
});
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else $("#dateend").removeClass("fieldrequired");
setdatefields();
})';
print '</script>'."\n";
}
@ -832,8 +893,8 @@ if ($action == 'create')
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
$default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? '' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
$formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ?GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1);
$default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
$formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1);
print '</td></tr>';
}
@ -1084,14 +1145,16 @@ if ($action == 'create')
}
// Priority
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
print '<input type="text" name="priority" value="'.(GETPOST('priority') ?GETPOST('priority') : ($object->priority ? $object->priority : '')).'" size="5">';
print '</td></tr>';
if (! empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
print '<input type="text" name="priority" value="'.(GETPOSTISSET('priority') ? GETPOST('priority', 'int') : ($object->priority ? $object->priority : '')).'" size="5">';
print '</td></tr>';
}
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ? GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>';
@ -1106,7 +1169,70 @@ if ($action == 'create')
print '</table>';
dol_fiche_end();
if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER)
{
//checkbox create reminder
print '<br>';
print '<tr><td>'.$langs->trans("AddReminder").'</td><td colspan="3"><input type="checkbox" id="addreminder" name="addreminder"></td></tr>';
print '<div class="reminderparameters" style="display: none;">';
print '<hr>';
print load_fiche_titre($langs->trans("AddReminder"), '', '');
print '<table class="border centpercent">';
//Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
print '<input type="number" name="offsetvalue" value="10" size="5">';
print '</td></tr>';
//Time Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("TimeType").'</td><td colspan="3">';
print $form->select_type_duration('offsetunit');
print '</td></tr>';
//Reminder Type
$TRemindTypes = array();
if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail');
if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush');
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
print $form->selectarray('selectremindertype', $TRemindTypes);
print '</td></tr>';
//Mail Model
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->select_model_mail('actioncommsend', 'actioncomm_send');
print '</td></tr>';
print '</table>';
print '</div>';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#addreminder").click(function(){
if (this.checked) {
$(".reminderparameters").show();
} else {
$(".reminderparameters").hide();
}
});
$("#selectremindertype").click(function(){
var selected_option = $("#selectremindertype option:selected").val();
if(selected_option == "email") {
$("#select_actioncommsendmodel_mail").closest("tr").show();
} else {
$("#select_actioncommsendmodel_mail").closest("tr").hide();
};
});
})';
print '</script>'."\n";
}
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';

View File

@ -1393,6 +1393,8 @@ class ActionComm extends CommonObject
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype;
if (!empty($this->location))
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location;
if (isset($this->transparency))
$tooltip .= '<br><b>'.$langs->trans('Busy').':</b> '.yn($this->transparency);
if (!empty($this->note_private))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '<br>', $this->note_private));
$linkclose = '';

View File

@ -74,12 +74,15 @@ class ActionCommReminder extends CommonObject
*/
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'dateremind' => array('type'=>'datetime', 'label'=>'DateRemind', 'visible'=>1, 'enabled'=>1, 'position'=>60, 'notnull'=>1, 'index'=>1,),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'dateremind' => array('type'=>'datetime', 'label'=>'DateRemind', 'visible'=>1, 'enabled'=>1, 'position'=>60, 'notnull'=>1, 'index'=>1,),
'typeremind' => array('type'=>'varchar(32)', 'label'=>'TypeRemind', 'visible'=>-1, 'enabled'=>1, 'position'=>55, 'notnull'=>1, 'comment'=>"email, browser, sms",),
'fk_user' => array('type'=>'integer', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>65, 'notnull'=>1, 'index'=>1,),
'offsetvalue' => array('type'=>'integer', 'label'=>'OffsetValue', 'visible'=>1, 'enabled'=>1, 'position'=>56, 'notnull'=>1,),
'offsetunit' => array('type'=>'varchar(1)', 'label'=>'OffsetUnit', 'visible'=>1, 'enabled'=>1, 'position'=>57, 'notnull'=>1, 'comment'=>"m, h, d, w",),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>0, 'arrayofkeyval'=>array('0'=>'ToDo', '1'=>'Done')),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>58, 'notnull'=>1, 'default'=>0, 'index'=>0, 'arrayofkeyval'=>array('0'=>'ToDo', '1'=>'Done')),
'fk_actioncomm' => array('type'=>'integer', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>59, 'notnull'=>1, 'index'=>1,),
'fk_email_template' => array('type'=>'integer', 'label'=>'EmailTemplate', 'visible'=>1, 'enabled'=>1, 'position'=>60, 'notnull'=>0),
);
/**
@ -87,6 +90,11 @@ class ActionCommReminder extends CommonObject
*/
public $rowid;
/**
* @var int Entity
*/
public $entity;
public $dateremind;
public $typeremind;
@ -103,6 +111,19 @@ class ActionCommReminder extends CommonObject
*/
public $status;
/**
* @var int Project
*/
public $fk_actioncomm;
/**
* @var int Template Mail
*/
public $fk_email_template;
const STATUS_TODO = 0;
const STATUS_DONE = 1;
// END MODULEBUILDER PROPERTIES

View File

@ -1213,7 +1213,7 @@ if (empty($action) || $action == 'show_month') // View by month
$i = 0;
while ($i < 7)
{
print ' <td align="center">';
print ' <td class="center bold uppercase">';
$numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7);
if (!empty($conf->dol_optimize_smallscreen))
{
@ -1293,7 +1293,7 @@ if (empty($action) || $action == 'show_month') // View by month
print ' <tr class="liste_titre">';
$i = 0;
while ($i < 7) {
echo ' <td align="center">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."</td>\n";
echo ' <td class="center bold uppercase">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."</td>\n";
$i++;
}
echo " </tr>\n";
@ -1353,7 +1353,7 @@ if (empty($action) || $action == 'show_month') // View by month
echo ' <tr class="tagtr liste_titre">';
echo ' <td class="tagtd width100"></td>';
echo ' <td class="tagtd center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
echo ' <td class="tagtd center bold uppercase">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
echo " </td>\n";
/*
@ -1457,7 +1457,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($nonew <= 0)
{
print '<div class="tagtr"><div class="nowrap float">';
print '<a style="color: #666" href="'.DOL_URL_ROOT.'/comm/action/index.php?';
print '<a class="dayevent-aday" style="color: #666" href="'.DOL_URL_ROOT.'/comm/action/index.php?';
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
print $newparam;
print '">';
@ -1624,10 +1624,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// If colortouse is similar than background, we force to change it.
if (empty($event->transparency) && empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY))
{
print 'border: 2px solid #'.$colortouse.';';
print 'background: #f0f0f0;';
print 'border-left: 5px solid #'.$colortouse.';';
} else {
print 'background: #'.$colortouse.';';
print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($colortouse, -3).'), to(#'.dol_color_minus($colortouse, -1).'));';
print 'background: #f0f0f0;';
print 'border-left: 5px solid #'.dol_color_minus($colortouse, -3).';';
//print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($colortouse, -3).'), to(#'.dol_color_minus($colortouse, -1).'));';
}
//print 'background: #'.$colortouse.';';
//print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));';
@ -1706,7 +1708,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$event->label = $titletoshow;
$event->libelle = $titletoshow;
// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
$titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0);
$titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title', '', 0, 0);
$event->label = $savlabel;
$event->libelle = $savlabel;
}

View File

@ -698,7 +698,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
continue;
}
echo '<td align="center" colspan="'.($end_h - $begin_h).'">';
echo '<span class="opacitymedium spandayofweek">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7)).'</span>';
echo '<span class="bold spandayofweek">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7)).'</span>';
print "<br>";
if ($i) print dol_print_date(dol_time_plus_duree($currentdaytoshow, $i, 'd'), 'day');
else print dol_print_date($currentdaytoshow, 'day');

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
@ -64,7 +64,6 @@ if ($user->socid > 0) $id = $user->socid;
$result = restrictedArea($user, 'societe', $id, '&societe');
$action = GETPOST('action', 'aZ09');
$mode = GETPOST("mode");
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');

View File

@ -78,7 +78,7 @@ $search_login = GETPOST('search_login', 'alpha');
$search_product_category = GETPOST('search_product_category', 'int');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
@ -88,7 +88,7 @@ $search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth',
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_availability = GETPOST('search_availability', 'int');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha');

View File

@ -65,7 +65,7 @@ $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
@ -82,7 +82,7 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a
$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$optioncss = GETPOST('optioncss', 'alpha');
$billed = GETPOST('billed', 'int');
$search_status = GETPOST('search_status', 'int');

View File

@ -217,7 +217,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
$error = 0;
// Definition, nettoyage parametres
$num_releve = trim(GETPOST("num_releve", "alpha"));
$num_releve = GETPOST("num_releve", "alpha");
if ($num_releve)
{

View File

@ -98,7 +98,7 @@ if ($user->socid > 0) // Protection if external user
//$result = restrictedArea($user, 'monmodule', $id, '');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -100,7 +100,7 @@ $search_module_source = GETPOST('search_module_source', 'alpha');
$search_pos_source = GETPOST('search_pos_source', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_user = GETPOST('search_user', 'int');
@ -111,7 +111,7 @@ $search_date_valid_start = dol_mktime(0, 0, 0, GETPOST('search_date_valid_startm
$search_date_valid_end = dol_mktime(23, 59, 59, GETPOST('search_date_valid_endmonth', 'int'), GETPOST('search_date_valid_endday', 'int'), GETPOST('search_date_valid_endyear', 'int'));
$search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int'));
$search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int'));
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
@ -1206,7 +1206,7 @@ if ($resql)
// Ref
if (!empty($arrayfields['f.ref']['checked']))
{
print '<td class="nowrap">';
print '<td class="nowraponall">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
@ -1242,7 +1242,7 @@ if ($resql)
// Type
if (!empty($arrayfields['f.type']['checked']))
{
print '<td class="nowrap">';
print '<td class="nowraponall tdoverflowmax100" title="'.$facturestatic->getLibType().'">';
print $facturestatic->getLibType();
print "</td>";
if (!$i) $totalarray['nbfield']++;
@ -1251,7 +1251,7 @@ if ($resql)
// Date
if (!empty($arrayfields['f.date']['checked']))
{
print '<td align="center" class="nowrap">';
print '<td align="center" class="nowraponall">';
print dol_print_date($db->jdate($obj->df), 'day');
print '</td>';
if (!$i) $totalarray['nbfield']++;
@ -1260,7 +1260,7 @@ if ($resql)
// Date
if (!empty($arrayfields['f.date_valid']['checked']))
{
print '<td align="center" class="nowrap">';
print '<td align="center" class="nowraponall">';
print dol_print_date($db->jdate($obj->date_valid), 'day');
print '</td>';
if (!$i) $totalarray['nbfield']++;
@ -1269,7 +1269,7 @@ if ($resql)
// Date limit
if (!empty($arrayfields['f.date_lim_reglement']['checked']))
{
print '<td align="center" class="nowrap">'.dol_print_date($datelimit, 'day');
print '<td align="center" class="nowraponall">'.dol_print_date($datelimit, 'day');
if ($facturestatic->hasDelay())
{
print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
@ -1281,7 +1281,7 @@ if ($resql)
// Project ref
if (!empty($arrayfields['p.ref']['checked']))
{
print '<td class="nocellnopadd nowrap">';
print '<td class="nocellnopadd nowraponall">';
if ($obj->project_id > 0)
{
print $projectstatic->getNomUrl(1);
@ -1293,7 +1293,7 @@ if ($resql)
// Project title
if (!empty($arrayfields['p.title']['checked']))
{
print '<td class="nowrap">';
print '<td class="nowraponall">';
if ($obj->project_id > 0)
{
print $projectstatic->title;
@ -1326,7 +1326,7 @@ if ($resql)
// Zip
if (!empty($arrayfields['s.zip']['checked']))
{
print '<td>';
print '<td class="nowraponall">';
print $obj->zip;
print '</td>';
if (!$i) $totalarray['nbfield']++;
@ -1368,7 +1368,7 @@ if ($resql)
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '<td>';
print '<td class="tdoverflowmax100">';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
print '</td>';
if (!$i) $totalarray['nbfield']++;
@ -1404,7 +1404,7 @@ if ($resql)
// Amount HT
if (!empty($arrayfields['f.total_ht']['checked']))
{
print '<td class="right nowrap">'.price($obj->total_ht)."</td>\n";
print '<td class="right nowraponall">'.price($obj->total_ht)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht';
$totalarray['val']['f.total_ht'] += $obj->total_ht;
@ -1412,7 +1412,7 @@ if ($resql)
// Amount VAT
if (!empty($arrayfields['f.total_vat']['checked']))
{
print '<td class="right nowrap">'.price($obj->total_vat)."</td>\n";
print '<td class="right nowraponall">'.price($obj->total_vat)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat';
$totalarray['val']['f.total_vat'] += $obj->total_vat;
@ -1420,7 +1420,7 @@ if ($resql)
// Amount LocalTax1
if (!empty($arrayfields['f.total_localtax1']['checked']))
{
print '<td class="right nowrap">'.price($obj->total_localtax1)."</td>\n";
print '<td class="right nowraponall">'.price($obj->total_localtax1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1';
$totalarray['val']['f.total_localtax1'] += $obj->total_localtax1;
@ -1428,7 +1428,7 @@ if ($resql)
// Amount LocalTax2
if (!empty($arrayfields['f.total_localtax2']['checked']))
{
print '<td class="right nowrap">'.price($obj->total_localtax2)."</td>\n";
print '<td class="right nowraponall">'.price($obj->total_localtax2)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2';
$totalarray['val']['f.total_localtax2'] += $obj->total_localtax2;
@ -1436,7 +1436,7 @@ if ($resql)
// Amount TTC
if (!empty($arrayfields['f.total_ttc']['checked']))
{
print '<td class="right nowrap">'.price($obj->total_ttc)."</td>\n";
print '<td class="right nowraponall">'.price($obj->total_ttc)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc';
$totalarray['val']['f.total_ttc'] += $obj->total_ttc;
@ -1461,7 +1461,7 @@ if ($resql)
if (!empty($arrayfields['dynamount_payed']['checked']))
{
print '<td class="right nowrap">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowraponall">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalam';
$totalarray['val']['totalam'] += $totalpay;
@ -1470,7 +1470,7 @@ if ($resql)
// Pending amount
if (!empty($arrayfields['rtp']['checked']))
{
print '<td class="right nowrap">';
print '<td class="right nowraponall">';
print (!empty($remaintopay) ? price($remaintopay, 0, $langs) : '&nbsp;');
print '</td>'; // TODO Use a denormalized field
if (!$i) $totalarray['nbfield']++;
@ -1482,14 +1482,14 @@ if ($resql)
// Currency
if (!empty($arrayfields['f.multicurrency_code']['checked']))
{
print '<td class="nowrap">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
print '<td class="nowraponall">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
// Currency rate
if (!empty($arrayfields['f.multicurrency_tx']['checked']))
{
print '<td class="nowrap">';
print '<td class="nowraponall">';
$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
print "</td>\n";
if (!$i) $totalarray['nbfield']++;
@ -1497,31 +1497,31 @@ if ($resql)
// Amount HT
if (!empty($arrayfields['f.multicurrency_total_ht']['checked']))
{
print '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
print '<td class="right nowraponall">'.price($obj->multicurrency_total_ht)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
// Amount VAT
if (!empty($arrayfields['f.multicurrency_total_vat']['checked']))
{
print '<td class="right nowrap">'.price($obj->multicurrency_total_vat)."</td>\n";
print '<td class="right nowraponall">'.price($obj->multicurrency_total_vat)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
// Amount TTC
if (!empty($arrayfields['f.multicurrency_total_ttc']['checked']))
{
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
print '<td class="right nowraponall">'.price($obj->multicurrency_total_ttc)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['multicurrency_dynamount_payed']['checked']))
{
print '<td class="right nowrap">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowraponall">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
if (!$i) $totalarray['nbfield']++;
}
// Pending amount
if (!empty($arrayfields['multicurrency_rtp']['checked']))
{
print '<td class="right nowrap">';
print '<td class="right nowraponall">';
print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : '&nbsp;');
print '</td>'; // TODO Use a denormalized field
if (!$i) $totalarray['nbfield']++;

View File

@ -107,7 +107,7 @@ if (empty($reshook))
if (substr($key, 0, 7) == 'amount_' && GETPOST($key) != '')
{
$cursorfacid = substr($key, 7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$amounts[$cursorfacid] = price2num(GETPOST($key));
$totalpayment = $totalpayment + $amounts[$cursorfacid];
if (!empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result = $tmpinvoice->fetch($cursorfacid);
@ -134,7 +134,7 @@ if (empty($reshook))
} elseif (substr($key, 0, 21) == 'multicurrency_amount_')
{
$cursorfacid = substr($key, 21);
$multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key));
$multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result = $tmpinvoice->fetch($cursorfacid);

View File

@ -47,7 +47,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '
$type = GETPOST('type', 'aZ09');
$search_facture = GETPOST('search_facture', 'alpha');
$search_societe = trim(GETPOST('search_societe', 'alpha'));
$search_societe = GETPOST('search_societe', 'alpha');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;

View File

@ -62,7 +62,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all',
$search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars
$search_phone = GETPOST("search_phone", 'alpha');
$search_id = trim(GETPOST("search_id", "int"));
$search_id = GETPOST("search_id", "int");
$search_firstlast_only = GETPOST("search_firstlast_only", 'alpha');
$search_lastname = GETPOST("search_lastname", 'alpha');
$search_firstname = GETPOST("search_firstname", 'alpha');

View File

@ -1897,7 +1897,7 @@ if ($action == 'create')
print '</tr>';
print '<tr class="oddeven">';
print '<td class="nohover">'.$langs->trans("Comment").'</td><td colspan="3" class="nohover" colspan="'.($conf->margin->enabled ? 4 : 3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td>';
print '<td class="nohover">'.$langs->trans("Comment").'</td><td colspan="3" class="nohover" colspan="'.($conf->margin->enabled ? 4 : 3).'"><input type="text" class="minwidth300" name="comment" value="'.GETPOST("comment", 'alphanohtml').'"></td>';
print '<td class="nohover right">';
print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';

View File

@ -50,13 +50,13 @@ $search_name = GETPOST('search_name', 'alpha');
$search_email = GETPOST('search_email', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state", 'alpha'));
$search_state = GETPOST("search_state", 'alpha');
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_contract = GETPOST('search_contract', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$sall = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search_status = GETPOST('search_status', 'alpha');
$socid = GETPOST('socid', 'int');
$search_user = GETPOST('search_user', 'int');

View File

@ -1753,43 +1753,39 @@ class Form
$out .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
// Complete name with more info
$moreinfo = 0;
$moreinfo = '';
if (!empty($conf->global->MAIN_SHOW_LOGIN))
{
$out .= ($moreinfo ? ' - ' : ' (').$obj->login;
$moreinfo++;
$moreinfo .= ($moreinfo ? ' - ' : ' (').$obj->login;
}
if ($showstatus >= 0)
{
if ($obj->statut == 1 && $showstatus == 1)
{
$out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
$moreinfo++;
$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
}
if ($obj->statut == 0)
{
$out .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
$moreinfo++;
$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
}
}
if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity)
{
if (!$obj->entity)
{
$out .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
$moreinfo++;
$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
} else {
$out .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
$moreinfo++;
$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
}
}
$out .= ($moreinfo ? ')' : '');
$moreinfo .= ($moreinfo ? ')' : '');
if ($disableline && $disableline != '1')
{
$out .= ' - '.$disableline; // This is text from $enableonlytext parameter
$moreinfo .= ' - '.$disableline; // This is text from $enableonlytext parameter
}
$out .= $moreinfo;
$out .= '</option>';
$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
$i++;
}
@ -5598,9 +5594,11 @@ class Form
if ($addnowlink == 1)
{
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H', 'tzuser').'\');';
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
} elseif ($addnowlink == 2)
{
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
}
if ($fullday) $reset_scripts .= ' } ';
@ -5613,9 +5611,11 @@ class Form
if ($addnowlink == 1)
{
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M', 'tzuser').'\');';
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
} elseif ($addnowlink == 2)
{
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
}
if ($fullday) $reset_scripts .= ' } ';
}
@ -5673,6 +5673,40 @@ class Form
return $retstring;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* select_type_duration
*
* @param string $prefix Prefix
* @param string $selected Selected type
* @return string HTML select string
*/
public function select_type_duration($prefix, $selected = 'minute')
{
// phpcs:enable
global $langs;
$retstring = '';
$TDurationTypes = array('year'=>$langs->trans('Years'), 'month'=>$langs->trans('Month'), 'week'=>$langs->trans('Weeks'), 'day'=>$langs->trans('Days'), 'hour'=>$langs->trans('Hours'), 'minute'=>$langs->trans('Minutes'));
$retstring .= '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach ($TDurationTypes as $key=>$typeduration){
$retstring .= '<option value="'.$key.'"';
if($key == $selected)
{
$retstring .= " selected";
}
$retstring .= ">".$typeduration."</option>";
}
$retstring .= "</select>";
return $retstring;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to show a form to select a duration on a page
@ -6378,7 +6412,7 @@ class Form
* @param string $htmlname Name of select
* @param array $array Array with key+value
* @param array $selected Array with key+value preselected
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
* @param int $key_in_label 1 to show key like in "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $morecss Add more css style
* @param int $translate Translate and encode value
@ -6404,7 +6438,7 @@ class Form
// Add code for jquery to use multiselect
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
{
$out .= "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.' -->
<script>'."\n";
if ($addjscombo == 1)
{
@ -6465,15 +6499,16 @@ class Form
{
foreach ($array as $key => $value)
{
$newval = ($translate ? $langs->trans($value) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out .= '<option value="'.$key.'"';
if (is_array($selected) && !empty($selected) && in_array((string) $key, $selected) && ((string) $key != ''))
{
$out .= ' selected';
}
$out .= ' data-html="'.$newval.'"';
$out .= '>';
$newval = ($translate ? $langs->trans($value) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out .= dol_htmlentitiesbr($newval);
$out .= '</option>'."\n";
}
@ -7944,4 +7979,43 @@ class Form
return $ret;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* select_model_mail
*
* @param string $prefix Prefix
* @param string $modelType Model type
* @return string HTML select string
*/
public function select_model_mail($prefix, $modelType = '')
{
// phpcs:enable
global $langs, $db, $user;
$retstring = '';
$TModels = array();
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
if ($result > 0) {
foreach ($formmail->lines_model as $model){
$TModels[$model->id] = $model->label;
}
}
$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
foreach ($TModels as $id_model=>$label_model){
$retstring .= '<option value="'.$id_model.'"';
$retstring .= ">".$label_model."</option>";
}
$retstring .= "</select>";
return $retstring;
}
}

View File

@ -903,7 +903,7 @@ class FormTicket
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
print ' &nbsp; ';
print '<input class="button" type="submit" value="'.$langs->trans('Use').'" name="modelselected" id="modelselected">';
print '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
print '</div></td>';
}
@ -919,8 +919,7 @@ class FormTicket
// Subject
print '<tr class="email_line"><td class="titlefieldcreate">'.$langs->trans('Subject').'</td>';
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
print '<td><input type="text" class="text" size="80" name="subject" value="['.$label_title.' - '.$langs->trans("Ticket").' #'.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
print '<td><input type="text" class="text minwidth500" name="subject" value="[' . $conf->global->MAIN_INFO_SOCIETE_NOM . ' - ' . $langs->trans("Ticket") . ' ' . $this->ref . '] '.$langs->trans('TicketNewMessage').'" />';
print '</td></tr>';
// Destinataires

View File

@ -108,7 +108,7 @@ function getServerTimeZoneInt($refgmtdate = 'now')
*
* @param int $time Date timestamp (or string with format YYYY-MM-DD)
* @param int $duration_value Value of delay to add
* @param int $duration_unit Unit of added delay (d, m, y, w, h)
* @param int $duration_unit Unit of added delay (d, m, y, w, h, i)
* @return int New timestamp
*/
function dol_time_plus_duree($time, $duration_value, $duration_unit)
@ -116,6 +116,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
global $conf;
if ($duration_value == 0) return $time;
if ($duration_unit == 'i') return $time + (60 * $duration_value);
if ($duration_unit == 'h') return $time + (3600 * $duration_value);
if ($duration_unit == 'w') return $time + (3600 * 24 * 7 * $duration_value);

View File

@ -354,7 +354,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
if (empty($showpricebeforepagebreak)) {
if (empty($showpricebeforepagebreak) && ($i !== ($nblines - 1))) {
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
} else {
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.

View File

@ -392,7 +392,7 @@ class modEmailCollector extends DolibarrModules
$sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'to', 'jobs@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'candidature', 'tmp_from=EXTRACT:HEADER:^From:(.*)<.*>;fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*);description=EXTRACT:BODY:(.*);lastname=SET:__tmp_from__', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'candidature', 'tmp_from=EXTRACT:HEADER:^From:(.*)(<.*>)?;fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*);description=EXTRACT:BODY:(.*);lastname=SET:__tmp_from__', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sql[] = $sqlforexampleC1;
$sql[] = $sqlforexampleFilterC1;

View File

@ -44,7 +44,7 @@ if (!empty($actionsave))
$db->begin();
$i += dolibarr_set_const($db, 'CRON_KEY', trim(GETPOST("CRON_KEY")), 'chaine', 0, '', 0);
$i += dolibarr_set_const($db, 'CRON_KEY', GETPOST("CRON_KEY"), 'chaine', 0, '', 0);
if ($i >= 1)
{

View File

@ -120,9 +120,9 @@ if ($action == 'add' && $permtoadd)
}
}
$ref = trim(GETPOST("ref", 'alpha'));
$label = trim(GETPOST("label", 'alpha'));
$desc = trim(GETPOST("desc", 'alpha'));
$ref = GETPOST("ref", 'alpha');
$label = GETPOST("label", 'alpha');
$desc = GETPOST("desc", 'alpha');
$catParent = GETPOST("catParent", 'alpha'); // Can be an int (with ECM) or a string (with generic filemanager)
if ($catParent == '-1') $catParent = 0;

View File

@ -59,7 +59,7 @@ $search_company = GETPOST("search_company", 'alpha');
$search_tracking = GETPOST("search_tracking", 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_billed = GETPOST("search_billed", 'int');
@ -71,7 +71,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all',
$socid = GETPOST('socid', 'int');
$search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', 'int');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$search_product_category = GETPOST('search_product_category', 'int');
$optioncss = GETPOST('optioncss', 'alpha');

View File

@ -66,7 +66,7 @@ $search_refsupp = GETPOST('search_refsupp', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state", 'alpha'));
$search_state = GETPOST("search_state", 'alpha');
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_user = GETPOST('search_user', 'int');

View File

@ -94,7 +94,7 @@ $search_status = GETPOST('search_status', 'int');
$search_paymentmode = GETPOST('search_paymentmode', 'int');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_user = GETPOST('search_user', 'int');

View File

@ -129,7 +129,8 @@ if (empty($reshook))
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
$atleastonepaymentnotnull = 0;
$multicurrency_totalpayment = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice = new FactureFournisseur($db);
@ -138,7 +139,7 @@ if (empty($reshook))
if (substr($key, 0, 7) == 'amount_')
{
$cursorfacid = substr($key, 7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$amounts[$cursorfacid] = price2num(GETPOST($key));
if (!empty($amounts[$cursorfacid])) {
$atleastonepaymentnotnull++;
if (is_numeric($amounts[$cursorfacid])) {
@ -171,7 +172,7 @@ if (empty($reshook))
} elseif (substr($key, 0, 21) == 'multicurrency_amount_')
{
$cursorfacid = substr($key, 21);
$multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$multicurrency_amounts[$cursorfacid] = (GETPOST($key) ? price2num(GETPOST($key)) : 0);
$multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result = $tmpinvoice->fetch($cursorfacid);

View File

@ -144,7 +144,7 @@ if (empty($reshook))
elseif ($endhalfday == 'morning') $halfday = 1;
$valideur = GETPOST('valideur', 'int');
$description = trim(GETPOST('description'));
$description = trim(GETPOST('description', 'none'));
// If no type
if ($type <= 0)

View File

@ -297,3 +297,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516);
ALTER TABLE llx_actioncomm_reminder ADD COLUMN entity integer NOT NULL DEFAULT 1;
ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_actioncomm integer NOT NULL;
ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_email_template integer;
ALTER TABLE llx_actioncomm_reminder DROP INDEX uk_actioncomm_reminder_unique, ADD UNIQUE uk_actioncomm_reminder_unique (fk_user, typeremind, offsetvalue, offsetunit, fk_actioncomm);

View File

@ -20,6 +20,6 @@ ALTER TABLE llx_actioncomm_reminder ADD INDEX idx_actioncomm_reminder_dateremind
ALTER TABLE llx_actioncomm_reminder ADD INDEX idx_actioncomm_reminder_fk_user (fk_user);
-- END MODULEBUILDER INDEXES
ALTER TABLE llx_actioncomm_reminder ADD UNIQUE INDEX uk_actioncomm_reminder_unique(fk_user, typeremind, offsetvalue, offsetunit);
ALTER TABLE llx_actioncomm_reminder ADD UNIQUE INDEX uk_actioncomm_reminder_unique(fk_actioncomm, fk_user, typeremind, offsetvalue, offsetunit);

View File

@ -22,6 +22,10 @@ CREATE TABLE llx_actioncomm_reminder(
fk_user integer NOT NULL,
offsetvalue integer NOT NULL,
offsetunit varchar(1) NOT NULL,
status integer NOT NULL DEFAULT 0
status integer NOT NULL DEFAULT 0,
entity integer NOT NULL DEFAULT 1,
fk_actioncomm integer NOT NULL,
fk_email_template integer
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

View File

@ -14,13 +14,14 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- Table to store all product variants of a parent product
-- ============================================================================
CREATE TABLE llx_product_attribute_combination
(
rowid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
fk_product_parent INTEGER NOT NULL,
fk_product_child INTEGER NOT NULL,
fk_product_parent INTEGER NOT NULL, -- id of product id that is parent product
fk_product_child INTEGER NOT NULL, -- id of product id that is variant (child) product
variation_price DOUBLE(24,8) NOT NULL,
variation_price_percentage INTEGER NULL,
variation_weight REAL NOT NULL,

View File

@ -23,5 +23,5 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_rec
ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitmentcandidature_email_msgid(email_msgid);
--ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_mymodule_myobject_fk_field FOREIGN KEY (fk_field) REFERENCES llx_mymodule_myotherobject(rowid);
-- ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_mymodule_myobject_fk_field FOREIGN KEY (fk_field) REFERENCES llx_mymodule_myotherobject(rowid);

View File

@ -2029,3 +2029,4 @@ MeasuringScaleDesc=The scale is the number of places you have to move the decima
TemplateAdded=Template added
TemplateUpdated=Template updated
TemplateDeleted=Template deleted
MailToSendEventPush=Template for event reminder emails

View File

@ -160,3 +160,9 @@ DateStartPlusOne=Date start + 1 hour
SetAllEventsToTodo=Set all events to todo
SetAllEventsToInProgress=Set all events to in progress
SetAllEventsToFinished=Set all events to finished
ReminderTime=Reminder period before the event
TimeType=Duration type
ReminderType=Callback type
AddReminder=Create an automatic reminder notification for this event
ErrorReminderActionCommCreation=Error creating the reminder notification for this event
BrowserPush=Browser Notification

View File

@ -1082,4 +1082,4 @@ CREATEInDolibarr=Record %s create
MODIFYInDolibarr=Record %s modified
DELETEInDolibarr=Record %s deleted
VALIDATEInDolibarr=Record %s validated
APPROVEDInDolibarr=Record %s approved
APPROVEDInDolibarr=Record %s approved

View File

@ -16,5 +16,8 @@ descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales order
# Autoclassify purchase order
descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposal)
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order)
descWORKFLOW_BILL_ON_RECEPTION=Classify receptions to "billed" when a linked supplier order is validated
# Autoclose intervention
descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the ticket when a ticket is closed
AutomaticCreation=Automatic creation
AutomaticClassification=Automatic classification

View File

@ -158,3 +158,9 @@ DateStartPlusOne=Date de début + 1 heure
SetAllEventsToTodo=Réglez tous les événements à "A faire"
SetAllEventsToInProgress=Définir tous les événements à "En cours"
SetAllEventsToFinished=Définir tous les événements sur "Terminés"
ReminderTime=Délai de rappel avant l'événement
TimeType=Type de durée
ReminderType=Type de rappel
AddReminder=Créer une notification de rappel automatique pour cet évènement
ErrorReminderActionCommCreation=Erreur lors de la création de la notification de rappel de cet événement
BrowserPush=Notification navigateur

View File

@ -1042,5 +1042,4 @@ NotUsedForThisCustomer=Non utilisé pour ce client
AmountMustBePositive=Le montant doit être positif.
ByStatus=Par statut
InformationMessage=Information
ASAP=Dès que possible
ASAP=Dès que possible

View File

@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea
if (!$sortorder) $sortorder = "ASC";
// Initialize array of search criterias
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -79,7 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -107,7 +107,7 @@ if ($user->socid > 0) // Protection if external user
// Initialize array of search criterias
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -83,7 +83,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -320,7 +320,7 @@ class ActionsCardProduct
if ($field['enabled'])
{
$fieldname = "s".$field['alias'];
$$fieldname = trim(GETPOST($fieldname));
$$fieldname = GETPOST($fieldname);
}
}

View File

@ -59,7 +59,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -64,7 +64,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -81,7 +81,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
}
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -97,7 +97,7 @@ $fieldstosearchall = array(
);
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -53,7 +53,7 @@ $search_ref_supplier = GETPOST('search_ref_supplier');
$search_company = GETPOST("search_company");
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_billed = GETPOST("search_billed", 'int');

View File

@ -88,7 +88,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea
if (!$sortorder) $sortorder = "ASC";
// Initialize array of search criterias
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea
if (!$sortorder) $sortorder = "ASC";
// Initialize array of search criterias
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -1454,7 +1454,7 @@ class Societe extends CommonObject
* @param int $rowid Id of third party to load
* @param string $ref Reference of third party, name (Warning, this can return several records)
* @param string $ref_ext External reference of third party (Warning, this information is a free field not provided by Dolibarr)
* @param string $notused Not used
* @param string $barcode Barcode of third party to load
* @param string $idprof1 Prof id 1 of third party (Warning, this can return several records)
* @param string $idprof2 Prof id 2 of third party (Warning, this can return several records)
* @param string $idprof3 Prof id 3 of third party (Warning, this can return several records)
@ -1465,12 +1465,12 @@ class Societe extends CommonObject
* @param string $ref_alias Name_alias of third party (Warning, this can return several records)
* @return int >0 if OK, <0 if KO or if two records found for same ref or idprof, 0 if not found.
*/
public function fetch($rowid, $ref = '', $ref_ext = '', $notused = '', $idprof1 = '', $idprof2 = '', $idprof3 = '', $idprof4 = '', $idprof5 = '', $idprof6 = '', $email = '', $ref_alias = '')
public function fetch($rowid, $ref = '', $ref_ext = '', $barcode = '', $idprof1 = '', $idprof2 = '', $idprof3 = '', $idprof4 = '', $idprof5 = '', $idprof6 = '', $email = '', $ref_alias = '')
{
global $langs;
global $conf;
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) return -1;
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($barcode) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) return -1;
$sql = 'SELECT s.rowid, s.nom as name, s.name_alias, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm';
$sql .= ', s.status';
@ -1515,7 +1515,7 @@ class Societe extends CommonObject
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
if ($ref_alias) $sql .= " AND s.name_alias = '".$this->db->escape($ref_alias)."'";
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
if ($notused) $sql .= " AND s.ref_int = '".$this->db->escape($notused)."'";
if ($barcode) $sql .= " AND s.barcode = '".$this->db->escape($barcode)."'";
if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";
if ($idprof2) $sql .= " AND s.siret = '".$this->db->escape($idprof2)."'";
if ($idprof3) $sql .= " AND s.ape = '".$this->db->escape($idprof3)."'";

View File

@ -1047,7 +1047,7 @@ while ($i < min($num, $limit))
{
$savalias = $obj->name_alias;
if (!empty($arrayfields['s.name_alias']['checked'])) $companystatic->name_alias = '';
print '<td class="tdoverflowmax200">';
print '<td'.(empty($conf->global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').'>';
if ($contextpage == 'poslist')
{
print $obj->name;

View File

@ -76,7 +76,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($objectwebsiteaccount
unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($objectwebsiteaccount->fields as $key => $val)
{

View File

@ -1763,7 +1763,7 @@ class SupplierProposal extends CommonObject
if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) list($fk_multicurrency, $multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $product->multicurrency_code);
$productsupplier->id = $product->fk_product;
$productsupplier->update_buyprice($product->qty, $product->subprice, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_subprice, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', '');
$productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', '');
}
return 1;

View File

@ -62,7 +62,7 @@ $search_societe = GETPOST('search_societe', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');

View File

@ -637,6 +637,9 @@ textarea.centpercent {
.nobold {
font-weight: normal !important;
}
.uppercase {
text-transform: uppercase;
}
.nounderline {
text-decoration: none;
}
@ -1427,7 +1430,8 @@ td.showDragHandle {
<?php } ?>
.side-nav {
display: table-cell;
display: block;
float: left;
border-<?php echo $right; ?>: 1px solid #E0E0E0;
box-shadow: 3px 0 6px -2px #eee;
background: var(--colorbackvmenu1);
@ -3082,6 +3086,10 @@ table.paddingtopbottomonly tr td {
.liste_titre_filter {
background: var(--colorbacktitle1) !important;
}
.liste_titre2 {
background: var(--colorbackhmenu1) !important;
color: #fff;
}
table:not(.listwithfilterbefore) tr.liste_titre_filter:first-of-type td.liste_titre {
padding-top: 5px;
}
@ -4478,6 +4486,7 @@ table.cal_month td { padding-left: 1px !important; padding-right: 1px !important
.cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { }
.peruser_notbusy { opacity: 0.5; }
div.event { margin: 8px; border-radius: 4px; box-shadow: 2px 2px 5px rgba(100, 100, 100, 0.2); }
table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; min-height: 20px; filter: saturate(0.8); border-radius: 3px; }
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
table.cal_event td.cal_event { padding: 4px 4px !important; }
@ -4486,10 +4495,13 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
.cal_event a:link { color: #111111; font-weight: normal !important; }
.cal_event a:visited { color: #111111; font-weight: normal !important; }
.cal_event a:active { color: #111111; font-weight: normal !important; }
.cal_event_busy a:hover { color: #111111; font-weight: normal !important; color:rgba(255,255,255,.75); }
.cal_event_notbusy a.cal_event_title:hover { color: #111111; font-weight: normal !important; color:rgba(255,255,255,.75); }
.cal_event_busy { }
.cal_peruserviewname { max-width: 140px; height: 22px; }
table.cal_month tr td table.nobordernopadding tr td { padding: 0 2px 0 2px; }
a.dayevent-aday {
padding-left: 8px;
}
.calendarviewcontainertr { height: 100px; }

View File

@ -4341,6 +4341,7 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; opacity: 0.5; }
div.event { margin: 8px; border-radius: 4px; box-shadow: 2px 2px 5px rgba(100, 100, 100, 0.2); }
table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 3px; border-radius: 3px; min-height: 20px; }
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
table.cal_event td.cal_event { padding: 4px 4px !important; }

View File

@ -78,7 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{
@ -471,7 +471,7 @@ if (empty($reshook)) {
if ($action == 'setsubject') {
if ($object->fetch(GETPOST('id', 'int'))) {
if ($action == 'setsubject') {
$object->subject = trim(GETPOST('subject', 'alphanohtml'));
$object->subject = GETPOST('subject', 'alphanohtml');
}
if ($action == 'setsubject' && empty($object->subject)) {

View File

@ -1700,24 +1700,27 @@ class Ticket extends CommonObject
$error = 0;
// Valid and close fichinter linked
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds)
{
foreach ($this->linkedObjectsIds['fichinter'] as $fichinter_id) {
$fichinter = new Fichinter($this->db);
$fichinter->fetch($fichinter_id);
if ($fichinter->statut == 0) {
$result = $fichinter->setValid($user);
if (!$result) {
$this->errors[] = $fichinter->error;
$error++;
if (!empty($conf->ficheinter->enabled) && ! empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
dol_syslog("We have closed the ticket, so we close all linked interventions");
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds)
{
foreach ($this->linkedObjectsIds['fichinter'] as $fichinter_id) {
$fichinter = new Fichinter($this->db);
$fichinter->fetch($fichinter_id);
if ($fichinter->statut == 0) {
$result = $fichinter->setValid($user);
if (!$result) {
$this->errors[] = $fichinter->error;
$error++;
}
}
}
if ($fichinter->statut < 3) {
$result = $fichinter->setStatut(3);
if (!$result) {
$this->errors[] = $fichinter->error;
$error++;
if ($fichinter->statut < 3) {
$result = $fichinter->setStatut(3);
if (!$result) {
$this->errors[] = $fichinter->error;
$error++;
}
}
}
}
@ -2535,28 +2538,28 @@ class Ticket extends CommonObject
// Message send
$message = $langs->trans('TicketMessageMailIntroText');
$message .= "\n\n";
$message .= GETPOST('message', 'restricthtml');
$message .= '<br><br>';
$message .= GETPOST('message', 'none');
// Customer company infos
$message .= "\n\n";
$message .= '<br><br>';
$message .= "==============================================";
$message .= !empty($object->thirdparty->name) ? "\n" . $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? "\n" . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? "\n" . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
$message .= !empty($object->thirdparty->name) ? '<br>' . $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? '<br>' . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
// Email send to
$message .= "\n\n";
$message .= '<br><br>';
if (!empty($assigned_user_dont_have_email)) {
$message .= "\n" . $langs->trans('NoEMail') . ' : ' . $assigned_user_dont_have_email;
$message .= '<br>' . $langs->trans('NoEMail') . ' : ' . $assigned_user_dont_have_email;
}
foreach ($sendto as $val) {
$message .= "\n" . $langs->trans('TicketNotificationRecipient') . ' : ' . $val;
$message .= '<br>' . $langs->trans('TicketNotificationRecipient') . ' : ' . $val;
}
// URL ticket
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
$message .= "\n\n";
$message .= '<br><br>';
$message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : <a href="' . $url_internal_ticket . '">' . $object->track_id . '</a>';
$this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames);
@ -2584,15 +2587,15 @@ class Ticket extends CommonObject
$message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE;
$message = $langs->trans('TicketMessageMailIntroText');
$message .= "\n\n";
$message .= '<br><br>';
$message .= GETPOST('message', 'restricthtml');
// Coordonnées client
$message .= "\n\n";
$message .= "==============================================\n";
$message .= '<br><br>';
$message .= "==============================================<br>";
$message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? "\n" . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? "\n" . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
$message .= !empty($object->thirdparty->town) ? '<br>' . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
// Build array to display recipient list
foreach ($internal_contacts as $key => $info_sendto) {
@ -2606,15 +2609,15 @@ class Ticket extends CommonObject
//Contact type
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : '');
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : '');
}
}
$message .= "\n";
$message .= '<br>';
// URL ticket
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
// altairis: make html link on url
$message .= "\n" . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : <a href="' . $url_internal_ticket . '">' . $object->track_id . '</a>' . "\n";
$message .= '<br>' . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : <a href="' . $url_internal_ticket . '">' . $object->track_id . '</a><br>';
// Add global email address recipient
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
@ -2652,12 +2655,12 @@ class Ticket extends CommonObject
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
$subject = GETPOST('subject') ? GETPOST('subject') : '[' . $label_title . '- ticket #' . $object->track_id . '] ' . $langs->trans('TicketNewMessage');
$message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKET_MESSAGE_MAIL_INTRO;
$message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE;
$message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : $conf->global->TICKET_MESSAGE_MAIL_INTRO;
$message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature', 'restricthtml') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE;
// We put intro after
$message = GETPOST('message');
$message .= "\n\n";
$message = GETPOST('message', 'restricthtml');
$message .= '<br><br>';
foreach ($external_contacts as $key => $info_sendto) {
// altairis: avoid duplicate emails to external contacts
@ -2669,17 +2672,17 @@ class Ticket extends CommonObject
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">";
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : '');
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : '');
}
}
// If public interface is not enable, use link to internal page into mail
$url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ?
(!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)) . '?track_id=' . $object->track_id;
$message .= "\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="' . $url_public_ticket . '">' . $object->track_id . '</a>' . "\n";
$message .= '<br>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="' . $url_public_ticket . '">' . $object->track_id . '</a><br>';
// Build final message
$message = $message_intro . $message;
$message = $message_intro . '<br><br>' . $message;
// Add signature
$message .= '<br>' . $message_signature;
@ -2771,8 +2774,6 @@ class Ticket extends CommonObject
$filename = $mimefilename_list;
$mimetype = $mimetype_list;
$message_to_send = dol_nl2br($message);
// Envoi du mail
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
@ -2780,7 +2781,7 @@ class Ticket extends CommonObject
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$trackid = "tic".$this->id;
$mailfile = new CMailFile($subject, $receiver, $from, $message_to_send, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid);
$mailfile = new CMailFile($subject, $receiver, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid);
if ($mailfile->error) {
setEventMessages($mailfile->error, null, 'errors');
} else {

View File

@ -129,7 +129,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
$action = "create"; // Go back to create page
} else {
$object->name = trim(GETPOST("nom", 'nohtml'));
$object->name = GETPOST("nom", 'nohtml');
//$object->nom = $object->name; // For backward compatibility
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none')));
@ -204,7 +204,7 @@ if (empty($reshook)) {
$object->oldcopy = clone $object;
$object->name = trim(GETPOST("nom", 'nohtml'));
$object->name = GETPOST("nom", 'nohtml');
//$object->nom = $object->name; // For backward compatibility
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none')));

View File

@ -45,8 +45,8 @@ $action = GETPOST('action', 'alpha');
$mode = $dolibarr_main_authentication;
if (!$mode) $mode = 'http';
$username = trim(GETPOST('username', 'alpha'));
$passwordhash = trim(GETPOST('passwordhash', 'alpha'));
$username = GETPOST('username', 'alpha');
$passwordhash = GETPOST('passwordhash', 'alpha');
$conf->entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : 1);
// Instantiate hooks of thirdparty module only if not already define

View File

@ -41,7 +41,7 @@ if ($actionsave)
$db->begin();
$i += dolibarr_set_const($db, 'WEBSERVICES_KEY', trim(GETPOST("WEBSERVICES_KEY")), 'chaine', 0, '', $conf->entity);
$i += dolibarr_set_const($db, 'WEBSERVICES_KEY', GETPOST("WEBSERVICES_KEY"), 'chaine', 0, '', $conf->entity);
if ($i >= 1)
{

View File

@ -51,7 +51,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');

View File

@ -93,7 +93,7 @@ if ($user->socid > 0) {
//$result = restrictedArea($user, 'mymodule', $id, '');
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');