Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/cron/card.php htdocs/cron/list.php htdocs/filefunc.inc.php
This commit is contained in:
commit
0debcf745a
@ -121,7 +121,9 @@ $utils = new Utils($db);
|
|||||||
if ($what == 'mysql')
|
if ($what == 'mysql')
|
||||||
{
|
{
|
||||||
|
|
||||||
$cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by escapeshellarg
|
$cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||||
|
$cmddump=dol_sanitizePathName($cmddump);
|
||||||
|
|
||||||
if (! empty($dolibarr_main_restrict_os_commands))
|
if (! empty($dolibarr_main_restrict_os_commands))
|
||||||
{
|
{
|
||||||
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
|
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
|
||||||
@ -168,7 +170,8 @@ if ($what == 'mysqlnobin')
|
|||||||
// POSTGRESQL
|
// POSTGRESQL
|
||||||
if ($what == 'postgresql')
|
if ($what == 'postgresql')
|
||||||
{
|
{
|
||||||
$cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by escapeshellarg
|
$cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||||
|
$cmddump=dol_sanitizePathName($cmddump);
|
||||||
|
|
||||||
if (! $errormsg && $cmddump)
|
if (! $errormsg && $cmddump)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $langs->load("cashdesk");
|
|||||||
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
|
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
|
||||||
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
|
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="select_design">
|
<td class="select_design maxwidthonsmartphone">
|
||||||
<?php /*
|
<?php /*
|
||||||
$selected='';
|
$selected='';
|
||||||
$htmlname='idprod';
|
$htmlname='idprod';
|
||||||
@ -60,7 +60,7 @@ $langs->load("cashdesk");
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<select id="selProduit" name="selProduit" onchange="javascript: setSource('LISTE');">
|
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
|
||||||
<?php
|
<?php
|
||||||
print '<option value="0">'.$top_liste_produits.'</option>'."\n";
|
print '<option value="0">'.$top_liste_produits.'</option>'."\n";
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ $langs->load("cashdesk");
|
|||||||
|
|
||||||
$label = $tab_designations[$i]['label'];
|
$label = $tab_designations[$i]['label'];
|
||||||
|
|
||||||
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],7).' - '.dol_trunc($label,35,'middle');
|
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],16).' - '.dol_trunc($label,35,'middle');
|
||||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
||||||
print '</option>'."\n";
|
print '</option>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -2395,7 +2395,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Payment term
|
// Payment term
|
||||||
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
|
print '<tr><td class="nowrap fieldrequired">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
|
||||||
$form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
$form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1542,7 +1542,11 @@ else
|
|||||||
{
|
{
|
||||||
print dol_print_date($db->jdate($objp->date_debut));
|
print dol_print_date($db->jdate($objp->date_debut));
|
||||||
// Warning si date prevu passee et pas en service
|
// Warning si date prevu passee et pas en service
|
||||||
if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) {
|
||||||
|
$warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24;
|
||||||
|
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||||
|
print " ".img_warning($textlate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else print $langs->trans("Unknown");
|
else print $langs->trans("Unknown");
|
||||||
print ' - ';
|
print ' - ';
|
||||||
@ -1550,7 +1554,11 @@ else
|
|||||||
if ($objp->date_fin)
|
if ($objp->date_fin)
|
||||||
{
|
{
|
||||||
print dol_print_date($db->jdate($objp->date_fin));
|
print dol_print_date($db->jdate($objp->date_fin));
|
||||||
if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
|
if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) {
|
||||||
|
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
||||||
|
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||||
|
print " ".img_warning($textlate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else print $langs->trans("Unknown");
|
else print $langs->trans("Unknown");
|
||||||
|
|
||||||
|
|||||||
@ -361,7 +361,12 @@ if ($resql)
|
|||||||
if (($mode == "" || $mode == -1) || $mode < 5)
|
if (($mode == "" || $mode == -1) || $mode < 5)
|
||||||
{
|
{
|
||||||
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
||||||
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late"));
|
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5)
|
||||||
|
{
|
||||||
|
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
||||||
|
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||||
|
print img_warning($textlate);
|
||||||
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
}
|
}
|
||||||
if (($mode == "" || $mode == -1) || $mode >= 5) print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture));
|
if (($mode == "" || $mode == -1) || $mode >= 5) print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture));
|
||||||
|
|||||||
@ -446,7 +446,7 @@ function dol_size($size,$type='')
|
|||||||
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||||
* @return string String cleaned (a-zA-Z_)
|
* @return string String cleaned (a-zA-Z_)
|
||||||
*
|
*
|
||||||
* @see dol_string_nospecial, dol_string_unaccent
|
* @see dol_string_nospecial, dol_string_unaccent, dol_sanitizePathName
|
||||||
*/
|
*/
|
||||||
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
||||||
{
|
{
|
||||||
@ -454,6 +454,22 @@ function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
|||||||
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean a string to use it as a path name
|
||||||
|
*
|
||||||
|
* @param string $str String to clean
|
||||||
|
* @param string $newstr String to replace bad chars with
|
||||||
|
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||||
|
* @return string String cleaned (a-zA-Z_)
|
||||||
|
*
|
||||||
|
* @see dol_string_nospecial, dol_string_unaccent, dol_sanitizeFileName
|
||||||
|
*/
|
||||||
|
function dol_sanitizePathName($str,$newstr='_',$unaccent=1)
|
||||||
|
{
|
||||||
|
$filesystem_forbidden_chars = array('<','>','?','*','|','"','°');
|
||||||
|
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName
|
* Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1486,7 +1486,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_user($arrayidcontact[0]);
|
$object->fetch_user($arrayidcontact[0]);
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
|
$labelbeforecontactname=($outputlangs->transnoentities("FromContactName")!='FromContactName'?$outputlangs->transnoentities("FromContactName"):$outputlangs->transnoentities("Name"));
|
||||||
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$labelbeforecontactname." ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||||
|
|||||||
@ -1306,7 +1306,8 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_user($arrayidcontact[0]);
|
$object->fetch_user($arrayidcontact[0]);
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
|
$labelbeforecontactname=($outputlangs->transnoentities("FromContactName")!='FromContactName'?$outputlangs->transnoentities("FromContactName"):$outputlangs->transnoentities("Name"));
|
||||||
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$labelbeforecontactname.": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||||
|
|||||||
@ -43,6 +43,7 @@ $action=GETPOST('action','alpha');
|
|||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$cancel=GETPOST('cancel');
|
$cancel=GETPOST('cancel');
|
||||||
$backtourl=GETPOST('backtourl','alpha');
|
$backtourl=GETPOST('backtourl','alpha');
|
||||||
|
$securitykey = GETPOST('securitykey','alpha');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -100,6 +101,13 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
|
|||||||
// Execute jobs
|
// Execute jobs
|
||||||
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
|
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
|
||||||
{
|
{
|
||||||
|
if (! empty($conf->global->CRON_KEY) && $conf->global->CRON_KEY != $securitykey)
|
||||||
|
{
|
||||||
|
setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$now = dol_now(); // Date we start
|
$now = dol_now(); // Date we start
|
||||||
|
|
||||||
$result=$object->run_jobs($user->login);
|
$result=$object->run_jobs($user->login);
|
||||||
@ -124,6 +132,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
|||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -284,7 +293,7 @@ if ($action == 'delete')
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'execute'){
|
if ($action == 'execute'){
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id.'&securitykey='.$securitykey,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
||||||
|
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
@ -316,7 +325,7 @@ if (($action=="create") || ($action=="edit"))
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td class="titlefieldcreate">';
|
print '<tr><td class="fieldrequired titlefieldcreate">';
|
||||||
print $langs->trans('CronLabel')."</td>";
|
print $langs->trans('CronLabel')."</td>";
|
||||||
print "<td><input type=\"text\" size=\"30\" name=\"label\" value=\"".$object->label."\" /> ";
|
print "<td><input type=\"text\" size=\"30\" name=\"label\" value=\"".$object->label."\" /> ";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -324,7 +333,7 @@ if (($action=="create") || ($action=="edit"))
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr><td>";
|
print '<tr><td class="fieldrequired">';
|
||||||
print $langs->trans('CronType')."</td><td>";
|
print $langs->trans('CronType')."</td><td>";
|
||||||
print $formCron->select_typejob('jobtype',$object->jobtype);
|
print $formCron->select_typejob('jobtype',$object->jobtype);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -395,7 +404,7 @@ if (($action=="create") || ($action=="edit"))
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr><td>";
|
print '<tr><td class="fieldrequired">';
|
||||||
print $langs->trans('CronEvery')."</td>";
|
print $langs->trans('CronEvery')."</td>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print "<select name=\"nbfrequency\">";
|
print "<select name=\"nbfrequency\">";
|
||||||
@ -640,7 +649,8 @@ else
|
|||||||
|
|
||||||
print "<tr><td>";
|
print "<tr><td>";
|
||||||
print $langs->trans('CronMaxRun')."</td>";
|
print $langs->trans('CronMaxRun')."</td>";
|
||||||
print "<td>".$object->maxrun;
|
print "<td>";
|
||||||
|
print $object->maxrun>0?$object->maxrun:'';
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print "<tr><td>";
|
print "<tr><td>";
|
||||||
@ -709,7 +719,7 @@ else
|
|||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("JobDisabled")).'">'.$langs->trans("CronExecute").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("JobDisabled")).'">'.$langs->trans("CronExecute").'</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=execute&id='.$object->id.'">'.$langs->trans("CronExecute").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=execute&id='.$object->id.(empty($conf->global->CRON_KEY)?'':'&securitykey='.$conf->global->CRON_KEY).'">'.$langs->trans("CronExecute").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $user->rights->cron->create) {
|
if (! $user->rights->cron->create) {
|
||||||
|
|||||||
@ -191,7 +191,7 @@ class Cronjob extends CommonObject
|
|||||||
$sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").",";
|
$sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").",";
|
||||||
$sql.= " ".(! isset($this->md5params)?'NULL':"'".$this->db->escape($this->md5params)."'").",";
|
$sql.= " ".(! isset($this->md5params)?'NULL':"'".$this->db->escape($this->md5params)."'").",";
|
||||||
$sql.= " ".(! isset($this->module_name)?'NULL':"'".$this->db->escape($this->module_name)."'").",";
|
$sql.= " ".(! isset($this->module_name)?'NULL':"'".$this->db->escape($this->module_name)."'").",";
|
||||||
$sql.= " ".(! isset($this->priority)?'NULL':"'".$this->priority."'").",";
|
$sql.= " ".(! isset($this->priority)?'0':$this->priority).",";
|
||||||
$sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).",";
|
$sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).",";
|
||||||
$sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':$this->db->idate($this->datenextrun)).",";
|
$sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':$this->db->idate($this->datenextrun)).",";
|
||||||
$sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':$this->db->idate($this->dateend)).",";
|
$sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':$this->db->idate($this->dateend)).",";
|
||||||
@ -200,13 +200,13 @@ class Cronjob extends CommonObject
|
|||||||
$sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':$this->db->idate($this->datelastresult)).",";
|
$sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':$this->db->idate($this->datelastresult)).",";
|
||||||
$sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").",";
|
$sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").",";
|
||||||
$sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").",";
|
$sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").",";
|
||||||
$sql.= " ".(! isset($this->frequency)?'NULL':"'".$this->frequency."'").",";
|
$sql.= " ".(! isset($this->frequency)?'0':$this->frequency).",";
|
||||||
$sql.= " ".(! isset($this->status)?'0':"'".$this->status."'").",";
|
$sql.= " ".(! isset($this->status)?'0':$this->status).",";
|
||||||
$sql.= " ".$user->id.",";
|
$sql.= " ".$user->id.",";
|
||||||
$sql.= " ".$user->id.",";
|
$sql.= " ".$user->id.",";
|
||||||
$sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").",";
|
$sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").",";
|
||||||
$sql.= " ".(! isset($this->nbrun)?'0':"'".$this->db->escape($this->nbrun)."'").",";
|
$sql.= " ".(! isset($this->nbrun)?'0':$this->db->escape($this->nbrun)).",";
|
||||||
$sql.= " ".(empty($this->maxrun)?'null':"'".$this->db->escape($this->maxrun)."'").",";
|
$sql.= " ".(empty($this->maxrun)?'0':$this->db->escape($this->maxrun)).",";
|
||||||
$sql.= " ".(! isset($this->libname)?'NULL':"'".$this->db->escape($this->libname)."'").",";
|
$sql.= " ".(! isset($this->libname)?'NULL':"'".$this->db->escape($this->libname)."'").",";
|
||||||
$sql.= " ".(! isset($this->test)?'NULL':"'".$this->db->escape($this->test)."'")."";
|
$sql.= " ".(! isset($this->test)?'NULL':"'".$this->db->escape($this->test)."'")."";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
@ -363,6 +363,9 @@ class Cronjob extends CommonObject
|
|||||||
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
$this->lines=array();
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
$sql.= " t.tms,";
|
$sql.= " t.tms,";
|
||||||
@ -399,8 +402,10 @@ class Cronjob extends CommonObject
|
|||||||
if ($status == 2) $sql.= " AND t.status = 2";
|
if ($status == 2) $sql.= " AND t.status = 2";
|
||||||
//Manage filter
|
//Manage filter
|
||||||
if (is_array($filter) && count($filter)>0) {
|
if (is_array($filter) && count($filter)>0) {
|
||||||
foreach($filter as $key => $value) {
|
foreach($filter as $key => $value)
|
||||||
$sql.= ' AND '.$key.' LIKE \'%'.$value.'%\'';
|
{
|
||||||
|
if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value);
|
||||||
|
else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,8 +429,6 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$this->lines=array();
|
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -515,7 +518,7 @@ class Cronjob extends CommonObject
|
|||||||
if (isset($this->status)) $this->status=trim($this->status);
|
if (isset($this->status)) $this->status=trim($this->status);
|
||||||
if (isset($this->note)) $this->note=trim($this->note);
|
if (isset($this->note)) $this->note=trim($this->note);
|
||||||
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
||||||
if (isset($this->maxrun)) $this->maxrun=trim($this->maxrun);
|
if (empty($this->maxrun)) $this->maxrun=0;
|
||||||
if (isset($this->libname)) $this->libname = trim($this->libname);
|
if (isset($this->libname)) $this->libname = trim($this->libname);
|
||||||
if (isset($this->test)) $this->test = trim($this->test);
|
if (isset($this->test)) $this->test = trim($this->test);
|
||||||
|
|
||||||
@ -586,7 +589,7 @@ class Cronjob extends CommonObject
|
|||||||
$sql.= " fk_user_mod=".$user->id.",";
|
$sql.= " fk_user_mod=".$user->id.",";
|
||||||
$sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").",";
|
$sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").",";
|
||||||
$sql.= " nbrun=".((isset($this->nbrun) && $this->nbrun >0)?$this->nbrun:"null").",";
|
$sql.= " nbrun=".((isset($this->nbrun) && $this->nbrun >0)?$this->nbrun:"null").",";
|
||||||
$sql.= " maxrun=".((isset($this->maxrun) && $this->maxrun > 0)?$this->maxrun:"null").",";
|
$sql.= " maxrun=".((isset($this->maxrun) && $this->maxrun > 0)?$this->maxrun:"0").",";
|
||||||
$sql.= " libname=".(isset($this->libname)?"'".$this->db->escape($this->libname)."'":"null").",";
|
$sql.= " libname=".(isset($this->libname)?"'".$this->db->escape($this->libname)."'":"null").",";
|
||||||
$sql.= " test=".(isset($this->test)?"'".$this->db->escape($this->test)."'":"null");
|
$sql.= " test=".(isset($this->test)?"'".$this->db->escape($this->test)."'":"null");
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if ($status == '') $status=-2;
|
|||||||
|
|
||||||
//Search criteria
|
//Search criteria
|
||||||
$search_label=GETPOST("search_label",'alpha');
|
$search_label=GETPOST("search_label",'alpha');
|
||||||
if (empty($arch)) $arch = 0;
|
$securitykey = GETPOST('securitykey','alpha');
|
||||||
|
|
||||||
$diroutputmassaction=$conf->cronjob->dir_output . '/temp/massgeneration/'.$user->id;
|
$diroutputmassaction=$conf->cronjob->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
@ -106,6 +106,13 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
|
|||||||
// Execute jobs
|
// Execute jobs
|
||||||
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
|
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
|
||||||
{
|
{
|
||||||
|
if (! empty($conf->global->CRON_KEY) && $conf->global->CRON_KEY != $securitykey)
|
||||||
|
{
|
||||||
|
setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$object = new Cronjob($db);
|
$object = new Cronjob($db);
|
||||||
$job = $object->fetch($id);
|
$job = $object->fetch($id);
|
||||||
|
|
||||||
@ -135,6 +142,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
|||||||
|
|
||||||
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back
|
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back
|
||||||
exit;
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,7 +232,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
=======
|
||||||
|
if ($action == 'execute')
|
||||||
|
{
|
||||||
|
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status.'&securitykey='.$securitykey,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
||||||
|
>>>>>>> branch '4.0' of git@github.com:Dolibarr/dolibarr.git
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if (! $result) dol_print_error($db);
|
if (! $result) dol_print_error($db);
|
||||||
@ -442,7 +456,11 @@ if ($num > 0)
|
|||||||
}
|
}
|
||||||
if ($user->rights->cron->execute)
|
if ($user->rights->cron->execute)
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
if (!empty($obj->status)) print "<a href=\"".$_SERVER["PHP_SELF"]."?id=".$obj->rowid."&action=execute".($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'').$param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'),"play")."</a>";
|
if (!empty($obj->status)) print "<a href=\"".$_SERVER["PHP_SELF"]."?id=".$obj->rowid."&action=execute".($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'').$param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'),"play")."</a>";
|
||||||
|
=======
|
||||||
|
if (!empty($line->status)) print "<a href=\"".$_SERVER["PHP_SELF"]."?id=".$line->id."&action=execute".(empty($conf->global->CRON_KEY)?'':'&securitykey='.$conf->global->CRON_KEY).($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'').$param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'),"play")."</a>";
|
||||||
|
>>>>>>> branch '4.0' of git@github.com:Dolibarr/dolibarr.git
|
||||||
else print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('JobDisabled'))."\">".img_picto($langs->trans('JobDisabled'),"play")."</a>";
|
else print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('JobDisabled'))."\">".img_picto($langs->trans('JobDisabled'),"play")."</a>";
|
||||||
} else {
|
} else {
|
||||||
print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'),"play")."</a>";
|
print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'),"play")."</a>";
|
||||||
|
|||||||
@ -50,8 +50,7 @@ $formfile = new FormFile($db);
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("SuppliersOrdersArea"));
|
print load_fiche_titre($langs->trans("SuppliersOrdersArea"));
|
||||||
|
|
||||||
print '<table class="notopnoleftnoright" width="100%">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
print '<tr valign="top"><td class="notopnoleft" width="30%">';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -291,7 +290,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</td><td width="70%" valign="top" class="notopnoleftnoright">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -433,7 +432,7 @@ print "</table><br>";
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -299,7 +299,7 @@ print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','','','',$
|
|||||||
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -318,14 +318,14 @@ print '</td>';
|
|||||||
// UTILISATEUR
|
// UTILISATEUR
|
||||||
if ($user->rights->holiday->write_all)
|
if ($user->rights->holiday->write_all)
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
|
||||||
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32,0,'',0,'','maxwidth200');
|
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32,0,'',0,'','maxwidth200');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//print '<td class="liste_titre"> </td>';
|
//print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
|
||||||
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32,0,'',0,'','maxwidth200');
|
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32,0,'',0,'','maxwidth200');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ else
|
|||||||
// APPROVER
|
// APPROVER
|
||||||
if($user->rights->holiday->write_all)
|
if($user->rights->holiday->write_all)
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
|
||||||
|
|
||||||
$validator = new UserGroup($db);
|
$validator = new UserGroup($db);
|
||||||
$excludefilter=$user->admin?'':'u.rowid <> '.$user->id;
|
$excludefilter=$user->admin?'':'u.rowid <> '.$user->id;
|
||||||
@ -377,7 +377,7 @@ $formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// STATUT
|
// STATUT
|
||||||
print '<td class="liste_titre" width="70px;" align="center">';
|
print '<td class="liste_titre maxwidthonsmartphone maxwidth200" align="right">';
|
||||||
$holiday->selectStatutCP($search_statut);
|
$holiday->selectStatutCP($search_statut);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -627,22 +627,12 @@ function jscheckparam()
|
|||||||
ok=false;
|
ok=false;
|
||||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>');
|
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>');
|
||||||
}
|
}
|
||||||
else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == ''))
|
|
||||||
{
|
|
||||||
ok=false;
|
|
||||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>');
|
|
||||||
}
|
|
||||||
// If create user asked
|
// If create user asked
|
||||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == ''))
|
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == ''))
|
||||||
{
|
{
|
||||||
ok=false;
|
ok=false;
|
||||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>');
|
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>');
|
||||||
}
|
}
|
||||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == ''))
|
|
||||||
{
|
|
||||||
ok=false;
|
|
||||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>');
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -544,3 +544,4 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
||||||
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
|
||||||
@ -22,5 +22,6 @@ CREATE TABLE llx_multicurrency_rate
|
|||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
date_sync datetime DEFAULT NULL,
|
date_sync datetime DEFAULT NULL,
|
||||||
rate double NOT NULL DEFAULT 0,
|
rate double NOT NULL DEFAULT 0,
|
||||||
fk_multicurrency integer NOT NULL
|
fk_multicurrency integer NOT NULL,
|
||||||
|
entity integer DEFAULT 1,
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
@ -263,6 +263,7 @@ EditContactAddress=Edit contact/address
|
|||||||
Contact=Contact
|
Contact=Contact
|
||||||
ContactId=Contact id
|
ContactId=Contact id
|
||||||
ContactsAddresses=Contacts/Addresses
|
ContactsAddresses=Contacts/Addresses
|
||||||
|
FromContactName=Name:
|
||||||
NoContactDefinedForThirdParty=No contact defined for this third party
|
NoContactDefinedForThirdParty=No contact defined for this third party
|
||||||
NoContactDefined=No contact defined
|
NoContactDefined=No contact defined
|
||||||
DefaultContact=Default contact/address
|
DefaultContact=Default contact/address
|
||||||
|
|||||||
@ -4346,15 +4346,17 @@ border-top-right-radius: 6px;
|
|||||||
.menu li.menu_choix1 {
|
.menu li.menu_choix1 {
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
.menu li.menu_choix2 {
|
.menu li.menu_choix2 {
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
@media only screen and (max-width: 767px)
|
@media only screen and (max-width: 767px)
|
||||||
{
|
{
|
||||||
.menu_choix1 a, .menu_choix2 a {
|
.menu_choix1 a, .menu_choix2 a {
|
||||||
background-size: 30px 30px;
|
background-size: 36px 36px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4241,7 +4241,31 @@ border-top-right-radius: 6px;
|
|||||||
.menu_choix1 a:hover,.menu_choix2 a:hover {
|
.menu_choix1 a:hover,.menu_choix2 a:hover {
|
||||||
color: #6d3f6d;
|
color: #6d3f6d;
|
||||||
}
|
}
|
||||||
|
.menu li.menu_choix1 {
|
||||||
|
padding-top: 6px;
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
}
|
||||||
|
.menu li.menu_choix2 {
|
||||||
|
padding-top: 6px;
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 767px)
|
||||||
|
{
|
||||||
|
.menu_choix1 a, .menu_choix2 a {
|
||||||
|
background-size: 36px 36px;
|
||||||
|
background-position-y: 6px;
|
||||||
|
padding-left: 40px;
|
||||||
|
}
|
||||||
|
.menu li.menu_choix1, .menu li.menu_choix2 {
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
.liste_articles {
|
||||||
|
margin-right: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user