Merge pull request #19207 from Dolibarr/scrutinizer-patch-4

Scrutinizer Auto-Fixes
This commit is contained in:
Laurent Destailleur 2021-10-25 23:35:19 +02:00 committed by GitHub
commit 93e11e07b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 301 additions and 285 deletions

View File

@ -83,26 +83,26 @@ if ($action == 'set') {
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
$defaultValues = new DefaultValues($db); $defaultValues = new DefaultValues($db);
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
if (!is_array($result) && $result<0) { if (!is_array($result) && $result < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
} elseif (count($result)>0) { } elseif (count($result) > 0) {
foreach ($result as $defval) { foreach ($result as $defval) {
$defaultValues->id=$defval->id; $defaultValues->id = $defval->id;
$resultDel = $defaultValues->delete($user); $resultDel = $defaultValues->delete($user);
if ($resultDel<0) { if ($resultDel < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
} }
} }
} }
$defaultValues->type='createform'; $defaultValues->type = 'createform';
$defaultValues->entity=$conf->entity; $defaultValues->entity = $conf->entity;
$defaultValues->user_id=0; $defaultValues->user_id = 0;
$defaultValues->page='comm/action/card.php'; $defaultValues->page = 'comm/action/card.php';
$defaultValues->param='complete'; $defaultValues->param = 'complete';
$defaultValues->value=GETPOST('AGENDA_EVENT_DEFAULT_STATUS'); $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
$resultCreat=$defaultValues->create($user); $resultCreat = $defaultValues->create($user);
if ($resultCreat<0) { if ($resultCreat < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
} }
} elseif ($action == 'specimen') { // For orders } elseif ($action == 'specimen') { // For orders
@ -355,13 +355,13 @@ print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right nowrap">'."\n"; print '<td class="right nowrap">'."\n";
$defval='na'; $defval = 'na';
$defaultValues = new DefaultValues($db); $defaultValues = new DefaultValues($db);
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
if (!is_array($result) && $result<0) { if (!is_array($result) && $result < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
} elseif (count($result)>0) { } elseif (count($result) > 0) {
$defval=reset($result)->value; $defval = reset($result)->value;
} }
$formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200'); $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200');
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -102,11 +102,11 @@ if ($action == "set") {
} }
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) { if (!($res > 0)) {
$error++; $error++;
} }
if (! $error) { if (!$error) {
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else { } else {

View File

@ -270,7 +270,7 @@ print '</form>';
echo '<div>'; echo '<div>';
echo '<table class="noborder centpercent">'; echo '<table class="noborder centpercent">';
echo '<thead>'; echo '<thead>';
echo '<tr class="liste_titre"><th>' . $langs->trans('Parameter') . '</th><th>' . $langs->trans('Value') . '</th></tr>'; echo '<tr class="liste_titre"><th>'.$langs->trans('Parameter').'</th><th>'.$langs->trans('Value').'</th></tr>';
echo '</thead>'; echo '</thead>';
echo '<tbody>'; echo '<tbody>';

View File

@ -26,8 +26,8 @@
require "../main.inc.php"; require "../main.inc.php";
// Libraries // Libraries
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT . '/workstation/lib/workstation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation.lib.php';
//require_once "../class/myclass.class.php"; //require_once "../class/myclass.class.php";
// Translations // Translations

View File

@ -497,11 +497,11 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.'); throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
} else { } else {
if (($object->id) > 0 && !empty($modulepart)) { if (($object->id) > 0 && !empty($modulepart)) {
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($this->db); $ecmfile = new EcmFiles($this->db);
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id)); $result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
if ($result < 0) { if ($result < 0) {
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror()); throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
$filearray['ecmfiles_infos'] = $ecmfile->lines; $filearray['ecmfiles_infos'] = $ecmfile->lines;
} }

View File

@ -244,7 +244,6 @@ class Categorie extends CommonObject
* @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_ACTIONCOMM
* @see Categorie::TYPE_WEBSITE_PAGE * @see Categorie::TYPE_WEBSITE_PAGE
* @see Categorie::TYPE_TICKET * @see Categorie::TYPE_TICKET
*/ */
public $type; public $type;
@ -385,8 +384,8 @@ class Categorie extends CommonObject
} }
} else { } else {
dol_print_error($this->db); dol_print_error($this->db);
$this->error=$this->db->lasterror; $this->error = $this->db->lasterror;
$this->errors[]=$this->db->lasterror; $this->errors[] = $this->db->lasterror;
return -1; return -1;
} }
} }

View File

@ -540,7 +540,7 @@ if ($id) {
array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1), array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1),
array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)), array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)),
array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)), array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)),
array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens") . ' ' . $set_value_help, 'values' => $sensarray, 'default' => $object->sens), array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens),
); );
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350);

View File

@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice
$hookmanager->initHooks(array('invoicedao')); $hookmanager->initHooks(array('invoicedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint; if ($reshook > 0) {
else $result .= $hookmanager->resPrint; $result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result; return $result;
} }

View File

@ -90,7 +90,7 @@ if (empty($reshook)) {
} }
} }
if ($action == 'create') { if ($action == 'create') {
$default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
if ($id_bankaccount != $conf->global->{$default_account}) { if ($id_bankaccount != $conf->global->{$default_account}) {
$res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default

View File

@ -600,7 +600,7 @@ class PaymentSocialContribution extends CommonObject
$result = $acc->add_url_line( $result = $acc->add_url_line(
$bank_line_id, $bank_line_id,
$socialcontrib->fk_user, $socialcontrib->fk_user,
DOL_URL_ROOT . '/user/card.php?id=', DOL_URL_ROOT.'/user/card.php?id=',
$fuser->getFullName($langs), $fuser->getFullName($langs),
'user' 'user'
); );

View File

@ -505,8 +505,8 @@ if (empty($reshook)) {
$desc = $prod->description; $desc = $prod->description;
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
$product_desc=''; $product_desc = '';
} }
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {

View File

@ -218,8 +218,8 @@ if ($type == 'directory') {
$parameters = array('modulepart'=>$module); $parameters = array('modulepart'=>$module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
$automodules[]=$hookmanager->resArray['module']; $automodules[] = $hookmanager->resArray['module'];
} }
// TODO change for multicompany sharing // TODO change for multicompany sharing

View File

@ -35,7 +35,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
public $boxcode = "customersoutstandingbillreached"; public $boxcode = "customersoutstandingbillreached";
public $boximg = "object_company"; public $boximg = "object_company";
public $boxlabel = "BoxCustomersOutstandingBillReached"; public $boxlabel = "BoxCustomersOutstandingBillReached";
public $depends = array("facture","societe"); public $depends = array("facture", "societe");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.

View File

@ -24,7 +24,7 @@
* \ingroup projet * \ingroup projet
* \brief Module to show the funnel of prospection * \brief Module to show the funnel of prospection
*/ */
include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php"; include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/** /**
* Class to manage the box to show last projet * Class to manage the box to show last projet
@ -91,8 +91,8 @@ class box_funnel_of_prospection extends ModeleBoxes
$badgeStatus7 = '#baa32b'; $badgeStatus7 = '#baa32b';
$badgeStatus8 = '#993013'; $badgeStatus8 = '#993013';
$badgeStatus9 = '#e7f0f0'; $badgeStatus9 = '#e7f0f0';
if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) {
include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
} }
$listofoppstatus = array(); $listofoppstatus = array();
$listofopplabel = array(); $listofopplabel = array();
@ -100,7 +100,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$colorseriesstat = array(); $colorseriesstat = array();
$bordercolorseries = array(); $bordercolorseries = array();
$sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label"; $sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls"; $sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= " WHERE active=1"; $sql .= " WHERE active=1";
$sql .= " AND cls.code <> 'LOST'"; $sql .= " AND cls.code <> 'LOST'";
$sql .= $this->db->order('cls.rowid', 'ASC'); $sql .= $this->db->order('cls.rowid', 'ASC');
@ -148,14 +148,14 @@ class box_funnel_of_prospection extends ModeleBoxes
$this->max = $max; $this->max = $max;
$this->info_box_head = array( $this->info_box_head = array(
'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"), 'text' => $langs->trans("Statistics").' - '.$langs->trans("BoxTitleFunnelOfProspection"),
'graph' => '1' 'graph' => '1'
); );
if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p, " . MAIN_DB_PREFIX . "c_lead_status as cls"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; $sql .= " WHERE p.entity IN (".getEntity('project').")";
$sql .= " AND p.fk_opp_status = cls.rowid"; $sql .= " AND p.fk_opp_status = cls.rowid";
$sql .= " AND p.fk_statut = 1"; // Opend projects only $sql .= " AND p.fk_statut = 1"; // Opend projects only
$sql .= " AND cls.code NOT IN ('LOST')"; $sql .= " AND cls.code NOT IN ('LOST')";
@ -200,14 +200,14 @@ class box_funnel_of_prospection extends ModeleBoxes
$liststatus = array(); $liststatus = array();
$data = array(''); $data = array('');
$customlabels = array(); $customlabels = array();
$total=0; $total = 0;
foreach ($listofstatus as $status) { foreach ($listofstatus as $status) {
$customlabel = ''; $customlabel = '';
$labelStatus = ''; $labelStatus = '';
if ($status != 7) { if ($status != 7) {
$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code'); $code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
if ($code) { if ($code) {
$labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
} }
if (empty($labelStatus)) { if (empty($labelStatus)) {
$labelStatus = $listofopplabel[$status]; $labelStatus = $listofopplabel[$status];
@ -218,16 +218,16 @@ class box_funnel_of_prospection extends ModeleBoxes
$liststatus[] = $labelStatus; $liststatus[] = $labelStatus;
if (!$conf->use_javascript_ajax) { if (!$conf->use_javascript_ajax) {
$stringtoprint .= '<tr class="oddeven">'; $stringtoprint .= '<tr class="oddeven">';
$stringtoprint .= '<td>' . $labelStatus . '</td>'; $stringtoprint .= '<td>'.$labelStatus.'</td>';
$stringtoprint .= '<td class="right"><a href="list.php?statut=' . $status . '">' . price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency) . '</a></td>'; $stringtoprint .= '<td class="right"><a href="list.php?statut='.$status.'">'.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).'</a></td>';
$stringtoprint .= "</tr>\n"; $stringtoprint .= "</tr>\n";
} }
} }
$customlabels[]=$customlabel; $customlabels[] = $customlabel;
} }
$dataseries[] = $data; $dataseries[] = $data;
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph(); $dolgraph = new DolGraph();
$dolgraph->SetMinValue(0); $dolgraph->SetMinValue(0);
$dolgraph->SetData($dataseries); $dolgraph->SetData($dataseries);
@ -273,7 +273,7 @@ class box_funnel_of_prospection extends ModeleBoxes
'tr' => 'class="oddeven"', 'tr' => 'class="oddeven"',
'td' => 'class="left "', 'td' => 'class="left "',
'maxlength' => 500, 'maxlength' => 500,
'text' => $langs->trans("OpportunityTotalAmount") . ' (' . $langs->trans("WonLostExcluded") . ')' 'text' => $langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'
); );
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'tr' => 'class="oddeven"', 'tr' => 'class="oddeven"',
@ -286,7 +286,7 @@ class box_funnel_of_prospection extends ModeleBoxes
'tr' => 'class="oddeven"', 'tr' => 'class="oddeven"',
'td' => 'class="left "', 'td' => 'class="left "',
'maxlength' => 500, 'maxlength' => 500,
'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount") . ' (' . $langs->trans("WonLostExcluded") . ')', $langs->trans("OpportunityPonderatedAmountDesc"), 1) 'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1)
); );
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(

View File

@ -80,8 +80,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
$badgeStatus7 = '#baa32b'; $badgeStatus7 = '#baa32b';
$badgeStatus8 = '#993013'; $badgeStatus8 = '#993013';
$badgeStatus9 = '#e7f0f0'; $badgeStatus9 = '#e7f0f0';
if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) {
include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
} }
$this->max = $max; $this->max = $max;
@ -97,22 +97,22 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
$days = 7; $days = 7;
} }
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
$text = $langs->trans("BoxTicketLastXDays", $days).'&nbsp;' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"'); $text = $langs->trans("BoxTicketLastXDays", $days).'&nbsp;'.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"');
$this->info_box_head = array( $this->info_box_head = array(
'text' => $text, 'text' => $text,
'limit' => dol_strlen($text) 'limit' => dol_strlen($text)
); );
$today = date_time_set(date_create(), 0, 0); $today = date_time_set(date_create(), 0, 0);
$todayformat = date('Y-m-d', date_timestamp_get($today)); $todayformat = date('Y-m-d', date_timestamp_get($today));
$intervaltosub = new DateInterval('P' . dol_escape_htmltag($days - 1) . 'D'); $intervaltosub = new DateInterval('P'.dol_escape_htmltag($days - 1).'D');
$intervaltoadd = new DateInterval('P1D'); $intervaltoadd = new DateInterval('P1D');
$minimumdatec = date_sub($today, $intervaltosub); $minimumdatec = date_sub($today, $intervaltosub);
$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec)); $minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
if ($user->rights->ticket->read) { if ($user->rights->ticket->read) {
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb"; $sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
$sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL " . $days . " DAY)"; $sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL ".$days." DAY)";
$sql .= " GROUP BY CAST(t.datec AS DATE)"; $sql .= " GROUP BY CAST(t.datec AS DATE)";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
@ -148,12 +148,12 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
}); });
</script>'; </script>';
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_last_days">'; // hideobject is to start hidden $stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_last_days">'; // hideobject is to start hidden
$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; $stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow .= '<input type="hidden" name="token" value="' . newToken() . '">'; $stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
$stringtoshow .= '<input type="hidden" name="action" value="refresh">'; $stringtoshow .= '<input type="hidden" name="action" value="refresh">';
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_last_days:days">'; $stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_last_days:days">';
$stringtoshow .= ' <input class="flat" size="4" type="text" name="' . $param_day . '" value="' . $days . '">' . $langs->trans("Days"); $stringtoshow .= ' <input class="flat" size="4" type="text" name="'.$param_day.'" value="'.$days.'">'.$langs->trans("Days");
$stringtoshow .= '<input type="image" alt="' . $langs->trans("Refresh") . '" src="' . img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1) . '">'; $stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1).'">';
$stringtoshow .= '</form>'; $stringtoshow .= '</form>';
$stringtoshow .= '</div>'; $stringtoshow .= '</div>';
@ -181,21 +181,21 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
$px1->mode = 'depth'; $px1->mode = 'depth';
$px1->draw('idgraphticketlastxdays'); $px1->draw('idgraphticketlastxdays');
$graphtoshow= $px1->show($totalnb ? 0 : 1); $graphtoshow = $px1->show($totalnb ? 0 : 1);
} }
if ($totalnb) { if ($totalnb) {
$stringtoshow .= $graphtoshow; $stringtoshow .= $graphtoshow;
} }
$stringtoshow .= '</div>'; $stringtoshow .= '</div>';
if ($totalnb) { if ($totalnb) {
$this->info_box_contents[][]=array( $this->info_box_contents[][] = array(
'td' => 'center', 'td' => 'center',
'text' => $stringtoshow 'text' => $stringtoshow
); );
} else { } else {
$this->info_box_contents[0][0] = array( $this->info_box_contents[0][0] = array(
'td' => 'class="center opacitymedium"', 'td' => 'class="center opacitymedium"',
'text' => $stringtoshow . $langs->trans("BoxNoTicketLastXDays", $days) 'text' => $stringtoshow.$langs->trans("BoxNoTicketLastXDays", $days)
); );
} }
} else { } else {

View File

@ -88,7 +88,7 @@ class DefaultValues extends CommonObject
/** /**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/ */
public $fields=array( public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20), 'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
@ -145,8 +145,12 @@ class DefaultValues extends CommonObject
$this->db = $db; $this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; $this->fields['rowid']['visible'] = 0;
}
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
$this->fields['entity']['enabled'] = 0;
}
// Unset fields that are disabled // Unset fields that are disabled
foreach ($this->fields as $key => $val) { foreach ($this->fields as $key => $val) {

View File

@ -1708,7 +1708,7 @@ class FormFile
} else { } else {
$parameters = array('modulepart'=>$modulepart); $parameters = array('modulepart'=>$modulepart);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) { if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) {
dol_include_once($hookmanager->resArray['classpath']); dol_include_once($hookmanager->resArray['classpath']);
if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) { if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
@ -1789,9 +1789,9 @@ class FormFile
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
$ref = (isset($reg[1]) ? $reg[1] : ''); $ref = (isset($reg[1]) ? $reg[1] : '');
} else { } else {
$parameters = array('modulepart'=>$modulepart,'fileinfo'=>$file); $parameters = array('modulepart'=>$modulepart, 'fileinfo'=>$file);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) { if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) {
$ref = $hookmanager->resArray['ref']; $ref = $hookmanager->resArray['ref'];
} }

View File

@ -88,7 +88,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
} }
} }
$memoryid = session_name() . '_' . $memoryid; $memoryid = session_name().'_'.$memoryid;
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
$rescode = $dolmemcache->getResultCode(); $rescode = $dolmemcache->getResultCode();
@ -109,7 +109,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
} }
} }
$memoryid = session_name() . '_' . $memoryid; $memoryid = session_name().'_'.$memoryid;
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
if ($result) { if ($result) {
@ -154,7 +154,7 @@ function dol_getcache($memoryid)
} }
} }
$memoryid = session_name() . '_' . $memoryid; $memoryid = session_name().'_'.$memoryid;
//$m->setOption(Memcached::OPT_COMPRESSION, false); //$m->setOption(Memcached::OPT_COMPRESSION, false);
//print "Get memoryid=".$memoryid; //print "Get memoryid=".$memoryid;
$data = $m->get($memoryid); $data = $m->get($memoryid);
@ -179,7 +179,7 @@ function dol_getcache($memoryid)
} }
} }
$memoryid = session_name() . '_' . $memoryid; $memoryid = session_name().'_'.$memoryid;
//$m->setOption(Memcached::OPT_COMPRESSION, false); //$m->setOption(Memcached::OPT_COMPRESSION, false);
$data = $m->get($memoryid); $data = $m->get($memoryid);
//print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n<br>"; //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n<br>";
@ -268,7 +268,7 @@ function dol_setshmop($memoryid, $data, $expire)
shmop_close($handle); shmop_close($handle);
return ($shm_bytes_written1 + $shm_bytes_written2); return ($shm_bytes_written1 + $shm_bytes_written2);
} else { } else {
print 'Error in shmop_open for memoryid=' . $memoryid . ' shmkey=' . $shmkey . ' 6+size=6+' . $size; print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size;
return -1; return -1;
} }
} }

View File

@ -443,7 +443,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
// initialize result array // initialize result array
//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i]; //for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];
dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT)?'':$conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
return $result; return $result;
} }

View File

@ -1256,7 +1256,9 @@ class pdf_einstein extends ModelePDFCommandes
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
$ltrdirection = 'L'; $ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; if ($outputlangs->trans("DIRECTION") == 'rtl') {
$ltrdirection = 'R';
}
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));

View File

@ -164,8 +164,8 @@ class modCategorie extends DolibarrModules
$typeexample .= ($typeexample ? " / " : "")."11=Website page"; $typeexample .= ($typeexample ? " / " : "")."11=Website page";
} }
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel" ); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel");
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text' ); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text');
$this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_entities_array[$r] = array(); // We define here only fields that use another picto
$this->export_help_array[$r] = array('cat.type'=>$typeexample); $this->export_help_array[$r] = array('cat.type'=>$typeexample);
@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules
$this->import_convertvalue_array[$r] = array( $this->import_convertvalue_array[$r] = array(
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_member'=>array('rule'=>'fetchidfromref','classfile'=>'/adherents/class/adherent.class.php','class'=>'Adherent','method'=>'fetch','element'=>'Member') 'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member')
); );
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref"); $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref");
} }
@ -579,7 +579,7 @@ class modCategorie extends DolibarrModules
$this->import_convertvalue_array[$r] = array( $this->import_convertvalue_array[$r] = array(
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_project'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project') 'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project')
); );
$this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref"); $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref");
} }
@ -597,7 +597,7 @@ class modCategorie extends DolibarrModules
$this->import_convertvalue_array[$r] = array( $this->import_convertvalue_array[$r] = array(
'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), 'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cu.fk_user'=>array('rule'=>'fetchidfromref','classfile'=>'/user/class/user.class.php','class'=>'User','method'=>'fetch','element'=>'User') 'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User')
); );
$this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login"); $this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login");
} }

View File

@ -1127,7 +1127,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
global $langs, $conf, $mysoc; global $langs, $conf, $mysoc;
$ltrdirection = 'L'; $ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; if ($outputlangs->trans("DIRECTION") == 'rtl') {
$ltrdirection = 'R';
}
// Load translation files required by the page // Load translation files required by the page
$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings"));

View File

@ -27,7 +27,7 @@
* \brief File containing class for advanced numbering model of Workstation * \brief File containing class for advanced numbering model of Workstation
*/ */
require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/workstation/modules_workstation.php';
/** /**

View File

@ -475,7 +475,7 @@ if ($action == 'confirm_crop') {
* View * View
*/ */
$title= $langs->trans("ImageEditor"); $title = $langs->trans("ImageEditor");
$morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'); $morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js');
$morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'); $morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css');

View File

@ -18,17 +18,17 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr
if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) { if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) {
// date range from list filters is stored as array('start' => <timestamp>, 'end' => <timestamp>) // date range from list filters is stored as array('start' => <timestamp>, 'end' => <timestamp>)
// start date // start date
$param .= '&' . $search_options_pattern.$tmpkey.'_startyear=' . dol_print_date($val['start'], '%Y'); $param .= '&'.$search_options_pattern.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y');
$param .= '&' . $search_options_pattern.$tmpkey.'_startmonth=' . dol_print_date($val['start'], '%m'); $param .= '&'.$search_options_pattern.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m');
$param .= '&' . $search_options_pattern.$tmpkey.'_startday=' . dol_print_date($val['start'], '%d'); $param .= '&'.$search_options_pattern.$tmpkey.'_startday='.dol_print_date($val['start'], '%d');
$param .= '&' . $search_options_pattern.$tmpkey.'_starthour=' . dol_print_date($val['start'], '%H'); $param .= '&'.$search_options_pattern.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H');
$param .= '&' . $search_options_pattern.$tmpkey.'_startmin=' . dol_print_date($val['start'], '%M'); $param .= '&'.$search_options_pattern.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M');
// end date // end date
$param .= '&' . $search_options_pattern.$tmpkey.'_endyear=' . dol_print_date($val['end'], '%Y'); $param .= '&'.$search_options_pattern.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y');
$param .= '&' . $search_options_pattern.$tmpkey.'_endmonth=' . dol_print_date($val['end'], '%m'); $param .= '&'.$search_options_pattern.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m');
$param .= '&' . $search_options_pattern.$tmpkey.'_endday=' . dol_print_date($val['end'], '%d'); $param .= '&'.$search_options_pattern.$tmpkey.'_endday='.dol_print_date($val['end'], '%d');
$param .= '&' . $search_options_pattern.$tmpkey.'_endhour=' . dol_print_date($val['end'], '%H'); $param .= '&'.$search_options_pattern.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H');
$param .= '&' . $search_options_pattern.$tmpkey.'_endmin=' . dol_print_date($val['end'], '%M'); $param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M');
$val = ''; $val = '';
} }
if ($val != '') { if ($val != '') {

View File

@ -125,7 +125,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
$lastseparatorkeyfound = $tmpkeyextra; $lastseparatorkeyfound = $tmpkeyextra;
} else { } else {
print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.(!empty($object->id)?'_'.$object->id:''); print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.(!empty($object->id) ? '_'.$object->id : '');
/*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) { /*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) {
print ' trextrafields_collapse_new'; print ' trextrafields_collapse_new';
}*/ }*/

View File

@ -38,17 +38,17 @@ if ($massaction == 'predelete') {
if ($massaction == 'preaffecttag') { if ($massaction == 'preaffecttag') {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categ = new Categorie($db); $categ = new Categorie($db);
$categ_types=array(); $categ_types = array();
$categ_type_array=$categ->getMapList(); $categ_type_array = $categ->getMapList();
foreach ($categ_type_array as $categdef) { foreach ($categ_type_array as $categdef) {
if (isset($object) && $categdef['obj_table']==$object->table_element) { if (isset($object) && $categdef['obj_table'] == $object->table_element) {
if (!array_key_exists($categdef['code'], $categ_types)) { if (!array_key_exists($categdef['code'], $categ_types)) {
$categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
} }
} }
if (isset($objecttmp) && $categdef['obj_table']==$objecttmp->table_element) { if (isset($objecttmp) && $categdef['obj_table'] == $objecttmp->table_element) {
if (!array_key_exists($categdef['code'], $categ_types)) { if (!array_key_exists($categdef['code'], $categ_types)) {
$categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
} }
} }
} }
@ -57,12 +57,12 @@ if ($massaction == 'preaffecttag') {
if (!empty($categ_types)) { if (!empty($categ_types)) {
foreach ($categ_types as $categ_type) { foreach ($categ_types as $categ_type) {
$cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1); $cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1);
$formquestion[]=array('type' => 'other', $formquestion[] = array('type' => 'other',
'name' => 'affecttag_'.$categ_type['code'], 'name' => 'affecttag_'.$categ_type['code'],
'label' => $langs->trans("Tag").' '.$categ_type['label'], 'label' => $langs->trans("Tag").' '.$categ_type['label'],
'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%')); 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%'));
} }
$formquestion[]=array('type' => 'other', $formquestion[] = array('type' => 'other',
'name' => 'affecttag_type', 'name' => 'affecttag_type',
'label' => '', 'label' => '',
'value' => '<input type="hidden" name="affecttag_type" id="affecttag_type" value="'.implode(",", array_keys($categ_types)).'"/>'); 'value' => '<input type="hidden" name="affecttag_type" id="affecttag_type" value="'.implode(",", array_keys($categ_types)).'"/>');

View File

@ -173,11 +173,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers
} }
} }
if (! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { if (!empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) {
/** @var Facture $object */ /** @var Facture $object */
$object->fetchObjectLinked('', 'shipping', $object->id, $object->element); $object->fetchObjectLinked('', 'shipping', $object->id, $object->element);
if (! empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
/** @var Expedition $shipment */ /** @var Expedition $shipment */
$shipment = array_shift($object->linkedObjects['shipping']); $shipment = array_shift($object->linkedObjects['shipping']);

View File

@ -366,8 +366,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
$sectionauto[]=$hookmanager->resArray; $sectionauto[] = $hookmanager->resArray;
$rowspan += count($hookmanager->resArray); $rowspan += count($hookmanager->resArray);
} }
} }

View File

@ -24,7 +24,7 @@
// Put here all includes required by your class file // Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/** /**
@ -102,7 +102,7 @@ class ConferenceOrBooth extends ActionComm
/** /**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/ */
public $fields=array( public $fields = array(
'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
@ -195,11 +195,11 @@ class ConferenceOrBooth extends ActionComm
*/ */
protected function setPercentageFromStatus() protected function setPercentageFromStatus()
{ {
if ($this->status==self::STATUS_DONE) { if ($this->status == self::STATUS_DONE) {
$this->percentage=100; $this->percentage = 100;
} }
if ($this->status==self::STATUS_DRAFT) { if ($this->status == self::STATUS_DRAFT) {
$this->percentage=0; $this->percentage = 0;
} }
} }
@ -211,12 +211,12 @@ class ConferenceOrBooth extends ActionComm
*/ */
protected function setActionCommFields(User $user) protected function setActionCommFields(User $user)
{ {
$this->userownerid=$user->id; $this->userownerid = $user->id;
$this->type_id=$this->fk_action; $this->type_id = $this->fk_action;
$this->socid=$this->fk_soc; $this->socid = $this->fk_soc;
$this->datef=$this->datep2; $this->datef = $this->datep2;
$this->note_private=$this->note; $this->note_private = $this->note;
$this->fk_user_author=$this->fk_user_author; $this->fk_user_author = $this->fk_user_author;
} }
/** /**
@ -226,9 +226,9 @@ class ConferenceOrBooth extends ActionComm
*/ */
protected function getActionCommFields() protected function getActionCommFields()
{ {
$this->fk_action=$this->type_id; $this->fk_action = $this->type_id;
$this->fk_soc=$this->socid; $this->fk_soc = $this->socid;
$this->datep2=$this->datef; $this->datep2 = $this->datef;
} }
/** /**
@ -408,7 +408,9 @@ class ConferenceOrBooth extends ActionComm
if (!$error && !$notrigger) { if (!$error && !$notrigger) {
// Call trigger // Call trigger
$result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user); $result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user);
if ($result < 0) $error++; if ($result < 0) {
$error++;
}
// End call triggers // End call triggers
} }
@ -540,7 +542,7 @@ class ConferenceOrBooth extends ActionComm
if ($add_save_lastsearch_values) { if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1'; $url .= '&save_lastsearch_values=1';
} }
if ($option=='withproject') { if ($option == 'withproject') {
$url .= '&withproject=1'; $url .= '&withproject=1';
} }
} }

View File

@ -739,7 +739,7 @@ class Productcustomerprice extends CommonObject
$sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
$sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
$sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").","; $sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").",";
$sql .= " ref_customer=".(isset($this->ref_customer) ? "'" . $this->db->escape($this->ref_customer) . "'" : "null").","; $sql .= " ref_customer=".(isset($this->ref_customer) ? "'".$this->db->escape($this->ref_customer)."'" : "null").",";
$sql .= " price=".(isset($this->price) ? $this->price : "null").","; $sql .= " price=".(isset($this->price) ? $this->price : "null").",";
$sql .= " price_ttc=".(isset($this->price_ttc) ? $this->price_ttc : "null").","; $sql .= " price_ttc=".(isset($this->price_ttc) ? $this->price_ttc : "null").",";
$sql .= " price_min=".(isset($this->price_min) ? $this->price_min : "null").","; $sql .= " price_min=".(isset($this->price_min) ? $this->price_min : "null").",";

View File

@ -113,7 +113,9 @@ if ($user->socid > 0) { // Protection if external user
accessforbidden(); accessforbidden();
} }
//$result = restrictedArea($user, 'productbatch'); //$result = restrictedArea($user, 'productbatch');
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) {
accessforbidden();
}
/* /*

View File

@ -607,7 +607,7 @@ $parameters = array('sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (empty($date) || ! $dateIsValid) { if (empty($date) || !$dateIsValid) {
$colspan = 8; $colspan = 8;
if ($mode == 'future') { if ($mode == 'future') {
$colspan++; $colspan++;

View File

@ -61,7 +61,7 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
if ($action == 'addcontact' && $user->rights->projet->creer) { if ($action == 'addcontact' && $user->rights->projet->creer) {
$source = 'internal'; $source = 'internal';
if (GETPOST("addsourceexternal")) { if (GETPOST("addsourceexternal")) {
$source ='external'; $source = 'external';
} }
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);

View File

@ -853,7 +853,7 @@ class Societe extends CommonObject
$this->accountancy_code_customer = trim($this->code_compta); $this->accountancy_code_customer = trim($this->code_compta);
$this->accountancy_code_supplier = trim($this->code_compta_fournisseur); $this->accountancy_code_supplier = trim($this->code_compta_fournisseur);
$this->accountancy_code_buy = trim($this->accountancy_code_buy); $this->accountancy_code_buy = trim($this->accountancy_code_buy);
$this->accountancy_code_sell= trim($this->accountancy_code_sell); $this->accountancy_code_sell = trim($this->accountancy_code_sell);
if (!empty($this->multicurrency_code)) { if (!empty($this->multicurrency_code)) {
$this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
@ -917,8 +917,8 @@ class Societe extends CommonObject
$sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", ".(int) $this->fk_multicurrency;
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
} }
$sql .= ")"; $sql .= ")";
@ -931,9 +931,9 @@ class Societe extends CommonObject
// update accountancy for this entity // update accountancy for this entity
if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity (";
$sql .= " fk_soc"; $sql .= " fk_soc";
$sql .= ", entity"; $sql .= ", entity";
$sql .= ", accountancy_code_customer"; $sql .= ", accountancy_code_customer";
@ -942,11 +942,11 @@ class Societe extends CommonObject
$sql .= ", accountancy_code_sell"; $sql .= ", accountancy_code_sell";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= $this->id; $sql .= $this->id;
$sql .= ", " . $conf->entity; $sql .= ", ".$conf->entity;
$sql .= ", '" . $this->db->escape($this->accountancy_code_customer) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_customer)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_supplier) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_supplier)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
$sql .= ")"; $sql .= ")";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if (!$result) { if (!$result) {
@ -1053,7 +1053,7 @@ class Societe extends CommonObject
$error++; $error++;
$this->error = $contact->error; $this->error = $contact->error;
$this->errors = array_merge($this->errors, $contact->errors); $this->errors = array_merge($this->errors, $contact->errors);
dol_syslog(get_class($this) . "::create_individual Affect Tag ERROR:" . $this->error, LOG_ERR); dol_syslog(get_class($this)."::create_individual Affect Tag ERROR:".$this->error, LOG_ERR);
$contactId = $result; $contactId = $result;
} }
} }
@ -1063,7 +1063,7 @@ class Societe extends CommonObject
if ($result < 0) { if ($result < 0) {
$this->error = $contact->error; $this->error = $contact->error;
$this->errors = array_merge($this->errors, $contact->errors); $this->errors = array_merge($this->errors, $contact->errors);
dol_syslog(get_class($this) . "::create_individual set mailing status ERROR:" . $this->error, LOG_ERR); dol_syslog(get_class($this)."::create_individual set mailing status ERROR:".$this->error, LOG_ERR);
$contactId = $result; $contactId = $result;
} }
} }
@ -1340,7 +1340,7 @@ class Societe extends CommonObject
$this->webservices_key = trim($this->webservices_key); $this->webservices_key = trim($this->webservices_key);
$this->accountancy_code_buy = trim($this->accountancy_code_buy); $this->accountancy_code_buy = trim($this->accountancy_code_buy);
$this->accountancy_code_sell= trim($this->accountancy_code_sell); $this->accountancy_code_sell = trim($this->accountancy_code_sell);
//Incoterms //Incoterms
$this->fk_incoterms = (int) $this->fk_incoterms; $this->fk_incoterms = (int) $this->fk_incoterms;
@ -1467,8 +1467,8 @@ class Societe extends CommonObject
$sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null');
$sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'";
if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
if ($customer) { if ($customer) {
$sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null");
@ -1559,9 +1559,9 @@ class Societe extends CommonObject
// update accountancy for this entity // update accountancy for this entity
if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity (";
$sql .= " fk_soc"; $sql .= " fk_soc";
$sql .= ", entity"; $sql .= ", entity";
$sql .= ", accountancy_code_customer"; $sql .= ", accountancy_code_customer";
@ -1570,11 +1570,11 @@ class Societe extends CommonObject
$sql .= ", accountancy_code_sell"; $sql .= ", accountancy_code_sell";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= $this->id; $sql .= $this->id;
$sql .= ", " . $conf->entity; $sql .= ", ".$conf->entity;
$sql .= ", '" . $this->db->escape($this->code_compta_client)."'"; $sql .= ", '".$this->db->escape($this->code_compta_client)."'";
$sql .= ", '" . $this->db->escape($this->code_compta_fournisseur)."'"; $sql .= ", '".$this->db->escape($this->code_compta_fournisseur)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
$sql .= ")"; $sql .= ")";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if (!$result) { if (!$result) {
@ -1702,7 +1702,7 @@ class Societe extends CommonObject
} }
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
} }
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
@ -4819,19 +4819,19 @@ class Societe extends CommonObject
} }
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET "; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ";
$sql.= $field." = '".$this->db->escape($value)."'"; $sql .= $field." = '".$this->db->escape($value)."'";
$sql.= " WHERE rowid = ".((int) $this->id); $sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interface=new Interfaces($this->db); $interface = new Interfaces($this->db);
$result=$interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf); $result = $interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf);
if ($result < 0) { if ($result < 0) {
$this->errors=$interface->errors; $this->errors = $interface->errors;
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -4842,7 +4842,7 @@ class Societe extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} else { } else {
$this->error=$this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }

View File

@ -374,7 +374,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
// Ref. Customer // Ref. Customer
print '<tr><td>'.$langs->trans('RefCustomer').'</td>'; print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
print '<td><input name="ref_customer" size="12" value="' . dol_escape_htmltag($prodcustprice->ref_customer) . '"></td></tr>'; print '<td><input name="ref_customer" size="12" value="'.dol_escape_htmltag($prodcustprice->ref_customer).'"></td></tr>';
// VAT // VAT
print '<tr><td>'.$langs->trans("VATRate").'</td><td>'; print '<tr><td>'.$langs->trans("VATRate").'</td><td>';

View File

@ -1405,7 +1405,9 @@ class SupplierProposal extends CommonObject
$soc = new Societe($this->db); $soc = new Societe($this->db);
$result = $soc->fetch($this->socid); $result = $soc->fetch($this->socid);
if ($result < 0) return -1; if ($result < 0) {
return -1;
}
// Define new ref // Define new ref
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life

View File

@ -64,7 +64,7 @@ top_httphead('text/json');
if (empty($dolibarr_nocache)) { if (empty($dolibarr_nocache)) {
header('Cache-Control: max-age=10800, public, must-revalidate'); header('Cache-Control: max-age=10800, public, must-revalidate');
// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT');
} else { } else {
header('Cache-Control: no-cache'); header('Cache-Control: no-cache');
} }
@ -79,8 +79,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
} }
$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR:'#F05F40'; $manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR : '#F05F40';
$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_BG_COLOR:"#ffffff"; $manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR : "#ffffff";
$manifest->display = "standalone"; $manifest->display = "standalone";
$manifest->splash_pages = null; $manifest->splash_pages = null;
$manifest->icons = array(); $manifest->icons = array();

View File

@ -71,7 +71,7 @@ top_httphead('text/json');
if (empty($dolibarr_nocache)) { if (empty($dolibarr_nocache)) {
header('Cache-Control: max-age=10800, public, must-revalidate'); header('Cache-Control: max-age=10800, public, must-revalidate');
// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT');
} else { } else {
header('Cache-Control: no-cache'); header('Cache-Control: no-cache');
} }

View File

@ -137,11 +137,11 @@ $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$lastcreatedbox .='<div class="div-table-responsive-no-min">'; $lastcreatedbox .= '<div class="div-table-responsive-no-min">';
$lastcreatedbox .='<table class="noborder centpercent">'; $lastcreatedbox .= '<table class="noborder centpercent">';
$lastcreatedbox .='<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastUsersCreated", min($num, $max)).'</td>'; $lastcreatedbox .= '<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastUsersCreated", min($num, $max)).'</td>';
$lastcreatedbox .='<td class="right" colspan="2"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/list.php?sortfield=u.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>'; $lastcreatedbox .= '<td class="right" colspan="2"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/list.php?sortfield=u.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
$lastcreatedbox .='</tr>'."\n"; $lastcreatedbox .= '</tr>'."\n";
$i = 0; $i = 0;
while ($i < $num && $i < $max) { while ($i < $num && $i < $max) {
@ -162,24 +162,24 @@ if ($resql) {
$companystatic->code_client = $obj->code_client; $companystatic->code_client = $obj->code_client;
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
$lastcreatedbox .='<tr class="oddeven">'; $lastcreatedbox .= '<tr class="oddeven">';
$lastcreatedbox .='<td class="nowraponall">'; $lastcreatedbox .= '<td class="nowraponall">';
$lastcreatedbox .=$fuserstatic->getNomUrl(-1); $lastcreatedbox .= $fuserstatic->getNomUrl(-1);
if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) { if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) {
$lastcreatedbox .=img_picto($langs->trans("SuperAdministrator"), 'redstar'); $lastcreatedbox .= img_picto($langs->trans("SuperAdministrator"), 'redstar');
} elseif ($obj->admin) { } elseif ($obj->admin) {
$lastcreatedbox .=img_picto($langs->trans("Administrator"), 'star'); $lastcreatedbox .= img_picto($langs->trans("Administrator"), 'star');
} }
$lastcreatedbox .="</td>"; $lastcreatedbox .= "</td>";
$lastcreatedbox .='<td>'.$obj->login.'</td>'; $lastcreatedbox .= '<td>'.$obj->login.'</td>';
$lastcreatedbox .="<td>"; $lastcreatedbox .= "<td>";
if ($obj->fk_soc) { if ($obj->fk_soc) {
$lastcreatedbox .=$companystatic->getNomUrl(1); $lastcreatedbox .= $companystatic->getNomUrl(1);
} else { } else {
$lastcreatedbox .=$langs->trans("InternalUser"); $lastcreatedbox .= $langs->trans("InternalUser");
} }
if ($obj->ldap_sid) { if ($obj->ldap_sid) {
$lastcreatedbox .=' ('.$langs->trans("DomainUser").')'; $lastcreatedbox .= ' ('.$langs->trans("DomainUser").')';
} }
$entity = $obj->entity; $entity = $obj->entity;
@ -193,19 +193,19 @@ if ($resql) {
$entitystring = $mc->label; $entitystring = $mc->label;
} }
} }
$lastcreatedbox .=($entitystring ? ' ('.$entitystring.')' : ''); $lastcreatedbox .= ($entitystring ? ' ('.$entitystring.')' : '');
$lastcreatedbox .='</td>'; $lastcreatedbox .= '</td>';
$lastcreatedbox .='<td class="center nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>'; $lastcreatedbox .= '<td class="center nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
$lastcreatedbox .='<td class="right">'; $lastcreatedbox .= '<td class="right">';
$lastcreatedbox .=$fuserstatic->getLibStatut(3); $lastcreatedbox .= $fuserstatic->getLibStatut(3);
$lastcreatedbox .='</td>'; $lastcreatedbox .= '</td>';
$lastcreatedbox .='</tr>'; $lastcreatedbox .= '</tr>';
$i++; $i++;
} }
$lastcreatedbox .="</table>"; $lastcreatedbox .= "</table>";
$lastcreatedbox .="</div><br>"; $lastcreatedbox .= "</div><br>";
$db->free($resql); $db->free($resql);
} else { } else {
@ -238,11 +238,11 @@ if ($canreadperms) {
} }
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$lastgroupbox .='<div class="div-table-responsive-no-min">'; $lastgroupbox .= '<div class="div-table-responsive-no-min">';
$lastgroupbox .='<table class="noborder centpercent">'; $lastgroupbox .= '<table class="noborder centpercent">';
$lastgroupbox .='<tr class="liste_titre"><td colspan="'.$colspan.'">'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).'</td>'; $lastgroupbox .= '<tr class="liste_titre"><td colspan="'.$colspan.'">'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).'</td>';
$lastgroupbox .='<td class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/group/list.php?sortfield=g.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>'; $lastgroupbox .= '<td class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/user/group/list.php?sortfield=g.datec&sortorder=DESC">'.$langs->trans("FullList").'</td>';
$lastgroupbox .='</tr>'; $lastgroupbox .= '</tr>';
$i = 0; $i = 0;
$grouptemp = new UserGroup($db); $grouptemp = new UserGroup($db);
@ -254,21 +254,21 @@ if ($canreadperms) {
$grouptemp->name = $obj->name; $grouptemp->name = $obj->name;
$grouptemp->note = $obj->note; $grouptemp->note = $obj->note;
$lastgroupbox .='<tr class="oddeven">'; $lastgroupbox .= '<tr class="oddeven">';
$lastgroupbox .='<td>'; $lastgroupbox .= '<td>';
$lastgroupbox .=$grouptemp->getNomUrl(1); $lastgroupbox .= $grouptemp->getNomUrl(1);
if (!$obj->entity) { if (!$obj->entity) {
$lastgroupbox .=img_picto($langs->trans("GlobalGroup"), 'redstar'); $lastgroupbox .= img_picto($langs->trans("GlobalGroup"), 'redstar');
} }
$lastgroupbox .="</td>"; $lastgroupbox .= "</td>";
if (!empty($conf->multicompany->enabled) && is_object($mc)) { if (!empty($conf->multicompany->enabled) && is_object($mc)) {
$mc->getInfo($obj->entity); $mc->getInfo($obj->entity);
$lastgroupbox .='<td>'; $lastgroupbox .= '<td>';
$lastgroupbox .=$mc->label; $lastgroupbox .= $mc->label;
$lastgroupbox .='</td>'; $lastgroupbox .= '</td>';
} }
$lastgroupbox .='<td class="nowrap right">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>'; $lastgroupbox .= '<td class="nowrap right">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
$lastgroupbox .="</tr>"; $lastgroupbox .= "</tr>";
$i++; $i++;
} }
$lastgroupbox .= "</table>"; $lastgroupbox .= "</table>";

View File

@ -527,7 +527,7 @@ function createProductOrService($authentication, $product)
$newobject->label = empty($product['label']) ? '' : $product['label']; $newobject->label = empty($product['label']) ? '' : $product['label'];
$newobject->description = empty($product['description']) ? '' : $product['description']; $newobject->description = empty($product['description']) ? '' : $product['description'];
$newobject->note_public = empty($product['note_public']) ? '' : $product['note_public']; $newobject->note_public = empty($product['note_public']) ? '' : $product['note_public'];
$newobject->note_private = empty($product['note_private']) ? '' :$product['note_private']; $newobject->note_private = empty($product['note_private']) ? '' : $product['note_private'];
$newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell']; $newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell'];
$newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy']; $newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy'];
$newobject->price = isset($product['price_net']) ? $product['price_net'] : 0; $newobject->price = isset($product['price_net']) ? $product['price_net'] : 0;

View File

@ -38,8 +38,8 @@ class WorkstationResource extends CommonObject
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/ */
public $fields = array( public $fields = array(
'fk_workstation' => array ('type' => 'integer'), 'fk_workstation' => array('type' => 'integer'),
'fk_resource' => array ('type' => 'integer') 'fk_resource' => array('type' => 'integer')
); );
/** /**

View File

@ -37,8 +37,8 @@ class WorkstationUserGroup extends CommonObject
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/ */
public $fields = array( public $fields = array(
'fk_workstation' => array ('type' => 'integer'), 'fk_workstation' => array('type' => 'integer'),
'fk_usergroup' => array ('type' => 'integer') 'fk_usergroup' => array('type' => 'integer')
); );
/** /**

View File

@ -34,7 +34,7 @@ function workstationAdminPrepareHead()
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT . "/admin/workstation.php"; $head[$h][0] = DOL_URL_ROOT."/admin/workstation.php";
$head[$h][1] = $langs->trans("Settings"); $head[$h][1] = $langs->trans("Settings");
$head[$h][2] = 'settings'; $head[$h][2] = 'settings';
$h++; $h++;