Merge branch 'develop' into dev_add_IMAPport_email_collector
This commit is contained in:
commit
a57c96f6d9
@ -387,6 +387,10 @@ if (empty($numref)) {
|
||||
* Show list of record into a bank statement
|
||||
*/
|
||||
|
||||
$title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements");
|
||||
$helpurl = "";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
// Onglets
|
||||
$head = account_statement_prepare_head($object, $numref);
|
||||
print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account');
|
||||
|
||||
@ -2083,7 +2083,7 @@ if ($resql) {
|
||||
|
||||
// Amount HT
|
||||
if (!empty($arrayfields['f.total_ht']['checked'])) {
|
||||
print '<td class="right nowraponall">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right nowraponall amount">'.price($obj->total_ht)."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -85,13 +85,19 @@ class box_birthdays extends ModeleBoxes
|
||||
if ($user->rights->user->user->lire) {
|
||||
$tmparray = dol_getdate(dol_now(), true);
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, u.email, u.statut as status";
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, 'birth' as typea, u.email, u.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.statut = 1";
|
||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||
$sql .= " ORDER BY DAY(u.birth) ASC";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
$sql .= ' UNION ';
|
||||
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, 'employment' as typea, u.email, u.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.statut = 1";
|
||||
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
||||
|
||||
$sql .= " ORDER BY DAY(datea) ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -108,9 +114,13 @@ class box_birthdays extends ModeleBoxes
|
||||
$userstatic->email = $objp->email;
|
||||
$userstatic->statut = $objp->status;
|
||||
|
||||
$dateb = $this->db->jdate($objp->birth);
|
||||
$dateb = $this->db->jdate($objp->datea);
|
||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||
|
||||
$picb = '<i class="fas fa-birthday-cake inline-block"></i>';
|
||||
$pice = '<i class="fas fa-briefcase inline-block"></i>';
|
||||
$typea = ($objp->typea == 'birth') ? $picb : $pice;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
'text' => $userstatic->getNomUrl(1),
|
||||
@ -119,7 +129,18 @@ class box_birthdays extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
||||
'text' => dol_print_date($dateb, "day", 'tzserver')
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right nowraponall"',
|
||||
'text' => $age.' '.$langs->trans('DurationYears')
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'text' => $typea,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
/*$this->info_box_contents[$line][] = array(
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -547,10 +547,18 @@ class CMailFile
|
||||
}
|
||||
|
||||
if (!empty($this->addr_cc)) {
|
||||
$this->message->setCc($this->getArrayAddress($this->addr_cc));
|
||||
try {
|
||||
$this->message->setCc($this->getArrayAddress($this->addr_cc));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
if (!empty($this->addr_bcc)) {
|
||||
$this->message->setBcc($this->getArrayAddress($this->addr_bcc));
|
||||
try {
|
||||
$this->message->setBcc($this->getArrayAddress($this->addr_bcc));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
//if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
|
||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) {
|
||||
|
||||
@ -744,6 +744,7 @@ abstract class CommonObject
|
||||
public function setUpperOrLowerCase()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) {
|
||||
$this->lastname = dol_ucwords(dol_strtolower($this->lastname));
|
||||
$this->firstname = dol_ucwords(dol_strtolower($this->firstname));
|
||||
@ -759,8 +760,12 @@ abstract class CommonObject
|
||||
$this->address = dol_strtoupper($this->address);
|
||||
$this->town = dol_strtoupper($this->town);
|
||||
}
|
||||
$this->email = dol_strtolower($this->email);
|
||||
$this->personal_email = dol_strtolower($this->personal_email);
|
||||
if (isset($this->email)) {
|
||||
$this->email = dol_strtolower($this->email);
|
||||
}
|
||||
if (isset($this->personal_email)) {
|
||||
$this->personal_email = dol_strtolower($this->personal_email);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -119,7 +119,7 @@ class FormTicket
|
||||
|
||||
$this->action = 'add';
|
||||
|
||||
$this->withcompany = $conf->societe->enabled ? 1 : 0;
|
||||
$this->withcompany = isModEnabled("societe");
|
||||
$this->withfromsocid = 0;
|
||||
$this->withfromcontactid = 0;
|
||||
//$this->withreadid=0;
|
||||
@ -169,7 +169,7 @@ class FormTicket
|
||||
print dol_get_fiche_head(null, 'card', '', 0, '');
|
||||
}
|
||||
|
||||
print '<form method="POST" '.($withdolfichehead ? '' : 'style="margin-bottom: 30px;" ').'name="ticket" id="form_create_ticket" enctype="multipart/form-data" action="'.$this->param["returnurl"].'">';
|
||||
print '<form method="POST" '.($withdolfichehead ? '' : 'style="margin-bottom: 30px;" ').'name="ticket" id="form_create_ticket" enctype="multipart/form-data" action="'.(!empty($this->param["returnurl"]) ? $this->param["returnurl"] : "").'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="'.$this->action.'">';
|
||||
foreach ($this->param as $key => $value) {
|
||||
@ -341,10 +341,12 @@ class FormTicket
|
||||
print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title;
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
if ($this->withreadid > 0) {
|
||||
if (isset($this->withreadid) && $this->withreadid > 0) {
|
||||
$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.'';
|
||||
} else {
|
||||
$subject = GETPOST('subject', 'alpha');
|
||||
}
|
||||
print '<input class="text minwidth500" id="subject" name="subject" value="'.(GETPOST('subject', 'alpha') ? GETPOST('subject', 'alpha') : $subject).'" autofocus />';
|
||||
print '<input class="text minwidth500" id="subject" name="subject" value="'.$subject.'" autofocus />';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
@ -643,7 +645,7 @@ class FormTicket
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $form->buttonsSaveCancel((($this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
|
||||
print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
|
||||
|
||||
/*
|
||||
print '<div class="center">';
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.net>
|
||||
* Copyright (C) 2019-2022 Thibault Foucart <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
@ -7388,6 +7388,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
|
||||
}
|
||||
if (!empty($conf->propal->enabled) && (!is_object($object) || $object->element == 'propal')) {
|
||||
$substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature';
|
||||
}
|
||||
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
|
||||
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';
|
||||
$substitutionarray['__SECUREKEYPAYMENT__'] = 'Security key (if key is not unique per record)';
|
||||
@ -9141,6 +9144,7 @@ function printCommonFooter($zone = 'private')
|
||||
|
||||
print "\n";
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n<!-- A script section to add menuhider handler on backoffice, manage focus and madatory fields, tuning info, ... -->\n";
|
||||
print '<script>'."\n";
|
||||
print 'jQuery(document).ready(function() {'."\n";
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ function ticket_prepare_head($object)
|
||||
$head[$h][2] = 'tabTicket';
|
||||
$h++;
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid) && $conf->societe->enabled) {
|
||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid) && isModEnabled("societe")) {
|
||||
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id;
|
||||
$head[$h][1] = $langs->trans('ContactsAddresses');
|
||||
|
||||
@ -284,8 +284,8 @@ class doc_generic_asset_odt extends ModelePDFAsset
|
||||
|
||||
dol_mkdir($conf->asset->dir_temp);
|
||||
if (!is_writable($conf->asset->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->asset->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->asset->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -183,16 +183,16 @@ class modPhpbarcode extends ModeleBarCode
|
||||
*/
|
||||
public function writeBarCode($code, $encoding, $readable = 'Y', $scale = 1, $nooutputiferror = 0)
|
||||
{
|
||||
global $conf, $filebarcode;
|
||||
global $conf, $filebarcode, $langs;
|
||||
|
||||
dol_mkdir($conf->barcode->dir_temp);
|
||||
if (!is_writable($conf->barcode->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->barcode->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
|
||||
$file = $conf->barcode->dir_temp . '/barcode_' . $code . '_' . $encoding . '.png';
|
||||
|
||||
$filebarcode = $file; // global var to be used in barcode_outimage called by barcode_print in buildBarCode
|
||||
|
||||
|
||||
@ -155,16 +155,16 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
*/
|
||||
public function writeBarCode($code, $encoding, $readable = 'Y', $scale = 1, $nooutputiferror = 0)
|
||||
{
|
||||
global $conf, $_GET;
|
||||
global $conf, $langs, $_GET;
|
||||
|
||||
dol_mkdir($conf->barcode->dir_temp);
|
||||
if (!is_writable($conf->barcode->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->barcode->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
|
||||
$file = $conf->barcode->dir_temp . '/barcode_' . $code . '_' . $encoding . '.png';
|
||||
|
||||
$tcpdfEncoding = $this->getTcpdfEncodingType($encoding);
|
||||
if (empty($tcpdfEncoding)) {
|
||||
|
||||
@ -274,7 +274,7 @@ class doc_generic_bom_odt extends ModelePDFBom
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -283,11 +283,11 @@ class doc_generic_bom_odt extends ModelePDFBom
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -295,8 +295,8 @@ class doc_generic_bom_odt extends ModelePDFBom
|
||||
|
||||
dol_mkdir($conf->bom->dir_temp);
|
||||
if (!is_writable($conf->bom->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->bom->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->bom->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -289,11 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -301,8 +301,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
|
||||
dol_mkdir($conf->commande->dir_temp);
|
||||
if (!is_writable($conf->commande->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->commande->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->commande->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -266,7 +266,7 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -275,11 +275,11 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -287,8 +287,8 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
|
||||
dol_mkdir($conf->contrat->dir_temp);
|
||||
if (!is_writable($conf->contrat->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->contrat->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->contrat->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -287,11 +287,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -299,8 +299,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
|
||||
dol_mkdir($conf->expedition->dir_temp);
|
||||
if (!is_writable($conf->expedition->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->expedition->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->expedition->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -287,11 +287,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
@ -300,8 +300,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
|
||||
dol_mkdir($conf->facture->dir_temp);
|
||||
if (!is_writable($conf->facture->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->facture->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->facture->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -268,7 +268,7 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -277,11 +277,11 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -289,8 +289,8 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
|
||||
dol_mkdir($conf->adherent->dir_temp);
|
||||
if (!is_writable($conf->adherent->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->adherent->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->adherent->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ class doc_generic_mo_odt extends ModelePDFMo
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -276,11 +276,11 @@ class doc_generic_mo_odt extends ModelePDFMo
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -288,8 +288,8 @@ class doc_generic_mo_odt extends ModelePDFMo
|
||||
|
||||
dol_mkdir($conf->mrp->dir_temp);
|
||||
if (!is_writable($conf->mrp->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->mrp->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mrp->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,7 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -287,11 +287,11 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -299,8 +299,8 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
|
||||
dol_mkdir($conf->product->dir_temp);
|
||||
if (!is_writable($conf->product->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->product->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->product->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -556,7 +556,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -565,11 +565,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -577,8 +577,8 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
|
||||
dol_mkdir($conf->project->dir_temp);
|
||||
if (!is_writable($conf->project->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->project->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->project->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -517,9 +517,9 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
$newfiletmp = preg_replace('/\.(ods|odt)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
$file = $dir.'/'.$newfiletmp.'.odt';
|
||||
$file = $dir . '/' . $newfiletmp . '.odt';
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -527,8 +527,8 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
|
||||
dol_mkdir($conf->project->dir_temp);
|
||||
if (!is_writable($conf->project->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->project->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->project->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -311,7 +311,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -320,11 +320,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -332,8 +332,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
|
||||
dol_mkdir($conf->propal->multidir_temp[$object->entity]);
|
||||
if (!is_writable($conf->propal->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->propal->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->propal->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -280,11 +280,11 @@ class doc_generic_reception_odt extends ModelePdfReception
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -292,8 +292,8 @@ class doc_generic_reception_odt extends ModelePdfReception
|
||||
|
||||
dol_mkdir($conf->reception->dir_temp);
|
||||
if (!is_writable($conf->reception->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->reception->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->reception->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
if (!empty($conf->global->MAIN_DOC_USE_OBJECT_THIRDPARTY_NAME)) {
|
||||
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp;
|
||||
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp;
|
||||
$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
|
||||
}
|
||||
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
|
||||
@ -264,11 +264,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
$object->builddoc_filename = $filename; // For triggers
|
||||
//print "newfileformat=".$newfileformat;
|
||||
//print "newdir=".$dir;
|
||||
@ -279,8 +279,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
|
||||
dol_mkdir($conf->societe->multidir_temp[$object->entity]);
|
||||
if (!is_writable($conf->societe->multidir_temp[$object->entity])) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->societe->multidir_temp[$object->entity];
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->societe->multidir_temp[$object->entity]);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -279,7 +279,7 @@ class doc_generic_stock_odt extends ModelePDFStock
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -288,11 +288,11 @@ class doc_generic_stock_odt extends ModelePDFStock
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -300,8 +300,8 @@ class doc_generic_stock_odt extends ModelePDFStock
|
||||
|
||||
dol_mkdir($conf->product->dir_temp);
|
||||
if (!is_writable($conf->product->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->product->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->product->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -262,7 +262,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -271,11 +271,11 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -283,8 +283,8 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
||||
|
||||
dol_mkdir($conf->fournisseur->commande->dir_temp);
|
||||
if (!is_writable($conf->fournisseur->commande->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->fournisseur->commande->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->fournisseur->commande->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -297,7 +297,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -306,11 +306,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -318,8 +318,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
|
||||
dol_mkdir($conf->supplier_proposal->dir_temp);
|
||||
if (!is_writable($conf->supplier_proposal->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->supplier_proposal->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->supplier_proposal->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -266,7 +266,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -275,11 +275,11 @@ class doc_generic_ticket_odt extends ModelePDFTicket
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -287,8 +287,8 @@ class doc_generic_ticket_odt extends ModelePDFTicket
|
||||
|
||||
dol_mkdir($conf->ticket->dir_temp);
|
||||
if (!is_writable($conf->ticket->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->ticket->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->ticket->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -297,7 +297,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -306,11 +306,11 @@ class doc_generic_user_odt extends ModelePDFUser
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -318,8 +318,8 @@ class doc_generic_user_odt extends ModelePDFUser
|
||||
|
||||
dol_mkdir($conf->user->dir_temp);
|
||||
if (!is_writable($conf->user->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->user->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->user->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -290,11 +290,11 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -302,8 +302,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
|
||||
dol_mkdir($conf->user->dir_temp);
|
||||
if (!is_writable($conf->user->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->user->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->user->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -65,3 +65,8 @@ ALTER TABLE llx_ticket ADD COLUMN ip varchar(250);
|
||||
ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
|
||||
|
||||
ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993';
|
||||
|
||||
ALTER TABLE llx_bank ADD COLUMN position integer DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product);
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ create table llx_bank
|
||||
rappro tinyint default 0,
|
||||
note text,
|
||||
fk_bordereau integer DEFAULT 0,
|
||||
position integer DEFAULT 0,
|
||||
banque varchar(255), -- banque pour les cheques
|
||||
emetteur varchar(255), -- emetteur du cheque
|
||||
author varchar(40), -- a supprimer apres migration
|
||||
|
||||
@ -19,3 +19,4 @@
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_commande (fk_commande);
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_reception (fk_reception);
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD CONSTRAINT fk_commande_fournisseur_dispatch_fk_reception FOREIGN KEY (fk_reception) REFERENCES llx_reception (rowid);
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product);
|
||||
|
||||
@ -41,6 +41,7 @@ $ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
@ -80,7 +81,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity]."/".$object->id;
|
||||
$upload_dir = (!empty($conf->knowledgemanagement->multidir_output[$object->entity]) ? $conf->knowledgemanagement->multidir_output[$object->entity] : $conf->knowledgemanagement->dir_output)."/".$object->id;
|
||||
}
|
||||
|
||||
// Security check - Protection if external user
|
||||
|
||||
@ -44,7 +44,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'knowledgerecordcard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new KnowledgeRecord($db);
|
||||
|
||||
@ -49,7 +49,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
$offset = $liste_limit * $page;
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortorder) {
|
||||
|
||||
@ -51,6 +51,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'knowledgerecordlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
|
||||
@ -289,6 +289,7 @@ ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
|
||||
ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status
|
||||
ErrorAjaxRequestFailed=Request failed
|
||||
ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory
|
||||
ErrorFailedToWriteInTempDirectory=Failed to write in temp directory
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
|
||||
@ -282,7 +282,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
||||
$newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
|
||||
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
|
||||
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
|
||||
$newfiletmp = $objectref.'_'.$newfiletmp;
|
||||
$newfiletmp = $objectref . '_' . $newfiletmp;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
@ -291,11 +291,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
||||
if ($format == '1') {
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
}
|
||||
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
|
||||
} else {
|
||||
$filename = $newfiletmp.'.'.$newfileformat;
|
||||
$filename = $newfiletmp . '.' . $newfileformat;
|
||||
}
|
||||
$file = $dir.'/'.$filename;
|
||||
$file = $dir . '/' . $filename;
|
||||
//print "newdir=".$dir;
|
||||
//print "newfile=".$newfile;
|
||||
//print "file=".$file;
|
||||
@ -303,8 +303,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
||||
|
||||
dol_mkdir($conf->mymodule->dir_temp);
|
||||
if (!is_writable($conf->mymodule->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->mymodule->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mymodule->dir_temp);
|
||||
dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
$i--;
|
||||
$j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
@ -88,9 +89,6 @@ require_once __DIR__.'/class/myobject.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mymodule@mymodule", "other"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||
@ -102,6 +100,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
|
||||
@ -56,6 +56,7 @@ $projectid = GETPOST('projectid', 'int');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('$backtopage', 'alpha');
|
||||
$contactid = GETPOST('contactid', 'int');
|
||||
|
||||
$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha');
|
||||
|
||||
@ -1038,7 +1039,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans("AssignedTo");
|
||||
if ($object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
|
||||
if (isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
|
||||
print '</td><td class="right"><a class="editfielda" href="'.$url_page_current.'?track_id='.$object->track_id.'&action=view&set=assign_ticket">'.img_edit($langs->trans('Modify'), '').'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
@ -1066,7 +1067,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans('Progression').'</td><td class="left">';
|
||||
print '</td>';
|
||||
if ($action != 'progression' && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) {
|
||||
if ($action != 'progression' && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=progression&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1189,7 +1190,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
} else {
|
||||
// Button to edit Properties
|
||||
if ($object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
||||
if (isset($object->fk_status) && $object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
||||
print ' <a class="editfielda" href="card.php?track_id='.$object->track_id.'&action=view&set=properties">'.img_edit($langs->trans('Modify')).'</a>';
|
||||
}
|
||||
}
|
||||
@ -1248,7 +1249,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
// Display navbar with links to change ticket status
|
||||
print '<!-- navbar with status -->';
|
||||
if (!$user->socid && $user->rights->ticket->write && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
|
||||
if (!$user->socid && $user->rights->ticket->write && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
|
||||
$actionobject->viewStatusActions($object);
|
||||
}
|
||||
|
||||
@ -1384,16 +1385,16 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Show link to add a message (if read and not closed)
|
||||
if ($object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") {
|
||||
if (isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") {
|
||||
print dolGetButtonAction('', $langs->trans('TicketAddMessage'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&mode=init&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
// Link to create an intervention
|
||||
// socid is needed otherwise fichinter ask it and forgot origin after form submit :\
|
||||
if (!$object->fk_soc && $user->rights->ficheinter->creer) {
|
||||
if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
|
||||
print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
if ($object->fk_soc > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
|
||||
if ($object->fk_soc > 0 && isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
|
||||
print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, '');
|
||||
}
|
||||
|
||||
@ -1404,17 +1405,17 @@ if ($action == 'create' || $action == 'presend') {
|
||||
*/
|
||||
|
||||
// Close ticket if statut is read
|
||||
if ($object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print dolGetButtonAction('', $langs->trans('CloseTicket'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
// Abadon ticket if statut is read
|
||||
if ($object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print dolGetButtonAction('', $langs->trans('AbandonTicket'), 'default', $_SERVER["PHP_SELF"].'?action=abandon&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
// Re-open ticket
|
||||
if (!$user->socid && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED) && !$user->socid) {
|
||||
if (!$user->socid && (isset($object->fk_status) && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED)) && !$user->socid) {
|
||||
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ foreach ($data as $val) {
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
print '<td class="right" style="'.((isset($val['nb_diff']) && $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.round(isset($val['nb_diff']) ? $val['nb_diff'] : 0).'</td>';
|
||||
//print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
//print '<td class="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
|
||||
//print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user