From 02698c5abb08b0458a8014e6048d15fd86694985 Mon Sep 17 00:00:00 2001 From: Sergiu Sandu Date: Wed, 7 Sep 2016 17:02:41 +0100 Subject: [PATCH 01/13] fileconf.php redundant else statements Is it ok the 2 else blocks are the same? --- htdocs/install/fileconf.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 8d040e06ed4..ab555d36349 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -561,22 +561,12 @@ function jscheckparam() ok=false; alert('transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>'); } - else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == '')) - { - ok=false; - alert('transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>'); - } // If create user asked else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == '')) { ok=false; alert('transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>'); } - else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == '')) - { - ok=false; - alert('transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>'); - } return ok; } From 2b43eb934fc6f4636778c44081d06c3c31036762 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 7 Sep 2016 22:25:37 +0200 Subject: [PATCH 02/13] Fix: Problem of presentation with index supplier command --- htdocs/fourn/commande/index.php | 353 ++++++++++++++++---------------- 1 file changed, 176 insertions(+), 177 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index a797bc19fdc..fe702b5838b 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -19,9 +19,9 @@ */ /** - * \file htdocs/fourn/commande/index.php - * \ingroup commande fournisseur - * \brief Home page of supplier's orders area + * \file htdocs/fourn/commande/index.php + * \ingroup commande fournisseur + * \brief Home page of supplier's orders area */ require '../../main.inc.php'; @@ -50,8 +50,7 @@ $formfile = new FormFile($db); print load_fiche_titre($langs->trans("SuppliersOrdersArea")); -print ''; -print '
'; +print '
'; /* @@ -84,72 +83,72 @@ $sql.= " GROUP BY cf.fk_statut"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - $var=True; + $var=True; - $total=0; - $totalinprocess=0; - $dataseries=array(); - $vals=array(); - // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially - // -> 7=Canceled/Never received -> (reopen) 3=Process runing - // -> 6=Canceled -> (reopen) 2=Approved - while ($i < $num) - { - $row = $db->fetch_row($resql); - if ($row) - { - if ($row[1]!=7 && $row[1]!=6 && $row[1]!=5) - { - $vals[$row[1]]=$row[0]; - $totalinprocess+=$row[0]; - } - $total+=$row[0]; - } - $i++; - } - $db->free($resql); + $total=0; + $totalinprocess=0; + $dataseries=array(); + $vals=array(); + // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially + // -> 7=Canceled/Never received -> (reopen) 3=Process runing + // -> 6=Canceled -> (reopen) 2=Approved + while ($i < $num) + { + $row = $db->fetch_row($resql); + if ($row) + { + if ($row[1]!=7 && $row[1]!=6 && $row[1]!=5) + { + $vals[$row[1]]=$row[0]; + $totalinprocess+=$row[0]; + } + $total+=$row[0]; + } + $i++; + } + $db->free($resql); - print ''; - print ''; - print "\n"; - foreach (array(0,1,2,3,4,5,6) as $statut) - { - $dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?(int) $vals[$statut]:0)); - if (! $conf->use_javascript_ajax) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - } - } - if ($conf->use_javascript_ajax) - { - print ''; - } - //if ($totalinprocess != $total) - //print ''; - print ''; + print '
'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'
'.$commandestatic->LibStatut($statut,0).''.(isset($vals[$statut])?$vals[$statut]:0).'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); - print '
'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'
'; + print ''; + print "\n"; + foreach (array(0,1,2,3,4,5,6) as $statut) + { + $dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?(int) $vals[$statut]:0)); + if (! $conf->use_javascript_ajax) + { + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + } + } + if ($conf->use_javascript_ajax) + { + print ''; + } + //if ($totalinprocess != $total) + //print ''; + print ''; - print "
'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'
'.$commandestatic->LibStatut($statut,0).''.(isset($vals[$statut])?$vals[$statut]:0).'
'; + $data=array('series'=>$dataseries); + dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); + print '
'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'

"; + print "

"; } else { - dol_print_error($db); + dol_print_error($db); } /* * Legends / Status * - * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles - * Reason: Show all Status and give the possibility to filter only one + * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles + * Reason: Show all Status and give the possibility to filter only one */ $sql = "SELECT count(cf.rowid), fk_statut"; @@ -165,34 +164,34 @@ $sql.= " GROUP BY cf.fk_statut"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print ''; + print '
'; - print ''; - print ''; - print "\n"; - $var=True; + print ''; + print ''; + print "\n"; + $var=True; - while ($i < $num) - { - $row = $db->fetch_row($resql); - $var=!$var; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $var=!$var; - print ""; - print ''; - print ''; + print ""; + print ''; + print ''; - print "\n"; - $i++; - } - print "
'.$langs->trans("Status").''.$langs->trans("Nb").'
'.$langs->trans("Status").''.$langs->trans("Nb").'
'.$langs->trans($commandestatic->statuts[$row[1]]).''.$row[0].' '.$commandestatic->LibStatut($row[1],3).'
'.$langs->trans($commandestatic->statuts[$row[1]]).''.$row[0].' '.$commandestatic->LibStatut($row[1],3).'

"; - $db->free($resql); + print "\n"; + $i++; + } + print "
"; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } @@ -202,41 +201,41 @@ else if (! empty($conf->fournisseur->enabled)) { - $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND c.fk_statut = 0"; - if (! empty($socid)) $sql.= " AND c.fk_soc = ".$socid; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.fk_statut = 0"; + if (! empty($socid)) $sql.= " AND c.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - $resql=$db->query($sql); - if ($resql) - { - print ''; - print ''; - print ''; - $langs->load("orders"); - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print ""; - print '"; - print ''; - $i++; - } - } - print "
'.$langs->trans("DraftOrders").'
'; - print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'

"; - } + $resql=$db->query($sql); + if ($resql) + { + print ''; + print ''; + print ''; + $langs->load("orders"); + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ""; + print '"; + print ''; + $i++; + } + } + print "
'.$langs->trans("DraftOrders").'
'; + print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'

"; + } } @@ -258,40 +257,40 @@ $sql.= " AND subperms = 'approuver'"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print ''; - print ''; - print "\n"; - $var=True; + print '
'.$langs->trans("UserWithApproveOrderGrant").'
'; + print ''; + print "\n"; + $var=True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; - print ""; - print ''; - print "\n"; - $i++; - } - print "
'.$langs->trans("UserWithApproveOrderGrant").'
'; - $userstatic->id=$obj->rowid; - $userstatic->lastname=$obj->lastname; - $userstatic->firstname=$obj->firstname; - $userstatic->email=$obj->email; - print $userstatic->getNomUrl(1); - print '

"; - $db->free($resql); + print ""; + print ''; + $userstatic->id=$obj->rowid; + $userstatic->lastname=$obj->lastname; + $userstatic->firstname=$obj->firstname; + $userstatic->email=$obj->email; + print $userstatic->getNomUrl(1); + print ''; + print "\n"; + $i++; + } + print "
"; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } -print ''; +print '
'; /* @@ -314,52 +313,52 @@ $sql.= $db->plimit($max, 0); $resql=$db->query($sql); if ($resql) { - print ''; - print ''; - print ''; + print '
'.$langs->trans("LastModifiedOrders",$max).'
'; + print ''; + print ''; - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); - print ""; - print '"; + print '
'.$langs->trans("LastModifiedOrders",$max).'
'; + print "
'; - $commandestatic->id=$obj->rowid; - $commandestatic->ref=$obj->ref; + $commandestatic->id=$obj->rowid; + $commandestatic->ref=$obj->ref; - print ''; - print ''; + print '
'; - print $commandestatic->getNomUrl(1); - print '
'; + print ''; - print ''; + print ''; - print '
'; + print $commandestatic->getNomUrl(1); + print ''; - print ' '; - print ''; + print ' '; + print ''; - $filename=dol_sanitizeFileName($obj->ref); - $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); - print '
'; + print '
'; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); + print '
'; - print ''; + print ''; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; - print ''.dol_print_date($db->jdate($obj->tms),'day').''; - print ''.$commandestatic->LibStatut($obj->fk_statut,5).''; - print ''; - $i++; - } - } - print "
"; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; + print ''.dol_print_date($db->jdate($obj->tms),'day').''; + print ''.$commandestatic->LibStatut($obj->fk_statut,5).''; + print ''; + $i++; + } + } + print "
"; } else dol_print_error($db); @@ -433,7 +432,7 @@ print "
"; } */ -print ''; +print '
'; llxFooter(); From 2b7ef01e422aae00d22abaae8da5d339f66b4c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 11:05:47 +0200 Subject: [PATCH 03/13] FIX SEC for HTB23302 --- htdocs/admin/tools/export.php | 7 +++++-- htdocs/core/lib/functions.lib.php | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 5ace954045a..12b41110ac2 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -121,7 +121,9 @@ $utils = new Utils($db); 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)) { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); @@ -168,7 +170,8 @@ if ($what == 'mysqlnobin') // 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) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3a4021653cc..5a8df04ff8e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -443,10 +443,10 @@ function dol_size($size,$type='') * * @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 + * @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 + * @see dol_string_nospecial, dol_string_unaccent, dol_sanitizePathName */ 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); } +/** + * 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 * From 9affdc088689fcefc3e2562c0cb59a33d4efb18d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 11:23:26 +0200 Subject: [PATCH 04/13] Prepare 4.0.1 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 37e4b9eb098..129475812e1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.0'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.1'); if (! defined('EURO')) define('EURO',chr(128)); From 9aa6c72a116a1871fc49343afc20aeb4b5e9ddb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 12:37:51 +0200 Subject: [PATCH 05/13] FIX Update of maxnbrun on job list failed. --- htdocs/cron/card.php | 23 ++++++++++++----------- htdocs/cron/class/cronjob.class.php | 14 +++++++------- htdocs/cron/list.php | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 13bc2624966..fc845f24585 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -284,7 +284,7 @@ if ($action == 'delete') } 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.(empty($conf->global->CRON_KEY)?'':'&securitykey='.$conf->global->CRON_KEY),$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); $action=''; } @@ -316,7 +316,7 @@ if (($action=="create") || ($action=="edit")) print ''; - print '"; print ""; @@ -324,7 +324,7 @@ if (($action=="create") || ($action=="edit")) print ""; print "\n"; - print ""; @@ -395,7 +395,7 @@ if (($action=="create") || ($action=="edit")) print ""; print "\n"; - print ""; print ""; print "\n"; - print '
'; + print '
'; print $langs->trans('CronLabel')."label."\" /> "; print "
"; + print '
'; print $langs->trans('CronType').""; print $formCron->select_typejob('jobtype',$object->jobtype); print "
"; + print '
'; print $langs->trans('CronEvery').""; print "
'; + print '
'; $maxrun=''; if (!empty($object->maxrun)) { $maxrun=$object->maxrun; @@ -552,7 +552,7 @@ else // box add_jobs_box print ''; - print '"; print "\n"; @@ -614,7 +614,7 @@ else print '
'; + print '
'; print $langs->trans('CronId')."".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id', '', '', 0); print "
'; - print ""; print ""; - print '"; @@ -640,7 +640,8 @@ else print ""; - print ""; print "
"; + print '
'; print $langs->trans('CronEvery').""; if($object->unitfrequency == "60") print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Minutes'); @@ -623,7 +623,7 @@ else if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Weeks'); print "
'; + print '
'; print $langs->trans('CronDtStart').""; if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhoursec');} print "
"; print $langs->trans('CronMaxRun')."".$object->maxrun; + print ""; + print $object->maxrun>0?$object->maxrun:''; print "
"; @@ -666,7 +667,7 @@ else print ''; - print '"; @@ -707,7 +708,7 @@ else print ''.$langs->trans("CronExecute").''; } else { - print ''.$langs->trans("CronExecute").''; + print ''.$langs->trans("CronExecute").''; } if (! $user->rights->cron->create) { diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index e3f6f548cea..1f06bb81612 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -191,7 +191,7 @@ class Cronjob extends CommonObject $sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").","; $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->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->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)).","; @@ -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->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").","; $sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").","; - $sql.= " ".(! isset($this->frequency)?'NULL':"'".$this->frequency."'").","; - $sql.= " ".(! isset($this->status)?'0':"'".$this->status."'").","; + $sql.= " ".(! isset($this->frequency)?'0':$this->frequency).","; + $sql.= " ".(! isset($this->status)?'0':$this->status).","; $sql.= " ".$user->id.","; $sql.= " ".$user->id.","; $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").","; - $sql.= " ".(! isset($this->nbrun)?'0':"'".$this->db->escape($this->nbrun)."'").","; - $sql.= " ".(empty($this->maxrun)?'null':"'".$this->db->escape($this->maxrun)."'").","; + $sql.= " ".(! isset($this->nbrun)?'0':$this->db->escape($this->nbrun)).","; + $sql.= " ".(empty($this->maxrun)?'0':$this->db->escape($this->maxrun)).","; $sql.= " ".(! isset($this->libname)?'NULL':"'".$this->db->escape($this->libname)."'").","; $sql.= " ".(! isset($this->test)?'NULL':"'".$this->db->escape($this->test)."'").""; $sql.= ")"; @@ -518,7 +518,7 @@ class Cronjob extends CommonObject if (isset($this->status)) $this->status=trim($this->status); if (isset($this->note)) $this->note=trim($this->note); 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->test)) $this->test = trim($this->test); @@ -589,7 +589,7 @@ class Cronjob extends CommonObject $sql.= " fk_user_mod=".$user->id.","; $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"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.= " test=".(isset($this->test)?"'".$this->db->escape($this->test)."'":"null"); $sql.= " WHERE rowid=".$this->id; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index b6ad4a8d2aa..618af2c1778 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -350,7 +350,7 @@ if ($num > 0) } if ($user->rights->cron->execute) { - if (!empty($line->status)) print "id."&action=execute".($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'').$param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'),"play").""; + if (!empty($line->status)) print "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").""; else print "trans('JobDisabled'))."\">".img_picto($langs->trans('JobDisabled'),"play").""; } else { print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'),"play").""; From 71cef95dda7e9f2f2099fca619a7ad57cb88ad72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 13:01:50 +0200 Subject: [PATCH 06/13] FIX Execute a dedicated job from its id may results of launching other jobs too. --- htdocs/cron/card.php | 57 ++++++++++++++---------- htdocs/cron/class/cronjob.class.php | 11 +++-- htdocs/cron/list.php | 69 ++++++++++++++++------------- 3 files changed, 79 insertions(+), 58 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index fc845f24585..1c68f79f0c0 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -43,6 +43,7 @@ $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $cancel=GETPOST('cancel'); $backtourl=GETPOST('backtourl','alpha'); +$securitykey = GETPOST('securitykey','alpha'); /* @@ -100,30 +101,38 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del // Execute jobs if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute) { - $now = dol_now(); // Date we start + 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 + + $result=$object->run_jobs($user->login); - $result=$object->run_jobs($user->login); - - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } - else - { - $res = $object->reprogram_jobs($user->login, $now); - if ($res > 0) - { - if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings'); - else setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); - $action=''; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } - } + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + else + { + $res = $object->reprogram_jobs($user->login, $now); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings'); + else setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); + $action=''; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + } + } } @@ -284,7 +293,7 @@ if ($action == 'delete') } if ($action == 'execute'){ - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id.(empty($conf->global->CRON_KEY)?'':'&securitykey='.$conf->global->CRON_KEY),$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=''; } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 1f06bb81612..712f4e94234 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -363,6 +363,9 @@ class Cronjob extends CommonObject function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='') { global $langs; + + $this->lines=array(); + $sql = "SELECT"; $sql.= " t.rowid,"; $sql.= " t.tms,"; @@ -399,8 +402,10 @@ class Cronjob extends CommonObject if ($status == 2) $sql.= " AND t.status = 2"; //Manage filter if (is_array($filter) && count($filter)>0) { - foreach($filter as $key => $value) { - $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + foreach($filter as $key => $value) + { + if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value); + else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -427,8 +432,6 @@ class Cronjob extends CommonObject if ($num) { - $this->lines=array(); - while ($i < $num) { diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 618af2c1778..aa7d6e8790c 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -57,6 +57,7 @@ if ($status == '') $status=-2; //Search criteria $search_label=GETPOST("search_label",'alpha'); +$securitykey = GETPOST('securitykey','alpha'); if (empty($sortorder)) $sortorder="DESC"; if (empty($sortfield)) $sortfield="t.status"; @@ -99,35 +100,43 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del // Execute jobs if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute) { - $object = new Cronjob($db); - $job = $object->fetch($id); - - $now = dol_now(); // Date we start - - $resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK - if ($resrunjob < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - - // Programm next run - $res = $object->reprogram_jobs($user->login, $now); - if ($res > 0) - { - if ($resrunjob >= 0) // We add result of reprogram ony if no error message already reported - { - if ($object->lastresult >= 0) setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); - else setEventMessages($langs->trans("JobFinished"), null, 'errors'); - } - $action=''; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } - - header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back - exit; + 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); + $job = $object->fetch($id); + + $now = dol_now(); // Date we start + + $resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK + if ($resrunjob < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + // Programm next run + $res = $object->reprogram_jobs($user->login, $now); + if ($res > 0) + { + if ($resrunjob >= 0) // We add result of reprogram ony if no error message already reported + { + if ($object->lastresult >= 0) setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); + else setEventMessages($langs->trans("JobFinished"), null, 'errors'); + } + $action=''; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + + header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back + exit; + } } @@ -166,7 +175,7 @@ if ($action == 'delete') if ($action == 'execute') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status.'&securitykey='.$securitykey,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); } From 79171699610d974f319a187abe2ac3299f57736b Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 8 Sep 2016 14:53:59 +0200 Subject: [PATCH 07/13] Fix miss entity column in llx_multicurrency_rate --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 1 + htdocs/install/mysql/tables/llx_multicurrency_rate.sql | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index cbc0dd75a56..2bb44238a60 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -541,3 +541,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; -- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL; +ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql index 333f5deab52..74661088751 100644 --- a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql +++ b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql @@ -22,5 +22,6 @@ CREATE TABLE llx_multicurrency_rate rowid integer AUTO_INCREMENT PRIMARY KEY, date_sync datetime DEFAULT NULL, rate double NOT NULL DEFAULT 0, - fk_multicurrency integer NOT NULL + fk_multicurrency integer NOT NULL, + entity integer DEFAULT 1, ) ENGINE=innodb; \ No newline at end of file From 7229b572dcd771deffade94c7c24f73f95c7ba37 Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 8 Sep 2016 14:59:16 +0200 Subject: [PATCH 08/13] Default entity 1 in llx_multicurrency_rate --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 2bb44238a60..67e3b3af448 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -541,4 +541,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; -- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL; -ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer; \ No newline at end of file +ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; \ No newline at end of file From 6fd14128baa0f3775031700b9322dbaa62135512 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 8 Sep 2016 16:37:30 +0200 Subject: [PATCH 09/13] fix : bad name --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1767e9971ef..7b33c8b6ffa 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -420,7 +420,7 @@ if ($resql) if (! empty($arrayfields['d.firstname']['checked'])) { print ''; + print ''; } if (! empty($arrayfields['d.lastname']['checked'])) From 417b2f566f88fc031dba2d78c3a89269cae247fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 17:31:42 +0200 Subject: [PATCH 10/13] FIX Translation of "Name" is not a good choice for floow-up. --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 3 ++- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 3 ++- htdocs/langs/en_US/companies.lang | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 35efaf55824..ee977908814 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1473,7 +1473,8 @@ class pdf_azur extends ModelePDFPropales if (count($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); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3497d7cf96f..e53f0343230 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -1293,7 +1293,8 @@ class pdf_aurore extends ModelePDFSupplierProposal if (count($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); diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 22a7844ee07..225552b05c3 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -263,6 +263,7 @@ EditContactAddress=Edit contact/address Contact=Contact ContactId=Contact id ContactsAddresses=Contacts/Addresses +FromContactName=Name: NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefined=No contact defined DefaultContact=Default contact/address From c3bb4a89e484edb924a067ed5d7f9f2202f4cf5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 17:53:04 +0200 Subject: [PATCH 11/13] Fix late satus on contract service line --- htdocs/contrat/card.php | 12 ++++++++++-- htdocs/contrat/services.php | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f6d299f94e0..ef257c348aa 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1567,7 +1567,11 @@ else { print dol_print_date($db->jdate($objp->date_debut)); // 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"); print '  -  '; @@ -1575,7 +1579,11 @@ else if ($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"); diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index d2de41391de..8e37e392603 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -361,7 +361,12 @@ if ($resql) if (($mode == "" || $mode == -1) || $mode < 5) { print ''; From efde12b489d1bbea2783494f53261f610f3d0f48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Sep 2016 09:21:27 +0200 Subject: [PATCH 13/13] Fix minor css --- htdocs/cashdesk/tpl/facturation1.tpl.php | 6 +++--- htdocs/holiday/list.php | 10 ++++----- htdocs/theme/eldy/style.css.php | 4 +++- htdocs/theme/md/style.css.php | 26 +++++++++++++++++++++++- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 8ddd7e48a85..d20eb4c3299 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -48,7 +48,7 @@ $langs->load("cashdesk"); onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);" onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/> - \n"; @@ -315,14 +315,14 @@ print ''; // UTILISATEUR if ($user->rights->holiday->write_all) { - print ''; } else { //print ''; - print ''; } @@ -330,7 +330,7 @@ else // APPROVER if($user->rights->holiday->write_all) { - print ''; // STATUT -print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d9df3205c68..6a2a9b80e14 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4334,15 +4334,17 @@ border-top-right-radius: 6px; .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: 30px 30px; + background-size: 36px 36px; height: 30px; padding-left: 40px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 73a02139e5a..ad9bda1b4dd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4219,7 +4219,31 @@ border-top-right-radius: 6px; .menu_choix1 a:hover,.menu_choix2 a:hover { 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; + } +}
'; + print '
'; print $langs->trans('CronDtLastLaunch').""; if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhoursec');} else {print $langs->trans('CronNone');} print "
'; - print ''.($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 '    '; } if (($mode == "" || $mode == -1) || $mode >= 5) print ''.dol_print_date($db->jdate($obj->date_cloture)); From 4fe4907b442e4e0fc05a5f30e6ed71133abe1da0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2016 18:13:23 +0200 Subject: [PATCH 12/13] FIX Mandatory field payment term was not css highlighted. --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 63d87cfba31..32333d2f1e1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2400,7 +2400,7 @@ if ($action == 'create') } // Payment term - print '
' . $langs->trans('PaymentConditionsShort') . ''; + print '
' . $langs->trans('PaymentConditionsShort') . ''; $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); print '
+ load("cashdesk"); */ ?> - '.$top_liste_produits.''."\n"; @@ -80,7 +80,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; - print ''."\n"; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8489f57187e..27be524af3a 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -296,7 +296,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("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("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 "
'; + print ''; print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32,0,'',0,'','maxwidth200'); print ' '; + print ''; print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32,0,'',0,'','maxwidth200'); print ''; + print ''; $validator = new UserGroup($db); $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; @@ -365,7 +365,7 @@ $formother->select_year($year_end,'year_end',1, $min_year, $max_year); print ''; +print ''; $holiday->selectStatutCP($search_statut); print '