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/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 = '';"/> - + load("cashdesk"); */ ?> - '.$top_liste_produits.''."\n"; @@ -80,7 +80,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; - print ''."\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4a72b629df5..8632dfff3bd 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2395,7 +2395,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 ''; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9e3d5425eb5..c5222151625 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1542,7 +1542,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 '  -  '; @@ -1550,7 +1554,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 ''.($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)); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4d6f05f4de8..0344f56aaab 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 * diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 2388c00c4c2..7d9dc1df1ef 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1486,7 +1486,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 178b386aa61..953b1a46206 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -1306,7 +1306,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/cron/card.php b/htdocs/cron/card.php index ef1adf44441..41ee8414482 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,$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=''; } @@ -316,7 +325,7 @@ if (($action=="create") || ($action=="edit")) print ''; - print '"; print ""; @@ -324,7 +333,7 @@ if (($action=="create") || ($action=="edit")) print ""; print "\n"; - print ""; @@ -395,7 +404,7 @@ if (($action=="create") || ($action=="edit")) print ""; print "\n"; - print ""; print ""; - print ""; print "\n"; + $i++; + } + 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 $langs->trans('CronMaxRun')."".$object->maxrun; + print ""; + print $object->maxrun>0?$object->maxrun:''; print "
"; @@ -709,7 +719,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 8f6cb409b2c..aed6234d5f8 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.= ")"; @@ -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).'%\''; } } @@ -424,8 +429,6 @@ class Cronjob extends CommonObject if ($num) { - $this->lines=array(); - while ($i < $num) { @@ -515,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); @@ -586,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 10f9b954cb1..98998f1d1bd 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -58,7 +58,7 @@ if ($status == '') $status=-2; //Search criteria $search_label=GETPOST("search_label",'alpha'); -if (empty($arch)) $arch = 0; +$securitykey = GETPOST('securitykey','alpha'); $diroutputmassaction=$conf->cronjob->dir_output . '/temp/massgeneration/'.$user->id; @@ -106,35 +106,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; + } } @@ -224,7 +232,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } +<<<<<<< HEAD $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); if (! $result) dol_print_error($db); @@ -442,7 +456,11 @@ if ($num > 0) } if ($user->rights->cron->execute) { +<<<<<<< HEAD if (!empty($obj->status)) print "rowid."&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").""; +>>>>>>> branch '4.0' of git@github.com:Dolibarr/dolibarr.git else print "trans('JobDisabled'))."\">".img_picto($langs->trans('JobDisabled'),"play").""; } else { print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'),"play").""; 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 "

"; + $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(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index a02d508cf1d..c105e588c15 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -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("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 "\n"; @@ -318,14 +318,14 @@ print ''; // UTILISATEUR if ($user->rights->holiday->write_all) { - print ''; + print ''; print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32,0,'',0,'','maxwidth200'); print ''; } else { //print ' '; - print ''; + print ''; print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32,0,'',0,'','maxwidth200'); print ''; } @@ -333,7 +333,7 @@ else // APPROVER if($user->rights->holiday->write_all) { - print ''; + print ''; $validator = new UserGroup($db); $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; @@ -377,7 +377,7 @@ $formother->select_year($year_end,'year_end',1, $min_year, $max_year); print ''; // STATUT -print ''; +print ''; $holiday->selectStatutCP($search_statut); print ''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 17784e8b766..3f597c794d1 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -627,22 +627,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; } 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 cdcf633d458..a747164e04c 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 @@ -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; -- 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; \ 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 diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 5cca989d65e..481967513b0 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 diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 43f4ddc70c4..734e7fe497e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4346,15 +4346,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 1045f1f1119..d4d24172bbf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4241,7 +4241,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; + } +}