diff --git a/ChangeLog b/ChangeLog index 3b22da3209c..19e8c4058d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -129,7 +129,9 @@ WARNING: If you used external modules, some of them may need to be upgraded due ***** ChangeLog for 3.3.3 compared to 3.3.2 ***** - - Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php +- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php +- Fix: [ bug #934 ] Error on proformat invoice creation (pgsql) +- Fix: [ bug #947 ] Can't create proposal lines with unit price = 0 ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** - Fix: Dutch (nl_NL) translation diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index d8282914939..a205ab76538 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.5.0", "3.4.0", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.5.0", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 457a32ec4ce..940396718b9 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -68,7 +68,7 @@ print '
'; print '
'; //print '
'; print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home'); -if (count($conf->modules) <= 1) // If only user module enabled +if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->global->MAIN_MINNB_MODULE)) // If only user module enabled { $langs->load("errors"); $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 71302baf542..9946358d4e9 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -659,7 +659,8 @@ else if ($action == "addline" && $user->rights->propal->creer) setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); $error++; } - if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. + + if ((empty($idprod) || GETPOST('usenewaddlineform')) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 203dbe4be96..cf054a6cfc8 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -315,7 +315,7 @@ else if ($action == 'add' && $user->rights->commande->creer) } //Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals') ) // For avoid conflicts if trigger used { $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_option=$lines[$i]->array_options; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d8379a02a07..dcacf578843 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1008,12 +1008,12 @@ else if ($action == 'add' && $user->rights->facture->creer) $fk_parent_line = 0; } - //Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $lines[$i]->fetch_optionals($lines[$i]->rowid); - $array_option=$lines[$i]->array_options; - } + //Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals')) + { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option=$lines[$i]->array_options; + } $result = $object->addline( $id, diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ebfe0c4834b..3ae699709af 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -327,7 +327,7 @@ if ($modecompta == 'CREANCES-DETTES') { $var=!$var; print ""; - // Third party + // Product $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.''; @@ -339,23 +339,24 @@ if ($modecompta == 'CREANCES-DETTES') { // Amount w/o VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount_ht[$key]); + //print ''; print ''; // Amount with VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount[$key]); - print ''; + //print ''; print ''; // Percent; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8113d95a201..d0ed0b911eb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3497,7 +3497,7 @@ class Form // Year if ($empty || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d33f8546f8a..0d2e3163be6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -207,7 +207,7 @@ class FormFile return $this->getDocumentsLink($modulepart, $filename, $filedir); } $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; - + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; $var=true; @@ -450,14 +450,18 @@ class FormFile $langs->load("errors"); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; - $out.= $genbutton; $out.= ''; if ($printer) $out.= ''; - + if($hookmanager->hooks['formfile']) + { + foreach($hookmanager->hooks['formfile'] as $module) + { + if(method_exists($module, 'formBuilddocLineOptions')) $out .= ''; + } + } $out.= ''; // Execute hooks @@ -529,6 +533,7 @@ class FormFile $out.= ($param?'&'.$param:''); $out.= '">'.img_printer().''; } + if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); } $out.= ''; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index d8366a0135d..255b2c6e66f 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -56,15 +56,16 @@ class DoliDBPgsql //! >=1 if a transaction is opened, 0 otherwise var $transaction_opened; var $lastquery; - var $lastqueryerror; // Ajout d'une variable en cas d'erreur - + // Saved last error + var $lastqueryerror; + var $lasterror; + var $lasterrno; + var $unescapeslashquot=0; // By default we do not force the unescape of \'. This is used only to process sql with mysql escaped data. var $standard_conforming_strings=1; // Database has option standard_conforming_strings to on var $ok; var $error; - var $lasterror; - /** @@ -597,17 +598,17 @@ class DoliDBPgsql { if (! $ret) { - if ($this->errno() != 'DB_ERROR_25P02') + if ($this->errno() != 'DB_ERROR_25P02') // Do not overwrite errors if this is a consecutive error { $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); } - dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." = ".$this->errno(), LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_WARNING); //print "\n>> ".$query."
\n"; //print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n"; - if ($usesavepoint && $this->transaction_opened) + if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased { @pg_query($this->db, 'ROLLBACK TO SAVEPOINT mysavepoint'); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b2073ff314f..02cb6e663e2 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1236,16 +1236,19 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$ * @param string $modulepart Module of document * @param string $original_file Relative path with filename * @param string $entity Restrict onto entity + * @param User $fuser User object (forced) * @param string $refname Ref of object to check permission for external users (autodetect if not provided) * @return mixed Array with access information : accessallowed & sqlprotectagainstexternals & original_file (as full path name) */ -function dol_check_secure_access_document($modulepart,$original_file,$entity,$refname='') +function dol_check_secure_access_document($modulepart,$original_file,$entity,$fuser='',$refname='') { global $user, $conf, $db; + if (! is_object($fuser)) $fuser=$user; + if (empty($modulepart)) return 'ErrorBadParameter'; if (empty($entity)) $entity=0; - dol_syslog('$modulepart='.$modulepart.' $original_file= '.$original_file); + dol_syslog('modulepart='.$modulepart.' original_file= '.$original_file); // We define $accessallowed and $sqlprotectagainstexternals $accessallowed=0; $sqlprotectagainstexternals=''; @@ -1253,7 +1256,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // find the subdirectory name as the reference if (empty($refname)) $refname=basename(dirname($original_file)."/"); - + // Wrapping for some images if ($modulepart == 'companylogo') { @@ -1275,101 +1278,101 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les apercu factures elseif ($modulepart == 'apercufacture') { - if ($user->rights->facture->lire) $accessallowed=1; + if ($fuser->rights->facture->lire) $accessallowed=1; $original_file=$conf->facture->dir_output.'/'.$original_file; } // Wrapping pour les apercu propal elseif ($modulepart == 'apercupropal') { - if ($user->rights->propale->lire) $accessallowed=1; + if ($fuser->rights->propale->lire) $accessallowed=1; $original_file=$conf->propal->dir_output.'/'.$original_file; } // Wrapping pour les apercu commande elseif ($modulepart == 'apercucommande') { - if ($user->rights->commande->lire) $accessallowed=1; + if ($fuser->rights->commande->lire) $accessallowed=1; $original_file=$conf->commande->dir_output.'/'.$original_file; } // Wrapping pour les apercu intervention elseif ($modulepart == 'apercufichinter') { - if ($user->rights->ficheinter->lire) $accessallowed=1; + if ($fuser->rights->ficheinter->lire) $accessallowed=1; $original_file=$conf->ficheinter->dir_output.'/'.$original_file; } // Wrapping pour les images des stats propales elseif ($modulepart == 'propalstats') { - if ($user->rights->propale->lire) $accessallowed=1; + if ($fuser->rights->propale->lire) $accessallowed=1; $original_file=$conf->propal->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats commandes elseif ($modulepart == 'orderstats') { - if ($user->rights->commande->lire) $accessallowed=1; + if ($fuser->rights->commande->lire) $accessallowed=1; $original_file=$conf->commande->dir_temp.'/'.$original_file; } elseif ($modulepart == 'orderstatssupplier') { - if ($user->rights->fournisseur->commande->lire) $accessallowed=1; + if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1; $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file; } // Wrapping pour les images des stats factures elseif ($modulepart == 'billstats') { - if ($user->rights->facture->lire) $accessallowed=1; + if ($fuser->rights->facture->lire) $accessallowed=1; $original_file=$conf->facture->dir_temp.'/'.$original_file; } elseif ($modulepart == 'billstatssupplier') { - if ($user->rights->fournisseur->facture->lire) $accessallowed=1; + if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1; $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file; } // Wrapping pour les images des stats expeditions elseif ($modulepart == 'expeditionstats') { - if ($user->rights->expedition->lire) $accessallowed=1; + if ($fuser->rights->expedition->lire) $accessallowed=1; $original_file=$conf->expedition->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats expeditions elseif ($modulepart == 'tripsexpensesstats') { - if ($user->rights->deplacement->lire) $accessallowed=1; + if ($fuser->rights->deplacement->lire) $accessallowed=1; $original_file=$conf->deplacement->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats expeditions elseif ($modulepart == 'memberstats') { - if ($user->rights->adherent->lire) $accessallowed=1; + if ($fuser->rights->adherent->lire) $accessallowed=1; $original_file=$conf->adherent->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats produits elseif (preg_match('/^productstats_/i',$modulepart)) { - if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1; + if ($fuser->rights->produit->lire || $fuser->rights->service->lire) $accessallowed=1; $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file; } // Wrapping for products or services elseif ($modulepart == 'tax') { - if ($user->rights->tax->charges->lire) $accessallowed=1; + if ($fuser->rights->tax->charges->lire) $accessallowed=1; $original_file=$conf->tax->dir_output.'/'.$original_file; } // Wrapping for products or services elseif ($modulepart == 'actions') { - if ($user->rights->agenda->myactions->read) $accessallowed=1; + if ($fuser->rights->agenda->myactions->read) $accessallowed=1; $original_file=$conf->agenda->dir_output.'/'.$original_file; } // Wrapping for categories elseif ($modulepart == 'category') { - if ($user->rights->categorie->lire) $accessallowed=1; + if ($fuser->rights->categorie->lire) $accessallowed=1; $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file; } // Wrapping pour les prelevements elseif ($modulepart == 'prelevement') { - if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1412,7 +1415,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re elseif ($modulepart == 'scanner_user_temp') { $accessallowed=1; - $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; + $original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file; } // Wrapping pour les images fckeditor elseif ($modulepart == 'fckeditor') @@ -1424,7 +1427,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping for third parties else if ($modulepart == 'company' || $modulepart == 'societe') { - if ($user->rights->societe->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->societe->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1435,7 +1438,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping for invoices else if ($modulepart == 'facture' || $modulepart == 'invoice') { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1445,7 +1448,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re else if ($modulepart == 'unpaid') { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1455,7 +1458,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les fiches intervention else if ($modulepart == 'ficheinter') { - if ($user->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1466,7 +1469,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les deplacements et notes de frais else if ($modulepart == 'deplacement') { - if ($user->rights->deplacement->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->deplacement->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1476,7 +1479,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les propales else if ($modulepart == 'propal') { - if ($user->rights->propale->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->propale->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1488,7 +1491,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les commandes else if ($modulepart == 'commande' || $modulepart == 'order') { - if ($user->rights->commande->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1499,7 +1502,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les projets else if ($modulepart == 'project') { - if ($user->rights->projet->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1510,7 +1513,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les commandes fournisseurs else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') { - if ($user->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1521,7 +1524,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les factures fournisseurs else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') { - if ($user->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1532,18 +1535,18 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les rapport de paiements else if ($modulepart == 'facture_paiement') { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } - if ($user->societe_id > 0) $original_file=$conf->facture->dir_output.'/payments/private/'.$user->id.'/'.$original_file; + if ($fuser->societe_id > 0) $original_file=$conf->facture->dir_output.'/payments/private/'.$fuser->id.'/'.$original_file; else $original_file=$conf->facture->dir_output.'/payments/'.$original_file; } // Wrapping pour les exports de compta else if ($modulepart == 'export_compta') { - if ($user->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1553,7 +1556,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les expedition else if ($modulepart == 'expedition') { - if ($user->rights->expedition->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->expedition->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1563,7 +1566,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les bons de livraison else if ($modulepart == 'livraison') { - if ($user->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1573,7 +1576,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les actions else if ($modulepart == 'actions') { - if ($user->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1583,7 +1586,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les actions else if ($modulepart == 'actionsreport') { - if ($user->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1593,7 +1596,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les produits et services else if ($modulepart == 'product' || $modulepart == 'produit' || $modulepart == 'service') { - if (($user->rights->produit->lire || $user->rights->service->lire) || preg_match('/^specimen/i',$original_file)) + if (($fuser->rights->produit->lire || $fuser->rights->service->lire) || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1604,7 +1607,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les contrats else if ($modulepart == 'contract') { - if ($user->rights->contrat->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->contrat->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1614,7 +1617,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les dons else if ($modulepart == 'donation') { - if ($user->rights->don->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->don->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1624,7 +1627,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les remises de cheques else if ($modulepart == 'remisecheque') { - if ($user->rights->banque->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->banque->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1638,7 +1641,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Aucun test necessaire car on force le rep de download sur // le rep export qui est propre a l'utilisateur $accessallowed=1; - $original_file=$conf->export->dir_temp.'/'.$user->id.'/'.$original_file; + $original_file=$conf->export->dir_temp.'/'.$fuser->id.'/'.$original_file; } // Wrapping for import module @@ -1662,7 +1665,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour les backups else if ($modulepart == 'systemtools') { - if ($user->admin) + if ($fuser->admin) { $accessallowed=1; } @@ -1672,7 +1675,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping for upload file test else if ($modulepart == 'admin_temp') { - if ($user->admin) + if ($fuser->admin) $accessallowed=1; $original_file=$conf->admin->dir_temp.'/'.$original_file; } @@ -1689,7 +1692,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Wrapping pour Foundation module else if ($modulepart == 'member') { - if ($user->rights->adherent->lire || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->adherent->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } @@ -1700,7 +1703,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re else if ($modulepart == 'scanner_user_temp') { $accessallowed=1; - $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; + $original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file; } // GENERIC Wrapping @@ -1713,18 +1716,18 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re // Define $accessallowed if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file; + if ($fuser->rights->$reg[1]->lire || $fuser->rights->$reg[1]->read || ($fuser->rights->$reg[1]->download)) $accessallowed=1; + $original_file=$conf->$reg[1]->dir_temp.'/'.$fuser->id.'/'.$original_file; } else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg)) { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; + if ($fuser->rights->$reg[1]->lire || $fuser->rights->$reg[1]->read || ($fuser->rights->$reg[1]->download)) $accessallowed=1; $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file; } else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg)) { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file; + if ($fuser->rights->$reg[1]->lire || $fuser->rights->$reg[1]->read || ($fuser->rights->$reg[1]->download)) $accessallowed=1; + $original_file=$conf->$reg[1]->dir_output.'/'.$fuser->id.'/'.$original_file; } else { @@ -1732,24 +1735,24 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re $subperm=GETPOST('subperm'); if ($perm || $subperm) { - if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1; + if (($perm && ! $subperm && $fuser->rights->$modulepart->$perm) || ($perm && $subperm && $fuser->rights->$modulepart->$perm->$subperm)) $accessallowed=1; $original_file=$conf->$modulepart->dir_output.'/'.$original_file; } else { - if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1; + if ($fuser->rights->$modulepart->lire || $fuser->rights->$modulepart->read) $accessallowed=1; $original_file=$conf->$modulepart->dir_output.'/'.$original_file; } } if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen - if ($user->admin) $accessallowed=1; // If user is admin + if ($fuser->admin) $accessallowed=1; // If user is admin // For modules who wants to manage different levels of permissions for documents $subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS'; if (! empty($conf->global->$subPermCategoryConstName)) { $subPermCategory = $conf->global->$subPermCategoryConstName; - if (! empty($subPermCategory) && (($user->rights->$modulepart->$subPermCategory->lire) || ($user->rights->$modulepart->$subPermCategory->read) || ($user->rights->$modulepart->$subPermCategory->download))) + if (! empty($subPermCategory) && (($fuser->rights->$modulepart->$subPermCategory->lire) || ($fuser->rights->$modulepart->$subPermCategory->read) || ($fuser->rights->$modulepart->$subPermCategory->download))) { $accessallowed=1; } @@ -1763,7 +1766,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re eval('$sqlprotectagainstexternals = "'.$conf->global->$sqlProtectConstName.'";'); } } - + $ret = array( 'accessallowed' => $accessallowed, 'sqlprotectagainstexternals'=>$sqlprotectagainstexternals, diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 32010ceb0de..e5ea867d0a7 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -53,7 +53,7 @@ function project_prepare_head($object) || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id; - $head[$h][1] = $langs->trans("Referers"); + $head[$h][1] = $langs->trans("ProjectReferers"); $head[$h][2] = 'element'; $h++; } @@ -644,4 +644,4 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0) print ""; } -?> \ No newline at end of file +?> diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ceaa41b404c..fa0e48556c8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -198,6 +198,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -- Check deposit diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index faccc410219..2f870665bf2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -523,7 +523,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add('/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoPHP'), 1); //if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', $langs->trans('XDebug'),1); $newmenu->add('/admin/system/database.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoDatabase'), 1); - $newmenu->add("/admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools", $langs->trans("Backup"),1); $newmenu->add("/admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools", $langs->trans("Restore"),1); $newmenu->add("/admin/tools/update.php?mainmenu=home&leftmenu=admintools", $langs->trans("MenuUpgrade"),1); @@ -534,6 +533,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('About'), 1); $newmenu->add("/support/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("HelpCenter"),1,1,'targethelp'); } + // Modules system tools if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS)) { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 541de648360..6e623d183d2 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -893,11 +893,12 @@ abstract class DolibarrModules if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS") { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::insert_permissions error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert_permissions errno = ".$this->db->errno()." error ".$this->error, LOG_ERR); $err++; break; } else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); + } $this->db->free($resqlinsert); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d3611f2bea8..dbc7cdd8c9f 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -55,7 +55,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $langs->load("companies"); $this->db = $db; - $this->name = "ODT templates"; + $this->name = "ODT/ODS templates"; $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'FACTURE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan @@ -114,6 +114,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures 'object_source_invoice_ref'=>$invoice_source->ref, 'object_hour'=>dol_print_date($object->date,'hour'), 'object_date'=>dol_print_date($object->date,'day'), + 'object_date_rfc'=>dol_print_date($object->date,'dayrfc'), 'object_date_limit'=>dol_print_date($object->date_lim_reglement,'day'), 'object_date_creation'=>dol_print_date($object->date_creation,'day'), 'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''), @@ -220,7 +221,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } diff --git a/htdocs/document.php b/htdocs/document.php index 15ac9d0d9ca..9815bbdd7e6 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -178,4 +178,4 @@ header('Pragma: public'); readfile($original_file_osencoded); -?> +if (is_object($db)) $db->close(); diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index b7a12f34262..e1285d52c1a 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob DROP table llx_adherent_options; DROP table llx_adherent_options_label; - +ALTER TABLE llx_user ADD accountancy_code VARCHAR( 24 ) NULL; diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index ae7fddc28be..6c83994a936 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -1,51 +1,51 @@ --- =================================================================== --- Copyright (C) 2013 Laurent Destailleur --- Copyright (C) 2013 Florian Henry --- --- 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 --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - - -CREATE TABLE llx_cronjob -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - datec datetime, - jobtype varchar(10) NOT NULL, - label text NOT NULL, - command varchar(255), - classesname varchar(255), - objectname varchar(255), - methodename varchar(255), - params text NOT NULL, - md5params varchar(32), - module_name varchar(255), - priority integer DEFAULT 0, - datelastrun datetime, - datenextrun datetime, - datestart datetime, - dateend datetime, - datelastresult datetime, - lastresult text, - lastoutput text, - unitfrequency integer NOT NULL DEFAULT 0, - frequency integer NOT NULL DEFAULT 0, - nbrun integer, - status integer NOT NULL DEFAULT 1, - fk_user_author integer DEFAULT NULL, - fk_user_mod integer DEFAULT NULL, - note text - +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- Copyright (C) 2013 Florian Henry +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text + )ENGINE=innodb; \ 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 6042b0906ce..9fd1db59c91 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -62,5 +62,6 @@ create table llx_user statut tinyint DEFAULT 1, photo varchar(255), -- filename or url of photo lang varchar(6), - color varchar(6) + color varchar(6), + accountancy_code varchar(24) NULL )ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1646c7f271e..90c7489089e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -313,7 +313,7 @@ LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory ExamplesWithCurrentSetup=Examples with current running setup ListOfDirectories=List of OpenDocument templates directories ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

Put here full path of directories.
Add a carriage return between eah directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt. -NumberOfModelFilesFound=Number of ODT templates files found in those directories +NumberOfModelFilesFound=Number of ODT/ODS templates files found in those directories ExampleOfDirectoriesForModelGen=Examples of syntax:
c:\mydir
/home/mydir
DOL_DATA_ROOT/ecm/ecmdir FollowingSubstitutionKeysCanBeUsed=
To know how to create your odt document templates, before storing them in those directories, read wiki documentation: FullListOnOnlineDocumentation=http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template @@ -1002,7 +1002,7 @@ ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The cod UseNotifications=Use notifications NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events, to third parties (customers or suppliers) that are configured to. Choice of active notification and targets contacts is made one third party at time. ModelModules=Documents templates -DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for OpenOffice, KOffice, TextEdit,...) +DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT or .ODS files for OpenOffice, KOffice, TextEdit,...) WatermarkOnDraft=Watermark on draft document CompanyIdProfChecker=Rules on Professional Ids MustBeUnique=Must be unique ? diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index a7dacc49a74..8c4624fb057 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -106,4 +106,5 @@ TypeContact_project_task_external_CONTRIBUTOR=Contributor # Documents models DocumentModelBaleine=A complete project's report model (logo...) PlannedWorkload = Planned workload -WorkloadOccupation= Workload affectation \ No newline at end of file +WorkloadOccupation= Workload affectation +ProjectReferers=Refering objects diff --git a/htdocs/langs/es_ES/categories.lang b/htdocs/langs/es_ES/categories.lang index 217eb80ae64..65c55bced65 100644 --- a/htdocs/langs/es_ES/categories.lang +++ b/htdocs/langs/es_ES/categories.lang @@ -42,7 +42,7 @@ ErrCatAlreadyExists=Este nombre esta siendo utilizado AddProductToCat=¿Añadir este producto a una categoría? ImpossibleAddCat=Imposible añadir la categoría ImpossibleAssociateCategory=Imposible asociar la categoría -WasAddedSuccessfully=se ha añadido con éxito. +WasAddedSuccessfully=La categoría se ha añadido con éxito. ObjectAlreadyLinkedToCategory=El elemento ya está enlazado a esta categoría CategorySuccessfullyCreated=La categoría %s se insertado correctamente. ProductIsInCategories=Este producto/servicio se encuentra en las siguientes categorías @@ -97,4 +97,4 @@ CatMemberList=Listado categorías de miembros CatSupLinks=Proveedores CatCusLinks=Clientes/Clientes potenciales CatProdLinks=Productos -CatMemberLinks=Miembros \ No newline at end of file +CatMemberLinks=Miembros diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ef98c76c657..f3b134eec83 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -314,7 +314,7 @@ LanguageFilesCachedIntoShmopSharedMemory=Fichiers .lang en mémoire partagée ExamplesWithCurrentSetup=Exemples avec le paramétrage actif courant ListOfDirectories=Liste des répertoires des modèles OpenDocument ListOfDirectoriesForModelGenODT=Liste des répertoires contenant des documents modèles OpenDocument.

Indiquer les chemins complets de répertoire.
Ajouter un retour à la ligne entre chaque répertoire.
Pour indiquer un répertoire du module GED, indiquer
DOL_DATA_ROOT/ecm/nomdurepertoireged

Les fichiers modèles dans ces répertoires doivent se terminer par .odt. -NumberOfModelFilesFound=Nombre de fichiers modèles ODT trouvés dans ce(s) répertoire(s) +NumberOfModelFilesFound=Nombre de fichiers modèles ODT/ODS trouvés dans ce(s) répertoire(s) ExampleOfDirectoriesForModelGen=Exemple de syntaxe :
c:\\mydir
/home/mydir
DOL_DATA_ROOT/ecm/ecmdir FollowingSubstitutionKeysCanBeUsed=
Pour savoir comment rédiger des modèles de document odt avant de les placer dans un de ces répertoires, consulter la documentation du wiki : FullListOnOnlineDocumentation=http://wiki.dolibarr.org/index.php/Créer_un_modèle_de_document_ODT @@ -1004,7 +1004,7 @@ ModuleCompanyCodeDigitaria=Renvoie un code comptable composé suivant le code ti UseNotifications=Utiliser les notifications NotificationsDesc=La fonction des notifications par emails permet d'envoyer automatiquement un email, pour certains événements Dolibarr, aux tiers (sociétés clients, prospects ou fournisseurs) configurés pour. Le choix des notifications et contacts destinataires se fait tiers par tiers. ModelModules=Modèle de documents -DocumentModelOdt=Génération depuis des modèles OpenDocument (Fichier .ODT OpenOffice, KOffice, TextEdit…) +DocumentModelOdt=Génération depuis des modèles OpenDocument (Fichier .ODT ou .ODS OpenOffice, KOffice, TextEdit…) WatermarkOnDraft=Filigrane sur les documents brouillons CompanyIdProfChecker=Règles sur les Identifiants professionnels MustBeUnique=Doit être unique ? diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index a38efe47d22..6cec42521be 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -108,4 +108,5 @@ DocumentModelBaleine=Modèle de rapport de projet complet (logo...) SelectElement=Eléments associable au projet : AddElement=Associer PlannedWorkload = Charge de travail prévue -WorkloadOccupation= Pourcentage affectation \ No newline at end of file +WorkloadOccupation= Pourcentage affectation +ProjectReferers=Objets associés diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index c55574d363a..0871aaf71e0 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -61,8 +61,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_KO",GETPOST('PAYBOX_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_PAYONLINE_SENDEMAIL",GETPOST('PAYBOX_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYBOX_PAYONLINE_SENDEMAIL",GETPOST('PAYBOX_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; if (! $error) { @@ -93,12 +93,12 @@ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'setup'); -$h = 0; -$head = array(); - -$head[$h][0] = DOL_URL_ROOT."/paybox/admin/paybox.php"; -$head[$h][1] = $langs->trans("Account"); -$head[$h][2] = 'payboxaccount'; +$h = 0; +$head = array(); + +$head[$h][0] = DOL_URL_ROOT."/paybox/admin/paybox.php"; +$head[$h][1] = $langs->trans("Account"); +$head[$h][2] = 'payboxaccount'; $h++; dol_fiche_head($head, 'payboxaccount', ''); @@ -198,17 +198,17 @@ $doleditor=new DolEditor('PAYBOX_MESSAGE_KO',$conf->global->PAYBOX_MESSAGE_KO,'' $doleditor->Create(); print ''; -$var=!$var; -print ''; -print $langs->trans("PAYBOX_PAYONLINE_SENDEMAIL").''; -print ''; -print '   '.$langs->trans("Example").': myemail@myserver.com'; -print ''; +$var=!$var; +print ''; +print $langs->trans("PAYBOX_PAYONLINE_SENDEMAIL").''; +print ''; +print '   '.$langs->trans("Example").': myemail@myserver.com'; +print ''; print '
'; print ''; -dol_fiche_end(); +dol_fiche_end(); print '

'; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 998f724dc68..c91e2ff0c80 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -67,8 +67,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",GETPOST('PAYPAL_MESSAGE_KO'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_PAYONLINE_SENDEMAIL",GETPOST('PAYPAL_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYPAL_PAYONLINE_SENDEMAIL",GETPOST('PAYPAL_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; if (! $error) { @@ -203,12 +203,12 @@ $doleditor=new DolEditor('PAYPAL_MESSAGE_KO',$conf->global->PAYPAL_MESSAGE_KO,'' $doleditor->Create(); print ''; -$var=!$var; -print ''; -print $langs->trans("PAYPAL_PAYONLINE_SENDEMAIL").''; +$var=!$var; +print ''; +print $langs->trans("PAYPAL_PAYONLINE_SENDEMAIL").''; print ''; print '   '.$langs->trans("Example").': myemail@myserver.com'; -print ''; +print ''; $var=true; print ''; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 8253c98860d..97b18be18d3 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -226,6 +226,7 @@ if ($search_all) $sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_all)."%'"; $sql.= ")"; } if ($search_nom) @@ -235,6 +236,7 @@ if ($search_nom) $sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_nom)."%'"; $sql.= ")"; } if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'"; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index b81ae3a090e..0428b87081c 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -256,6 +256,10 @@ input:-webkit-autofill { background-image:none !important; -webkit-box-shadow: 0 0 0 50px inset; } +::-webkit-input-placeholder { color:#ccc; } +::-moz-placeholder { color:#ccc; } /* firefox 19+ */ +:-ms-input-placeholder { color:#ccc; } /* ie */ +input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } @@ -2150,12 +2154,16 @@ div.ui-radio { display: inline-block; } -.ui-radio input { +.ui-checkbox input, .ui-radio input { height: auto; width: auto; - margin: 0; + margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 51ce8347492..fd859c014dd 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -148,6 +148,10 @@ input:-webkit-autofill { background-image:none !important; -webkit-box-shadow: 0 0 0 50px inset; } +::-webkit-input-placeholder { color:#ccc; } +::-moz-placeholder { color:#ccc; } /* firefox 19+ */ +:-ms-input-placeholder { color:#ccc; } /* ie */ +input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } @@ -2283,12 +2287,16 @@ div.ui-radio { display: inline-block; } -.ui-radio input { +.ui-checkbox input, .ui-radio input { height: auto; width: auto; - margin: 0; + margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 3984389566c..abd072e9292 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -176,6 +176,10 @@ input.button[type=submit] { font-size: 10px; display: inline; } +::-webkit-input-placeholder { color:#ccc; } +::-moz-placeholder { color:#ccc; } /* firefox 19+ */ +:-ms-input-placeholder { color:#ccc; } /* ie */ +input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } @@ -2493,12 +2497,16 @@ div.ui-radio { display: inline-block; } -.ui-radio input { +.ui-checkbox input, .ui-radio input { height: auto; width: auto; - margin: 0; + margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index d2074ed79e1..fe214708ee3 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -154,6 +154,10 @@ input.button[type=submit] { font-size: 11px; font-weight: bold; } +::-webkit-input-placeholder { color:#ccc; } +::-moz-placeholder { color:#ccc; } /* firefox 19+ */ +:-ms-input-placeholder { color:#ccc; } /* ie */ +input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } @@ -2384,12 +2388,16 @@ div.ui-radio { display: inline-block; } -.ui-radio input { +.ui-checkbox input, .ui-radio input { height: auto; width: auto; - margin: 0; + margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3bc5c179d2e..7352c2bf407 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -285,6 +285,10 @@ input:-webkit-autofill { background-image:none !important; -webkit-box-shadow: 0 0 0 50px inset; } +::-webkit-input-placeholder { color:#ccc; } +::-moz-placeholder { color:#ccc; } /* firefox 19+ */ +:-ms-input-placeholder { color:#ccc; } /* ie */ +input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } @@ -1571,7 +1575,7 @@ span.butAction, span.butActionDelete { } -table.border { +table.border, table.dataTable { border: 1px solid #9CACBB; border-collapse: collapse; } @@ -1687,11 +1691,11 @@ table.liste td { .tagtr { display: table-row; } .tagtd { display: table-cell; } -tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel +tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr { height: 20px !important; } -div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel +div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr { background: rgb(); background-repeat: repeat-x; @@ -2703,16 +2707,20 @@ a.ui-link { background: #fff; } -div.ui-radio +div.ui-radio, div.ui-checkbox { display: inline-block; + border-bottom: 0px !important; } -.ui-radio input { +.ui-checkbox input, .ui-radio input { height: auto; width: auto; - margin: 0; + margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a98e5c5dbd8..39fc2132042 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -96,6 +96,8 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. + + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module /** @@ -149,6 +151,7 @@ class User extends CommonObject $sql.= " u.datepreviouslogin as datep,"; $sql.= " u.photo as photo,"; $sql.= " u.openid as openid,"; + $sql.= " u.accountancy_code,"; $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -209,6 +212,7 @@ class User extends CommonObject $this->openid = $obj->openid; $this->lang = $obj->lang; $this->entity = $obj->entity; + $this->accountancy_code = $obj->accountancy_code; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -1114,6 +1118,7 @@ class User extends CommonObject $this->address = empty($this->address)?'':$this->address; $this->zip = empty($this->zip)?'':$this->zip; $this->town = empty($this->town)?'':$this->town; + $this->accountancy_code = trim($this->accountancy_code); // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1142,6 +1147,7 @@ class User extends CommonObject $sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; + $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 53de51df268..66cb62ef362 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -188,6 +188,7 @@ if ($action == 'add' && $canadduser) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->note = GETPOST("note"); $object->ldap_sid = GETPOST("ldap_sid"); @@ -324,6 +325,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->openid = GETPOST("openid"); $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; @@ -1192,6 +1194,10 @@ else } print ''; print "\n"; + + // Accountancy code + print ''.$langs->trans("AccountancyCode").''; + print ''.$object->accountancy_code.''; // Status print ''.$langs->trans("Status").''; @@ -1821,6 +1827,21 @@ else } print ''; print "\n"; + + // Accountancy code + print ""; + print ''.$langs->trans("AccountancyCode").''; + print ''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print ''; // Status print ''.$langs->trans("Status").''; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 200986dd08a..4a9e7538faa 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -198,4 +198,3 @@ else // Open and return file if (is_object($db)) $db->close(); -?> diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 7b770823289..81a15e5b771 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -175,7 +175,7 @@ function getVersions($authentication) /** * Method to get a document by webservice - * + * * @param array $authentication Array with permissions * @param string $modulepart Properties of document * @param string $file Relative path @@ -224,7 +224,7 @@ function getDocument($authentication, $modulepart, $file, $refname='') if (empty($refname)) $refname=basename(dirname($original_file)."/"); // Security check - $check_access = dol_check_secure_access_document($modulepart,$original_file,$conf->entity,$refname); + $check_access = dol_check_secure_access_document($modulepart,$original_file,$conf->entity,$refname,$fuser); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $original_file = $check_access['original_file']; @@ -323,4 +323,4 @@ function getDocument($authentication, $modulepart, $file, $refname='') // Return the results. $server->service($HTTP_RAW_POST_DATA); -?> \ No newline at end of file +?>