diff --git a/.travis.yml b/.travis.yml index 8655b27d4ed..4c18c5caa3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: - '5.3' - '5.4' - '5.5' -- '5.6' +- '5.6.29' - '7.0' - nightly diff --git a/ChangeLog b/ChangeLog index 5fe3c741499..e4c07380aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,28 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 4.0.6 to 4.0.5 ***** +FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key +FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users +FIX: #6636 Complete fix +FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry +FIX: #6671 Cannot remove thirdparty type with "#" in its name +FIX: #6673 Missing "nature" table header in thirdparty list +FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list +FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty +FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode +FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it +FIX: #6813 +FIX: Correction with author and validator user on orders +FIX: doactions hook missing in invoice model page +FIX: dont get empty "Incoterms : - " string if no incoterm +FIX: dont lose supplier ref if no supplier price in database +FIX: forgotten parameter for right multicompany use +FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden +FIX: limit+1 dosn't show Total line +FIX: supplier order line were always created with rang = 0 + + ***** ChangeLog for 4.0.5 to 4.0.4 ***** FIX: #6234 FIX: #6259 diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 34757a5123a..2ef8ab32f22 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -353,10 +353,12 @@ begin begin // TODO Copy file or ask to install package ? //CustomMessage('YouWillInstallDoliWamp')+#13#13 - MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); + MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); end; - - + // Pb seems similar with msvcp110.dll + //vcredist_x64.exe + + // If we have a new database version, we should only copy old my.ini file into new directory // and change only all basedir= strings to use new version. Like this, data dir is still correct. // Install of service and stop/start scripts are already rebuild by installer. diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c06d8f0730f..20dfc2579aa 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Cwd; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages @@ -518,6 +518,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/forceproject*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 26be80caa68..d87a439f404 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -282,6 +282,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $refcomp=$societestatic->getNomUrl(1,'',24); $paiement = $facturestatic->getSommePaiement(); // Payment already done + $paiement+= $facturestatic->getSumDepositsUsed(); + $paiement+= $facturestatic->getSumCreditNotesUsed(); } if ($obj->family == 'social_contribution') { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4e7f7fe1c32..8a35fd7583d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1998,7 +1998,7 @@ if ($action == 'create') if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); $note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null)); $note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null)); - + if (! empty($conf->use_javascript_ajax)) { require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; @@ -2197,7 +2197,7 @@ if ($action == 'create') if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) { // Deposit - if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) + if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) { print '
'; $tmp=' '; @@ -2208,7 +2208,7 @@ if ($action == 'create') }); }); '; - + $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); print '
'; print $desc; @@ -2222,7 +2222,7 @@ if ($action == 'create') print '' . $langs->trans('Value') . ':'; } print '
'; - + print '
'; } } @@ -2254,7 +2254,7 @@ if ($action == 'create') } // Replacement - if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) + if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { print ''; print '
'; @@ -2301,7 +2301,7 @@ if ($action == 'create') if ($socid > 0) { // Credit note - if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) { print '
'; $tmp='textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; - + print '
'; print '    0 ? 'checked':'').' /> "; print '
    0 ? 'checked':'').' /> "; print '
'; - + print '
'; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a1364702d52..1dd45234b9b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2482,7 +2482,7 @@ class Facture extends CommonInvoice * @param string $fk_unit Code of the unit to use. Null to use the default one * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=0, $fk_unit = null) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null) { global $conf,$user; // Deprecation warning diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1d0a5ad7e9f..2d61982a80e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -201,7 +201,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS $search_state=""; $search_type=''; $search_country=''; - $search_type_thirdparty=''; + $search_type_thirdparty=''; $day=''; $year=''; $month=''; @@ -228,7 +228,7 @@ if (empty($reshook)) setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors'); $error++; } - + if (! $error && $massaction == 'confirm_presend' && GETPOST('modelselected')) // If we change the template, we must not send email, but keep on send email form { $massaction='presend'; @@ -240,7 +240,7 @@ if (empty($reshook)) $nbignored = 0; $langs->load("mails"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - + if (!$error && !isset($user->email)) { $error++; @@ -258,7 +258,7 @@ if (empty($reshook)) { $objecttmp=new Facture($db); // must create new instance because instance is saved into $listofobjectref array for future use $result=$objecttmp->fetch($toselectid); - if ($result > 0) + if ($result > 0) { $listoinvoicesid[$toselectid]=$toselectid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; @@ -267,16 +267,16 @@ if (empty($reshook)) } } //var_dump($listofobjectthirdparties);exit; - + foreach ($listofobjectthirdparties as $thirdpartyid) { $result = $thirdparty->fetch($thirdpartyid); - if ($result < 0) + if ($result < 0) { dol_print_error($db); exit; } - + // Define recipient $sendto and $sendtocc if (trim($_POST['sendto'])) { @@ -314,9 +314,9 @@ if (empty($reshook)) $sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email'); } } - + //var_dump($listofobjectref[$thirdpartyid]); // Array of invoice for this thirdparty - + $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); $listofqualifiedinvoice=array(); $listofqualifiedref=array(); @@ -324,14 +324,14 @@ if (empty($reshook)) { //var_dump($object); //var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut); - + if ($object->statut != Facture::STATUS_VALIDATED) { $nbignored++; $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'

'; continue; // Payment done or started or canceled } - + // Read document // TODO Use future field $object->fullpathdoc to know where is stored default file // TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. @@ -347,39 +347,39 @@ if (empty($reshook)) $object->fetch_thirdparty(); $sendto = $object->thirdparty->email; } - - if (empty($sendto)) + + if (empty($sendto)) { //print "No recipient for thirdparty ".$object->thirdparty->name; $nbignored++; continue; } - + if (dol_strlen($sendto)) { // Create form object $attachedfiles=array( - 'paths'=>array_merge($attachedfiles['paths'],array($file)), - 'names'=>array_merge($attachedfiles['names'],array($filename)), + 'paths'=>array_merge($attachedfiles['paths'],array($file)), + 'names'=>array_merge($attachedfiles['names'],array($filename)), 'mimes'=>array_merge($attachedfiles['mimes'],array($mime)) ); } - + $listofqualifiedinvoice[$objectid]=$object; $listofqualifiedref[$objectid]=$object->ref; } else - { + { $nbignored++; $langs->load("errors"); $resaction.='
'.$langs->trans('ErrorCantReadFile',$file).'

'; dol_syslog('Failed to read file: '.$file, LOG_WARNING); continue; } - + //var_dump($listofqualifiedref); } - + if (count($listofqualifiedinvoice) > 0) { $langs->load("commercial"); @@ -389,7 +389,7 @@ if (empty($reshook)) $message = GETPOST('message'); $sendtocc = GETPOST('sentocc'); $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); - + $substitutionarray=array( '__ID__' => join(', ',array_keys($listofqualifiedinvoice)), '__EMAIL__' => $thirdparty->email, @@ -400,16 +400,16 @@ if (empty($reshook)) '__REF__' => join(', ',$listofqualifiedref), '__REFCLIENT__' => $thirdparty->name ); - + $subject=make_substitutions($subject, $substitutionarray); $message=make_substitutions($message, $substitutionarray); - + $filepath = $attachedfiles['paths']; $filename = $attachedfiles['names']; $mimetype = $attachedfiles['mimes']; - + //var_dump($filepath); - + // Send mail require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); @@ -423,9 +423,9 @@ if (empty($reshook)) if ($result) { $resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'
'; // Must not contain " - + $error=0; - + // Insert logs into agenda foreach($listofqualifiedinvoice as $invid => $object) { @@ -438,7 +438,7 @@ if (empty($reshook)) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); $actionmsg = dol_concatdesc($actionmsg, $message); } - + // Initialisation donnees $object->sendtoid = 0; $object->actiontypecode = $actiontypecode; @@ -446,14 +446,14 @@ if (empty($reshook)) $object->actionmsg2 = $actionmsg2; // Short text $object->fk_element = $invid; $object->elementtype = $object->element; - + // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + if ($error) { setEventMessages($db->lasterror(), $errors, 'errors'); @@ -484,7 +484,7 @@ if (empty($reshook)) $resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n
"; $resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n
"; $resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n
"; - + if ($nbsent) { $action=''; // Do not show form post if there was at least one successfull sent @@ -497,7 +497,7 @@ if (empty($reshook)) setEventMessages($resaction, null, 'warnings'); } } - + $action='list'; $massaction=''; } @@ -507,7 +507,7 @@ if (empty($reshook)) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - + $objecttmp=new Facture($db); $listofobjectid=array(); $listofobjectthirdparties=array(); @@ -542,7 +542,7 @@ if (empty($reshook)) } } } - + // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; $newlang=''; @@ -607,12 +607,12 @@ if (empty($reshook)) setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); } } - + // Remove file if ($action == 'remove_file') { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - + $langs->load("other"); $upload_dir = $diroutputmassaction; $file = $upload_dir . '/' . GETPOST('file'); @@ -621,10 +621,10 @@ if (empty($reshook)) else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); $action=''; } - + } - + /* * View @@ -650,7 +650,7 @@ $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name"; // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. -if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; +if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -795,7 +795,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } -$sql.= $db->plimit($limit,$offset); +$sql.= $db->plimit($limit + 1,$offset); //print $sql; $resql = $db->query($sql); @@ -804,7 +804,7 @@ if ($resql) $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); - + if ($socid) { $soc = new Societe($db); @@ -842,11 +842,12 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + $i = 0; print '
'."\n"; + if ($optioncss != '') print ''; print ''; print ''; @@ -854,14 +855,14 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num,$nbtotalofrecords,'title_accountancy.png',0,'','',$limit); if ($massaction == 'presend') { $langs->load("mails"); - - if (! GETPOST('cancel')) + + if (! GETPOST('cancel')) { $objecttmp=new Facture($db); $listofselectedid=array(); @@ -870,7 +871,7 @@ if ($resql) foreach($arrayofselected as $toselectid) { $result=$objecttmp->fetch($toselectid); - if ($result > 0) + if ($result > 0) { $listofselectedid[$toselectid]=$toselectid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; @@ -881,10 +882,10 @@ if ($resql) } print ''; - + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - + $formmail = new FormMail($db); + dol_fiche_head(null, '', ''); $topicmail="SendBillRef"; @@ -949,16 +950,16 @@ if ($resql) //$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; print $formmail->get_form(); - + dol_fiche_end(); } - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) @@ -1001,9 +1002,9 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print ''."\n"; - + print ''; if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder); @@ -1046,21 +1047,21 @@ if ($resql) // Filters lines print ''; // Ref - if (! empty($arrayfields['f.facnumber']['checked'])) + if (! empty($arrayfields['f.facnumber']['checked'])) { print ''; } // Ref customer - if (! empty($arrayfields['f.ref_client']['checked'])) + if (! empty($arrayfields['f.ref_client']['checked'])) { print ''; } // Date invoice - if (! empty($arrayfields['f.date']['checked'])) + if (! empty($arrayfields['f.date']['checked'])) { print ''; } // Date due - if (! empty($arrayfields['f.date_lim_reglement']['checked'])) + if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { print ''; } // Thirpdarty - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; } @@ -1109,7 +1110,7 @@ if ($resql) print ''; } // Payment mode - if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) + if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) { print ''; if (! empty($arrayfields['f.facnumber']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } - + // Customer ref if (! empty($arrayfields['f.ref_client']['checked'])) { @@ -1264,7 +1265,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Date if (! empty($arrayfields['f.date']['checked'])) { @@ -1273,7 +1274,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Date limit if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { @@ -1285,7 +1286,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Third party if (! empty($arrayfields['s.nom']['checked'])) { @@ -1339,7 +1340,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Payment mode if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) { @@ -1348,7 +1349,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { @@ -1389,7 +1390,7 @@ if ($resql) if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; $totalarray['totalrtp'] += $remaintopay; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -1431,12 +1432,12 @@ if ($resql) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print '"; - if (! $i) $totalarray['nbfield']++; + print '"; + if (! $i) $totalarray['nbfield']++; } - + // Action column print '' ; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; @@ -1471,20 +1472,20 @@ if ($resql) else print ''; } print ''; - + } } $db->free($resql); - + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print "
'; print ''; print ''; print ''; print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -1069,7 +1070,7 @@ if ($resql) print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -1079,7 +1080,7 @@ if ($resql) print ''; $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10); @@ -1222,21 +1223,21 @@ if ($resql) $totaldeposits = $facturestatic->getSumDepositsUsed(); $totalpay = $paiement + $totalcreditnotes + $totaldeposits; $remaintopay = $obj->total_ttc - $totalpay; - + print '
'; - + $notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1); print ''; - + print ''; - + print ''; print ''; print '
'; print $facturestatic->getNomUrl(1,'',200,0,$notetoshow); print $obj->increment; print ''; if (! empty($obj->note_private)) { @@ -1251,11 +1252,11 @@ if ($resql) print '
'; - + print "
'; - print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); - print "'; + print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); + print "'; $selected=0; @@ -1444,7 +1445,7 @@ if ($resql) print ''; print '
\n"; - + print "
\n"; - + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { /* @@ -1492,15 +1493,15 @@ if ($resql) */ $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire; - + print '
'; $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param); $title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").')'; - + print $formfile->showdocuments('massfilesarea_facture','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index cd14736632d..0785efe6b1a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -252,7 +252,7 @@ class BonPrelevement extends CommonObject function getErrorString($error) { global $langs; - + $errors = array(); $errors[1027] = $langs->trans("DateInvalid"); @@ -920,7 +920,7 @@ class BonPrelevement extends CommonObject $dir=$conf->prelevement->dir_output.'/receipts'; if (! is_dir($dir)) dol_mkdir($dir); - + $this->filename = $dir.'/'.$ref.'.xml'; // Create withdraw receipt in database @@ -1028,7 +1028,7 @@ class BonPrelevement extends CommonObject $this->emetteur_bic = $account->bic; $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; - + $this->raison_sociale = $account->proprio; } @@ -1272,18 +1272,6 @@ class BonPrelevement extends CommonObject * section Debiteur (sepa Debiteurs bloc lines) */ - $tmp_invoices = array(); - - $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; - $resql=$this->db->query($sql); - if ($resql) { - while ($objfac = $this->db->fetch_object($resql)) { - $tmp_invoices[] = $objfac->fac; - } - } - - $ListOfFactures = implode($tmp_invoices); - $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; @@ -1310,7 +1298,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); $this->total = $this->total + $obj->somme; $i++; } @@ -1581,11 +1569,11 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.strtoupper(dol_string_unaccent($row_nom)).''.$CrLf; + $XML_DEBITOR .=' '.strtoupper(dolEscapeXML(dol_string_unaccent($row_nom))).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - $XML_DEBITOR .=' '.dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))).''.$CrLf; - $XML_DEBITOR .=' '.dol_string_unaccent($row_zip.' '.$row_town).''.$CrLf; + $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))),70,'right','UTF-8',true)).''.$CrLf; + $XML_DEBITOR .=' '.dolEscapeXML(dol_string_unaccent($row_zip.' '.$row_town)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1680,7 +1668,7 @@ class BonPrelevement extends CommonObject * @return string String with SEPA Sender */ function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') - { + { // SEPA INITIALISATION global $conf; @@ -1699,12 +1687,12 @@ class BonPrelevement extends CommonObject $this->emetteur_number_key = $account->cle_rib; $this->emetteur_iban = $account->iban; $this->emetteur_bic = $account->bic; - + $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; - + $this->raison_sociale = $account->proprio; } - + // Récupération info demandeur $sql = "SELECT rowid, ref"; $sql.= " FROM"; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d9addfff113..9269d505664 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1599,8 +1599,8 @@ class Contrat extends CommonObject if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used { $contractline = new ContratLigne($this->db); - $contractline->array_options=$array_option; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->array_options=$array_options; + $contractline->id= $rowid; $result=$contractline->insertExtraFields(); if ($result < 0) { diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 63b765fbadb..99bf9b15a80 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,7 +39,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php $langs->load("main"); $langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 655e10afd67..f8b3a652e08 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -35,7 +35,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); require_once '../main.inc.php'; -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php $langs->load("main"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 562dcf9d223..03e2c6910cd 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2015 Juanjo Menent + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -407,7 +408,7 @@ function dol_get_next_week($day, $week, $month, $year) { $tmparray = dol_get_first_day_week($day, $month, $year); - $time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0); + $time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0); $time+=24*60*60*7; $tmparray=dol_getdate($time,true); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3ced09db552..c4674fbe5a0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -191,7 +191,7 @@ function getBrowserInfo($user_agent) elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; } elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; } - + if ($tablet) { $layout = 'tablet'; } elseif ($phone) { @@ -250,6 +250,9 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) case 'int': if (! is_numeric($out)) { $out=''; } break; + case 'intcomma': + if (preg_match('/[^0-9,]+/i',$out)) $out=''; + break; case 'alpha': $out=trim($out); // '"' is dangerous because param in url can close the href= or src= and add javascript functions. @@ -266,7 +269,7 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) break; case 'aZ09': $out=trim($out); - if (preg_match('/[^a-z0-9]+/i',$out)) $out=''; + if (preg_match('/[^a-z0-9_\-]+/i',$out)) $out=''; break; case 'array': if (! is_array($out) || empty($out)) $out=array(); @@ -287,13 +290,13 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) * This prefix is unique for instance and avoid conflict between multi-instances, * even when having two instances with one root dir or two instances in virtual servers * - * @param string $mode '' or 'email' + * @param string $mode '' or 'email' * @return string A calculated prefix */ function dol_getprefix($mode='') { global $conf; - + // If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) { @@ -375,15 +378,15 @@ function dol_buildpath($path, $type=0) if ($type == 1) $res = DOL_URL_ROOT.'/'.$path; // Standard value if ($type == 2) $res = DOL_MAIN_URL_ROOT.'/'.$path; // Standard value if ($type == 3) $res = DOL_URL_ROOT.'/'.$path; - + foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...) { - if ($key == 'main') + if ($key == 'main') { if ($type == 3) { global $dolibarr_main_url_root; - + // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -410,12 +413,12 @@ function dol_buildpath($path, $type=0) if ($type == 3) { global $dolibarr_main_url_root; - + // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax } break; @@ -954,7 +957,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5); if ($conf->browser->phone) $maxvisiblephotos=1; if ($showimage) $morehtmlleft.='
'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'
'; - else + else { if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) { $nophoto=''; @@ -964,17 +967,17 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $nophoto='/public/theme/common/nophoto.png'; $morehtmlleft.='
No photo
'; } - + } } - else + else { if ($showimage) $morehtmlleft.='
'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
'; } if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); - } + } elseif ($object->element == 'product') { //$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; @@ -996,7 +999,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // For thirdparty if (! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; // For product - if ($object->element != 'product') + if ($object->element != 'product') { $morehtmlref.='
'; $morehtmlref.=$object->getBannerAddress('refaddress',$object); @@ -1181,9 +1184,9 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e $reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','dayhour')))?1:0; $formatwithoutreduce = preg_replace('/reduceformat/','',$format); if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat=1; } // so format 'dayreduceformat' is processed like day - + // Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default. - // TODO Add format daysmallyear and dayhoursmallyear + // TODO Add format daysmallyear and dayhoursmallyear if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short); else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short); else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration); @@ -1954,7 +1957,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', print '
'.$langs->trans("NotEnoughDataYet").'
'; return; } - + if (empty($conf->use_javascript_ajax)) return; $jsgraphlib='flot'; $datacolor=array(); @@ -2123,7 +2126,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo global $conf; if ($size==0 || ! empty($conf->global->MAIN_DISABLE_TRUNC)) return $string; - + if (empty($stringencoding)) $stringencoding='UTF-8'; // reduce for small screen if ($conf->dol_optimize_smallscreen==1 && $display==1) $size = round($size/3); @@ -3073,7 +3076,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois * @param string $options parametres complementaires lien ('' par defaut) * @param string $sortfield champ de tri ('' par defaut) * @param string $sortorder ordre de tri ('' par defaut) - * @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction() + * @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction() * @param int $num number of records found by select with limit+1 * @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to no show number. * @param string $picto Icon to use before title (should be a 32x32 transparent png file) @@ -3087,11 +3090,11 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0) { global $conf,$langs; - + $savlimit = $limit; $savtotalnboflines = $totalnboflines; $totalnboflines=abs($totalnboflines); - + if ($picto == 'setup') $picto='title_setup.png'; if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif'; if ($limit < 0) $limit = $conf->liste_limit; @@ -3104,7 +3107,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $nextpage = 0; } //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; - + print "\n"; print "\n"; print ''; @@ -3203,7 +3206,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee //$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported //$pagesizechoices.=',2:2'; if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES; - + print ''; print ''; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index a0d873d4f5c..c0d89083325 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -258,7 +258,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP 5. // Defini objet langs $langs = new Translate('..',$conf); -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); else $langs->setDefaultLang('auto'); $bc[false]=' class="bg1"'; @@ -442,9 +442,9 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0) print '
'; if ($nonext == '2') { - print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'

'; + print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'

'; } - + print '"'; if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"'; print '>
'; diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index 2dc967e2546..8d3049bed51 100755 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -62,6 +62,21 @@ ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL; ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL; ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL; + +-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00'; + +-- Clean corrupted values for tms +-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; +-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL; +-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; +-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL; +-- Remove default not null on date_fin +-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL; +-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL; + +-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP; + + ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL; ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1; -- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible; @@ -189,9 +204,14 @@ CREATE TABLE llx_payment_salary ( fk_user_modif integer )ENGINE=innodb; + +DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock); + ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock); ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid); +DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet); + ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet); ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 86d2549a8bc..88ba07cc24b 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14 -- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50); + +-- Negative buying prices + +UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht) 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 8880f3fae97..7a2f1d075f6 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 @@ -545,4 +545,6 @@ 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 +ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; + +ALTER TABLE llx_user MODIFY COLUMN login varchar(50); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 6b3c5b83f6d..84d74fa52d9 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -33,7 +33,7 @@ create table llx_user tms timestamp, fk_user_creat integer, fk_user_modif integer, - login varchar(24) NOT NULL, + login varchar(50) NOT NULL, pass varchar(128), pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1a832990f38..34e548d397c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -567,7 +567,7 @@ if (! defined('NOLOGIN')) $paramsurl=array(); if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int'); - if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha'); + if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang', 'aZ09'); header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); exit; } @@ -626,7 +626,7 @@ if (! defined('NOLOGIN')) $paramsurl=array(); if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int'); - if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha'); + if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang', 'aZ09'); header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); exit; } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 80fc5d9a1d4..16c09207102 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -246,7 +246,7 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC')) // Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later) if (! defined('NOREQUIRETRAN')) { - $langcode=(GETPOST('lang')?GETPOST('lang','alpha',1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT)); + $langcode=(GETPOST('lang', 'aZ09')?GETPOST('lang', 'aZ09', 1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT)); $langs->setDefaultLang($langcode); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index e9eb3d41859..e8fd04ac818 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -141,7 +141,7 @@ if ($id > 0 || ! empty($ref)) elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; $sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -232,23 +232,24 @@ if ($id > 0 || ! empty($ref)) $var=True; while ($i < min($num,$conf->liste_limit)) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($result); + $invoicestatic->id=$objp->facid; + $invoicestatic->ref=$objp->facnumber; + $societestatic->fetch($objp->socid); + $paiement = $invoicestatic->getSommePaiement(); $var=!$var; print ''; print '\n"; - $societestatic->fetch($objp->socid); print ''; print "\n"; print '"; print '\n"; print '\n"; - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 9ed38461180..e2bfb502028 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -526,7 +526,8 @@ if (empty($reshook)) $error = 0; // Set if we used free entry or predefined product - $predef=''; + $predef=''; + $ref_fourn = GETPOST('fourn_ref'); $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); @@ -614,7 +615,7 @@ if (empty($reshook)) $price_base_type = $productsupplier->fourn_price_base_type; $type = $productsupplier->type; $label = $productsupplier->label; - $desc = $productsupplier->description; + $desc = $productsupplier->description; if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 8cbc3882fc4..6f973f4ce08 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2738,6 +2738,7 @@ class SupplierProposalLine extends CommonObject if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; + if (empty($this->subprice)) $this->subprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -2920,6 +2921,7 @@ class SupplierProposalLine extends CommonObject if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; + if (empty($this->subprice)) $this->subprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 36566b0d3f5..141dfd11f35 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -142,7 +142,7 @@ if (empty($conf->db->user)) $conf->db->user=''; // Defini objet langs $langs = new Translate('..',$conf); -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); else $langs->setDefaultLang('auto'); $bc[false]=' class="bg1"'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index fef5f3d1e64..c1f9ef1962b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -53,7 +53,7 @@ else header('Cache-Control: no-cache'); // On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); } -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'alpha')); // If language was forced on URL +if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL if (GETPOST('theme')) $conf->theme=GETPOST('theme', 'alpha'); // If theme was forced on URL $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); @@ -1101,7 +1101,7 @@ div.menu_titre { padding-top: 4px; padding-bottom: 4px; overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; } .mainmenuaspan { @@ -1488,7 +1488,7 @@ a.vsmenu.addbookmarkpicto { { /* border-bottom: 1px solid #BBB; */ } -div.blockvmenusearchphone +div.blockvmenusearchphone { border-bottom: none !important; } @@ -2681,7 +2681,7 @@ div.liste_titre_bydiv { border-top-width: px; border-top-color: rgb(); border-top-style: solid; - + border-collapse: collapse; display: table; padding: 2px 0px 2px 0; @@ -3288,7 +3288,7 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } -.websitebar .button, .websitebar .buttonDelete +.websitebar .button, .websitebar .buttonDelete { padding: 2px 5px 3px 5px !important; margin: 2px 4px 2px 4px !important; @@ -3297,7 +3297,7 @@ td.hidden { .websiteselection { display: inline-block; padding-left: 10px; - vertical-align: middle; + vertical-align: middle; line-height: 29px; } .websitetools { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 32c0604386c..ca04a8f6f0e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -54,7 +54,7 @@ else header('Cache-Control: no-cache'); // On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); } -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL +if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); @@ -520,7 +520,7 @@ div.divsearchfield { margin-: 2px; margin-top: 4px; margin-bottom: 4px; - padding-left: 2px; + padding-left: 2px; } div.confirmmessage { padding-top: 6px; @@ -545,8 +545,8 @@ div.myavailability { } .checkallactions { vertical-align: top; - margin-top: 6px; - margin-left: 4px; + margin-top: 6px; + margin-left: 4px; } .selectlimit { margin-right: 10px !important; @@ -713,7 +713,7 @@ td.showDragHandle { padding-left: 229px; padding-top: 12px; - + } .side-nav { @@ -919,7 +919,7 @@ table.noborder tr.liste_titre td { padding-right: 1px; padding-top: 1px; padding-bottom: 1px; - width: 44px; + width: 44px; } div.attacharea { padding-top: 10px; @@ -934,7 +934,7 @@ div.arearef { margin-bottom: 10px; } div.heightref { - min-height: 74px; + min-height: 74px; } div.divphotoref { padding-right: 20px; @@ -1131,7 +1131,7 @@ div.tmenucenter div.menu_titre { padding-bottom: 2px; overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; } .mainmenuaspan { @@ -1493,8 +1493,8 @@ div.vmenu, td.vmenu { width: 202px; } -.menu_contenu { - padding-top: 4px; +.menu_contenu { + padding-top: 4px; padding-bottom: 3px; overflow: hidden; text-overflow: ellipsis; @@ -2005,8 +2005,8 @@ span.tabspan { /* Boutons actions */ /* ============================================================================== */ -div.divButAction { - margin-bottom: 1.4em; +div.divButAction { + margin-bottom: 1.4em; vertical-align: top; } @@ -2072,16 +2072,16 @@ span.butAction, span.butActionDelete { text-shadow: none; border-color: #555; cursor: not-allowed; - + background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x + background-repeat: repeat-x } - + .butActionDelete, .buttonDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); @@ -2231,7 +2231,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-bottom-width: 1px; border-bottom-color: #BBB; border-bottom-style: solid; - + margin: 0px 0px 8px 0px; /* -moz-box-shadow: 2px 2px 4px #CCC; @@ -2239,7 +2239,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { box-shadow: 2px 2px 4px #CCC; */ /* box-shadow: 0 0 3px rgba(0,0,0,0.16); */ - + -moz-border-radius: 0.1em; -webkit-border-radius: 0.1em; border-radius: 0.1em; @@ -2495,7 +2495,7 @@ div.pagination li.paginationafterarrows { margin-bottom: 1px; color: #202020; min-height: 18px; /* seems to not be used */ - + background: #; } #GanttChartDIV { @@ -2562,7 +2562,7 @@ div.liste_titre_bydiv { border-top-width: px; border-top-color: rgb(); border-top-style: solid; - + box-shadow: none; border-collapse: collapse; display: table; @@ -2589,7 +2589,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list background: rgb(); font-weight: ; - + color: rgb(); font-family: ; border-bottom: 1px solid #FDFFFF; @@ -2745,7 +2745,7 @@ span.dashboardlineko { tr.box_titre { height: 26px !important; - + /* TO MATCH BOOTSTRAP */ /*background: #ddd; color: #000 !important; */ @@ -2760,7 +2760,7 @@ tr.box_titre { background: rgb(); - + background-repeat: repeat-x; color: rgb(); font-family: , sans-serif; @@ -3184,7 +3184,7 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } -.websitebar .button, .websitebar .buttonDelete +.websitebar .button, .websitebar .buttonDelete { padding: 2px 4px 2px 4px !important; margin: 2px 4px 2px 4px !important; @@ -3193,7 +3193,7 @@ td.hidden { .websiteselection { display: inline-block; padding-left: 10px; - vertical-align: middle; + vertical-align: middle; line-height: 29px; } .websitetools { @@ -4297,7 +4297,7 @@ img.demothumb { @media only screen and (max-width: 767px) { .imgopensurveywizard { width:95%; height: auto; } - + #tooltip { position: absolute; width: px; @@ -4375,7 +4375,7 @@ img.demothumb { div.mainmenu { min-width: 20px; } - + #tooltip { position: absolute; width: px; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 5d8f02e1c32..669152cb145 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -100,7 +100,7 @@ $arrayfields=array( // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } @@ -116,9 +116,9 @@ $search_gender=GETPOST('search_gender','alpha'); $search_employee=GETPOST('search_employee','alpha'); $search_accountancy_code=GETPOST('search_accountancy_code','alpha'); $search_email=GETPOST('search_email','alpha'); -$search_statut=GETPOST('search_statut','alpha'); +$search_statut=GETPOST('search_statut','intcomma'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); -$search_supervisor=GETPOST('search_supervisor','alpha'); +$search_supervisor=GETPOST('search_supervisor','intcomma'); $search_previousconn=GETPOST('search_previousconn','alpha'); $optioncss = GETPOST('optioncss','alpha'); @@ -131,7 +131,7 @@ if ($mode == 'employee') $search_employee=1; /* * Actions */ - + $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -196,8 +196,8 @@ else } if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; //if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); -if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; -if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); +if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$db->escape($search_supervisor); +if ($search_thirdparty != '') $sql.= natural_search(array('s.nom'), $search_thirdparty); if ($search_login != '') $sql.= natural_search("u.login", $search_login); if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); @@ -206,9 +206,9 @@ if (is_numeric($search_employee) && $search_employee >= 0) { $sql .= ' AND u.employee = '.(int) $search_employee; } if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); -if ($search_email != '') $sql.= natural_search("u.email", $search_email); -if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); +if ($search_email != '') $sql.= natural_search("u.email", $search_email); +if ($search_statut != '' && $search_statut >= 0) $sql.= " AND u.statut IN (".$db->escape($search_statut).")"; +if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -217,7 +217,7 @@ foreach ($search_array_options as $key => $val) $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -265,27 +265,27 @@ if ($result) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } - - + } + + print ''."\n"; if ($optioncss != '') print ''; print ''; print ''; print ''; print ''; - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $moreforfilter=''; - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; if (empty($user->rights->holiday->write_all)) { - print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print ''; + print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print ''; } - else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); + else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0); print '
'; - $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; print $invoicestatic->getNomUrl(1); print "'.$societestatic->getNomUrl(1).'".$objp->code_client."'; print dol_print_date($db->jdate($objp->datef),'day')."'.$objp->qty."'.price($objp->total_ht)."'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).'
'; print ''; if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); @@ -303,9 +303,9 @@ if ($result) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); @@ -340,7 +340,7 @@ if ($result) { print ''; } if (! empty($arrayfields['u.employee']['checked'])) @@ -380,9 +380,9 @@ if ($result) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); $typeofextrafield=$extrafields->attribute_type[$key]; @@ -428,7 +428,7 @@ if ($result) $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; print ''; - + print "\n"; $user2=new User($db); @@ -451,7 +451,7 @@ if ($result) $userstatic->lastname=$obj->lastname; $userstatic->employee=$obj->employee; $userstatic->photo=$obj->photo; - + $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); print ""; @@ -564,8 +564,8 @@ if ($result) } } print ''; - } - + } + // Date last login if (! empty($arrayfields['u.datelastlogin']['checked'])) { @@ -576,13 +576,13 @@ if ($result) { print ''; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { print 'getAlignFlag($key); diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php index f8624ebc040..98a5c4d51bc 100755 --- a/scripts/product/migrate_picture_path.php +++ b/scripts/product/migrate_picture_path.php @@ -104,7 +104,7 @@ function migrate_product_photospath($product) global $conf; $dir = $conf->product->multidir_output[$product->entity]; - $origin = $dir .'/'. get_exdir($product->id,2) . $product->id ."/photos"; + $origin = $dir .'/'. get_exdir($product->id,2,0,0,$product,'product') . $product->id ."/photos"; $destin = $dir.'/'.dol_sanitizeFileName($product->ref); $error = 0;
'; $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('search_gender', $arraygender, $search_gender, 1); + print $form->selectarray('search_gender', $arraygender, $search_gender, 1); print '
'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'