diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index cd30af0dfdc..618a8803a6e 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -198,7 +198,8 @@ foreach ($syslogModules as $moduleName) { foreach ($setuparray as $option) { - if (defined($option['constant'])) $value = constant($option['constant']); + if (isset($_POST[$option['constant']])) $value=$_POST[$option['constant']]; + else if (defined($option['constant'])) $value = constant($option['constant']); else $value = (isset($option['default']) ? $option['default'] : ''); print $option['name'].': '; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 7bd1544fe14..cc27e0cd835 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1394,6 +1394,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $datedelivery = (!empty($objectsrc->date_livraison)?$objectsrc->date_livraison:''); + $note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : '')); $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); @@ -1410,6 +1412,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $remise_percent = $soc->remise_percent; $remise_absolue = 0; $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $projectid = 0; } $absolute_discount=$soc->getAvailableDiscounts(); @@ -1432,7 +1435,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Reference client print ''.$langs->trans('RefCustomer').''; - print ''; + //print ''; + print ''; // We must not use ref_client of proposal for an order print ''; // Client @@ -1463,43 +1467,37 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Date de livraison print "".$langs->trans("DeliveryDate").''; - if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) + if (empty($datedelivery)) { - $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - } - else - { - $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); + else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; } $form->select_date($datedelivery,'liv_','','','',"crea_commande",1,1); print ""; // Conditions de reglement print ''.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1); + $form->select_conditions_paiements($cond_reglement_id,'cond_reglement_id',-1,1); print ''; // Mode de reglement print ''.$langs->trans('PaymentMode').''; - $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); + $form->select_types_paiements($mode_reglement_id,'mode_reglement_id'); print ''; // Delivery delay print ''.$langs->trans('AvailabilityPeriod').''; - $form->select_availability($propal->availability,'availability_id','',1); + $form->select_availability($availability_id,'availability_id','',1); print ''; // What trigger creation print ''.$langs->trans('Source').''; - $form->select_demand_reason(($origin=='propal'?'SRC_COMM':''),'demand_reason_id','',1); + $form->select_demand_reason($demand_reason_id,'demand_reason_id','',1); print ''; // Project if (! empty($conf->projet->enabled)) { - $projectid = 0; - if ($origin == 'project') $projectid = ($originid?$originid:0); - print ''.$langs->trans('Project').''; $numprojet=select_projects($soc->id,$projectid); if ($numprojet==0) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 7b60344fc06..15309b3f70e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -129,6 +129,20 @@ if ($action == "builddoc" && $user->rights->facture->lire) } } +// Remove file +if ($action == 'remove_file') +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $diroutputpdf; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,''); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + $action=''; +} + /* diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 92f2a8e3836..5767aee6b48 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -439,22 +439,6 @@ class Conf if (isset($this->contrat)) $this->contract=$this->contrat; if (isset($this->categorie)) $this->category=$this->categorie; - - // Define menu manager in setup - if (empty($user->societe_id)) // If internal user or not defined - { - $this->top_menu=(empty($this->global->MAIN_MENU_STANDARD_FORCED)?$this->global->MAIN_MENU_STANDARD:$this->global->MAIN_MENU_STANDARD_FORCED); - $this->smart_menu=(empty($this->global->MAIN_MENU_SMARTPHONE_FORCED)?$this->global->MAIN_MENU_SMARTPHONE:$this->global->MAIN_MENU_SMARTPHONE_FORCED); - } - else // If external user - { - $this->top_menu=(empty($this->global->MAIN_MENUFRONT_STANDARD_FORCED)?$this->global->MAIN_MENUFRONT_STANDARD:$this->global->MAIN_MENUFRONT_STANDARD_FORCED); - $this->smart_menu=(empty($this->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$this->global->MAIN_MENUFRONT_SMARTPHONE:$this->global->MAIN_MENUFRONT_SMARTPHONE_FORCED); - } - // For backward compatibility - if ($this->top_menu == 'eldy.php') $this->top_menu='eldy_backoffice.php'; - elseif ($this->top_menu == 'rodolphe.php') $this->top_menu='eldy_backoffice.php'; - // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32fd57ec3c5..40cad87130f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1971,10 +1971,10 @@ class Form /** * Return list of events that triggered an object creation * - * @param int $selected Id du type d'origine pre-selectionne + * @param int $selected Id or code of type origin to select by default * @param string $htmlname Nom de la zone select * @param string $exclude To exclude a code value (Example: SRC_PROP) - * @param int $addempty Add an empty entry + * @param int $addempty Add an empty entry * @return void */ function select_demand_reason($selected='',$htmlname='demandreasonid',$exclude='',$addempty=0) @@ -1989,7 +1989,7 @@ class Form { if ($arraydemandreason['code']==$exclude) continue; - if ($selected == $arraydemandreason['id']) + if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { print '