Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/core/modules/DolibarrModules.class.php
This commit is contained in:
Laurent Destailleur 2015-02-18 22:04:26 +01:00
commit b6947dbe2c
17 changed files with 82 additions and 48 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* *
@ -430,6 +430,5 @@ print '</form>';
print "<br>"; print "<br>";
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("members"); $langs->load("members");
$langs->load("errors"); $langs->load("errors");
$langs->load("other");
// Choice of print year or current year. // Choice of print year or current year.
$now = dol_now(); $now = dol_now();
@ -229,7 +230,7 @@ if ($conf->societe->enabled)
} }
else dol_print_error($db); else dol_print_error($db);
print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("Thirdparties")).'<br>'."\n"; print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("ThirdParties")).'<br>'."\n";
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled="checked" ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"'; print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled="checked" ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled="disabled"'; print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled="disabled"';
@ -251,10 +252,10 @@ if ($conf->product->enabled || $conf->product->service)
$nbno=$nbtotal=0; $nbno=$nbtotal=0;
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','').'<br>'."\n"; print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','').'<br>'."\n";
$sql ="SELECT count(rowid) as nb, fk_product_type"; $sql ="SELECT count(rowid) as nb, fk_product_type, datec";
$sql.=" FROM ".MAIN_DB_PREFIX."product"; $sql.=" FROM ".MAIN_DB_PREFIX."product";
$sql.=" WHERE barcode IS NULL OR barcode = ''"; $sql.=" WHERE barcode IS NULL OR barcode = ''";
$sql.=" GROUP BY fk_product_type"; $sql.=" GROUP BY fk_product_type, datec";
$sql.=" ORDER BY datec"; $sql.=" ORDER BY datec";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@ -221,5 +221,5 @@ if ($id > 0 || ! empty($ref))
} }
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -217,8 +217,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
// Tools // Tools
$tmpentry=array('enabled'=>(! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled)), $tmpentry=array('enabled'=>(! empty($conf->barcode->enabled) || ! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled)),
'perms'=>(! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read)), 'perms'=>(! empty($conf->barcode->enabled) || ! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read)),
'module'=>'mailing|export|import|opensurvey'); 'module'=>'mailing|export|import|opensurvey');
$showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode) if ($showmode)

View File

@ -192,8 +192,10 @@ abstract class DolibarrModules
* Enables a module. * Enables a module.
* Inserts all informations into database * Inserts all informations into database
* *
* @param string[]|array $array_sql SQL requests to be executed when enabling module * @param array $array_sql SQL requests to be executed when enabling module
* @param string $options String with options when disabling module ('newboxdefonly|noboxes') * @param string $options String with options when disabling module:
* 'noboxes' = Do not insert boxes
* 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation
* *
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */
@ -279,7 +281,8 @@ abstract class DolibarrModules
* Disable function. Deletes the module constant and boxes from the database. * Disable function. Deletes the module constant and boxes from the database.
* *
* @param string[] $array_sql SQL requests to be executed when module is disabled * @param string[] $array_sql SQL requests to be executed when module is disabled
* @param string $options Options when disabling module ('newboxdefonly|noboxes') * @param string $options Options when disabling module:
* 'newboxdefonly|noboxes' = We don't remove boxes.
* *
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */

View File

@ -200,7 +200,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$hookmanager->initHooks(array('pdfgeneration')); $hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action; global $action;
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$nblignes = count($object->lines); $nblignes = count($object->lines);
@ -1018,7 +1018,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
} }
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
if (! empty($object->date_livraison)) $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R'); $usehourmin='day';
if ( empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
if (! empty($object->date_livraison)) $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,$usehourmin,false,$outputlangs,true), '', 'R');
$posy+=5; $posy+=5;
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);

View File

@ -227,7 +227,7 @@ llxHeader('',$langs->trans("CronAdd"));
if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute')
{ {
$head=cron_prepare_head($object); $head=cron_prepare_head($object);
print dol_get_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill'); print dol_get_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'cron');
} }
elseif ($action=='create') elseif ($action=='create')
{ {

View File

@ -46,7 +46,7 @@ $object->info($id);
$head = cron_prepare_head($object); $head = cron_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("CronTask"), 0, 'bill'); dol_fiche_head($head, 'info', $langs->trans("CronTask"), 0, 'cron');
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($object); dol_print_object_info($object);

View File

@ -1635,9 +1635,9 @@ class CommandeFournisseur extends CommonOrder
/** /**
* Set the planned delivery date * Set the planned delivery date
* *
* @param User $user Objet utilisateur qui modifie * @param User $user Objet user making change
* @param timestamp $date_livraison Date de livraison * @param timestamp $date_livraison Planned delivery date
* @return int <0 si ko, >0 si ok * @return int <0 if KO, >0 if OK
*/ */
function set_date_livraison($user, $date_livraison) function set_date_livraison($user, $date_livraison)
{ {

View File

@ -144,7 +144,7 @@ if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
// date de livraison // date de livraison
if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer)
{ {
$datelivraison=dol_mktime(0, 0, 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int')); $datelivraison=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), GETPOST('liv_sec','int'), GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
$result=$object->set_date_livraison($user,$datelivraison); $result=$object->set_date_livraison($user,$datelivraison);
if ($result < 0) if ($result < 0)
@ -1591,13 +1591,17 @@ elseif (! empty($object->id))
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdate_livraison">';
$form->select_date($object->date_livraison?$object->date_livraison:-1,'liv_','','','',"setdate_livraison"); $usehourmin=0;
if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin=1;
$form->select_date($object->date_livraison?$object->date_livraison:-1,'liv_',$usehourmin,$usehourmin,'',"setdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
else else
{ {
print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : '&nbsp;'; $usehourmin='day';
if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : '&nbsp;';
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -210,6 +210,8 @@ ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_product (fk_produc
DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product); DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product);
ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_account integer AFTER date_livraison; ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_account integer AFTER date_livraison;
ALTER TABLE llx_facture_fourn ADD COLUMN fk_account integer AFTER fk_projet; ALTER TABLE llx_facture_fourn ADD COLUMN fk_account integer AFTER fk_projet;

View File

@ -55,7 +55,7 @@ create table llx_commande_fournisseur
note_public text, note_public text,
model_pdf varchar(255), model_pdf varchar(255),
date_livraison date default NULL, date_livraison datetime default NULL,
fk_account integer, -- bank account fk_account integer, -- bank account
fk_cond_reglement integer, -- condition de reglement fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement

View File

@ -367,18 +367,20 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
// Reload modules (this must be always and only into last targeted version) // Reload modules (this must be always and only into last targeted version)
$listofmodule=array( $listofmodule=array(
'MAIN_MODULE_AGENDA', 'MAIN_MODULE_AGENDA',
'MAIN_MODULE_SOCIETE', 'MAIN_MODULE_BARCODE',
'MAIN_MODULE_PRODUIT', 'MAIN_MODULE_CRON',
'MAIN_MODULE_SERVICE',
'MAIN_MODULE_COMMANDE', 'MAIN_MODULE_COMMANDE',
'MAIN_MODULE_FACTURE',
'MAIN_MODULE_FOURNISSEUR',
'MAIN_MODULE_USER',
'MAIN_MODULE_DEPLACEMENT', 'MAIN_MODULE_DEPLACEMENT',
'MAIN_MODULE_DON', 'MAIN_MODULE_DON',
'MAIN_MODULE_ECM', 'MAIN_MODULE_ECM',
'MAIN_MODULE_FACTURE',
'MAIN_MODULE_FOURNISSEUR',
'MAIN_MODULE_OPENSURVEY',
'MAIN_MODULE_PAYBOX', 'MAIN_MODULE_PAYBOX',
'MAIN_MODULE_OPENSURVEY' 'MAIN_MODULE_PRODUIT',
'MAIN_MODULE_SOCIETE',
'MAIN_MODULE_SERVICE',
'MAIN_MODULE_USER'
); );
migrate_reload_modules($db,$langs,$conf,$listofmodule); migrate_reload_modules($db,$langs,$conf,$listofmodule);
@ -3773,6 +3775,26 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
$mod->init('newboxdefonly'); $mod->init('newboxdefonly');
} }
} }
if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Barcode");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) {
$mod=new modBarcode($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if ($moduletoreload == 'MAIN_MODULE_CRON')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Cron");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) {
$mod=new modCron($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if ($moduletoreload == 'MAIN_MODULE_SOCIETE') if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe");
@ -3833,17 +3855,6 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
$mod->init('newboxdefonly'); $mod->init('newboxdefonly');
} }
} }
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement");
@ -3894,6 +3905,17 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
$mod->init('newboxdefonly'); $mod->init('newboxdefonly');
} }
} }
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
} }
} }

View File

@ -635,7 +635,7 @@ Permission181=Read supplier orders
Permission182=Create/modify supplier orders Permission182=Create/modify supplier orders
Permission183=Validate supplier orders Permission183=Validate supplier orders
Permission184=Approve supplier orders Permission184=Approve supplier orders
Permission185=Order supplier orders Permission185=Order or cancel supplier orders
Permission186=Receive supplier orders Permission186=Receive supplier orders
Permission187=Close supplier orders Permission187=Close supplier orders
Permission188=Cancel supplier orders Permission188=Cancel supplier orders
@ -1394,7 +1394,7 @@ BarcodeDescUPC=Barcode of type UPC
BarcodeDescISBN=Barcode of type ISBN BarcodeDescISBN=Barcode of type ISBN
BarcodeDescC39=Barcode of type C39 BarcodeDescC39=Barcode of type C39
BarcodeDescC128=Barcode of type C128 BarcodeDescC128=Barcode of type C128
GenbarcodeLocation=Bar code generation command line tool (used by internal engine for some bar code types) GenbarcodeLocation=Bar code generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".<br>For example: /usr/local/bin/genbarcode
BarcodeInternalEngine=Internal engine BarcodeInternalEngine=Internal engine
BarCodeNumberManager=Manager to auto define barcode numbers BarCodeNumberManager=Manager to auto define barcode numbers
##### Prelevements ##### ##### Prelevements #####

View File

@ -84,3 +84,4 @@ CronType_command=Shell command
CronMenu=Cron CronMenu=Cron
CronCannotLoadClass=Cannot load class %s or object %s CronCannotLoadClass=Cannot load class %s or object %s
UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Modules tools - Job list" to see and edit scheduled jobs. UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Modules tools - Job list" to see and edit scheduled jobs.
TaskDisabled=Task disabled

View File

@ -25,7 +25,7 @@ ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be differen
ErrorBadThirdPartyName=Bad value for third party name ErrorBadThirdPartyName=Bad value for third party name
ErrorProdIdIsMandatory=The %s is mandatory ErrorProdIdIsMandatory=The %s is mandatory
ErrorBadCustomerCodeSyntax=Bad syntax for customer code ErrorBadCustomerCodeSyntax=Bad syntax for customer code
ErrorBadBarCodeSyntax=Bad syntax for bar code ErrorBadBarCodeSyntax=Bad syntax for bar code. May be you set a bad barcode type or you defined a barcode mask for numbering that does not match value scanned.
ErrorCustomerCodeRequired=Customer code required ErrorCustomerCodeRequired=Customer code required
ErrorBarCodeRequired=Bar code required ErrorBarCodeRequired=Bar code required
ErrorCustomerCodeAlreadyUsed=Customer code already used ErrorCustomerCodeAlreadyUsed=Customer code already used

View File

@ -631,7 +631,7 @@ Permission181=Consulter les commandes fournisseurs
Permission182=Créer/modifier les commandes fournisseurs Permission182=Créer/modifier les commandes fournisseurs
Permission183=Valider les commandes fournisseurs Permission183=Valider les commandes fournisseurs
Permission184=Approuver les commandes fournisseurs Permission184=Approuver les commandes fournisseurs
Permission185=Passer les commandes fournisseurs Permission185=Passer les commandes fournisseurs et les annuler
Permission186=Accuser réception des commandes fournisseurs Permission186=Accuser réception des commandes fournisseurs
Permission187=Clôturer les commandes fournisseurs Permission187=Clôturer les commandes fournisseurs
Permission188=Annuler les commandes fournisseurs Permission188=Annuler les commandes fournisseurs