Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/admin/menus/edit.php
	htdocs/product/stock/card.php
	htdocs/product/stock/info.php
	htdocs/product/stock/movement_list.php
This commit is contained in:
Laurent Destailleur 2019-02-14 15:33:17 +01:00
commit e6e18ff616
18 changed files with 238 additions and 170 deletions

View File

@ -1,3 +0,0 @@
<?php
// Wrapper to include main into htdocs
include_once '/home/ldestailleur/git/dolibarr_3.8/htdocs/main.inc.php';

View File

@ -1,3 +0,0 @@
<?php
// Wrapper to include master into htdocs
include_once '/home/ldestailleur/git/dolibarr_3.8/htdocs/master.inc.php';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

View File

@ -9,8 +9,8 @@
# Regis Houssin - regis.houssin@inodbox.com
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: initdemo.sh
# usage: initdemo.sh mysqldump_dolibarr_x.x.x.sql database port login pass
# Usage: initdemo.sh confirm
# usage: initdemo.sh confirm mysqldump_dolibarr_x.x.x.sql database port login pass
#------------------------------------------------------
@ -31,11 +31,20 @@ fi
# ----------------------------- command line params
dumpfile=$1;
base=$2;
port=$3;
admin=$4;
passwd=$5;
confirm=$1;
dumpfile=$2;
base=$3;
port=$4;
admin=$5;
passwd=$6;
# ----------------------------- check params
if [ "x$confirm" != "xconfirm" ]
then
echo "----- $0 -----"
echo "Usage: initdemo.sh confirm [mysqldump_dolibarr_x.x.x.sql database port login pass]"
exit
fi
# ----------------------------- if no params on command line
@ -132,11 +141,14 @@ then
exit;;
esac
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
# ---------------------------- confirmation
DIALOG=${DIALOG=dialog}
$DIALOG --title "Init Dolibarr with demo values" --clear \
--yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 55
--yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Document dir : '$documentdir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 55
case $? in
0) echo "Ok, start process...";;
@ -165,15 +177,44 @@ export res=$?
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
if [ "x$documentdir" != "x" ]
then
$DIALOG --title "Reset document directory tpp" --clear \
--inputbox "Delete and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
valret=$?
case $valret in
0)
rep=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
echo "rep=$rep"
if [ "x$rep" = "xy" ]; then
echo rm -fr "$documentdir/*"
rm -fr $documentdir/*
fi
echo cp -pr $mydir/documents_demo/* "$documentdir/"
cp -pr $mydir/documents_demo/* "$documentdir/"
mkdir "$documentdir/doctemplates/" 2>/dev/null
echo cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
mkdir -p "$documentdir/ecm/Administrative documents"
mkdir -p "$documentdir/ecm/Images"
echo cp -pr $mydir/../../htdocs/install/medias/* "$documentdir/medias/image/"
cp -pr $mydir/../../htdocs/install/medias/* "$documentdir/medias/image/"
mkdir -p "$documentdir/ecm/Administrative documents" 2>/dev/null
mkdir -p "$documentdir/ecm/Images" 2>/dev/null
rm -f "$documentdir/doctemplates/"*/index.html
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
chmod -R u+w "$documentdir/"
chown -R www-data "$documentdir/"
else
echo Detection of documents directory from $mydir failed so demo files were not copied.
fi

File diff suppressed because one or more lines are too long

View File

@ -84,8 +84,8 @@ $arrayfields=array(
'd.bank'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1, 'enabled'=>(! empty($conf->banque->enabled))),
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
'd.datedebut'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100),
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101),
'c.dateadh'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100),
'c.datef'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101),
'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102),
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@ -343,12 +343,12 @@ if (! empty($arrayfields['d.bank']['checked']))
print '</td>';
}
if (! empty($arrayfields['d.date_debut']['checked']))
if (! empty($arrayfields['c.dateadh']['checked']))
{
print '<td class="liste_titre">&nbsp;</td>';
}
if (! empty($arrayfields['d.date_fin']['checked']))
if (! empty($arrayfields['c.datef']['checked']))
{
print '<td class="liste_titre">&nbsp;</td>';
}
@ -417,11 +417,11 @@ if (! empty($arrayfields['d.bank']['checked']))
{
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $pram, "", "", $sortfield, $sortorder);
}
if (! empty($arrayfields['d.date_debut']['checked']))
if (! empty($arrayfields['c.dateadh']['checked']))
{
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", 'align="center"', $sortfield, $sortorder);
}
if (! empty($arrayfields['d.date_fin']['checked']))
if (! empty($arrayfields['c.datef']['checked']))
{
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", 'align="center"', $sortfield, $sortorder);
}
@ -527,13 +527,13 @@ while ($i < min($num, $limit))
}
// Date start
if (! empty($arrayfields['d.date_start']['checked']))
if (! empty($arrayfields['c.dateadh']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh), 'day')."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Date end
if (! empty($arrayfields['d.date_end']['checked']))
if (! empty($arrayfields['c.datef']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->datef), 'day')."</td>\n";
if (! $i) $totalarray['nbfield']++;

View File

@ -144,9 +144,9 @@ if ($action == 'add')
}
$leftmenu=''; $mainmenu='';
if (GETPOST('menuId', 'alpha') && ! is_numeric(GETPOST('menuId', 'alpha')))
if (GETPOST('menuId', 'alpha', 3) && ! is_numeric(GETPOST('menuId', 'alpha', 3)))
{
$tmp=explode('&', GETPOST('menuId', 'alpha'));
$tmp=explode('&', GETPOST('menuId', 'alpha', 3));
foreach($tmp as $s)
{
if (preg_match('/fk_mainmenu=/', $s))
@ -214,9 +214,9 @@ if ($action == 'add')
$menu->target=GETPOST('target', 'alpha');
$menu->user=GETPOST('user', 'alpha');
$menu->mainmenu=GETPOST('propertymainmenu', 'alpha');
if (is_numeric(GETPOST('menuId', 'alpha')))
if (is_numeric(GETPOST('menuId', 'alpha', 3)))
{
$menu->fk_menu=GETPOST('menuId', 'alpha');
$menu->fk_menu=GETPOST('menuId', 'alpha', 3);
}
else
{

View File

@ -253,12 +253,24 @@ if ($action == 'delete')
print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete");
}
$newcardbutton='';
if ($user->admin)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&action=create&menu_handler='.urlencode($menu_handler).'&backtopage='.urlencode($_SERVER['PHP_SELF']).'"><span class="valignmiddle">'.$langs->trans('New').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print '<form name="newmenu" class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" action="change_menu_handler">';
print $langs->trans("MenuHandler").': ';
$formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler)?'':'_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone));
print ' &nbsp; <input type="submit" class="button" value="'.$langs->trans("Refresh").'">';
print '<div class="floatright">';
print $newcardbutton;
print '</div>';
print '</form>';
print '<br>';
@ -394,14 +406,6 @@ if ($conf->use_javascript_ajax)
}
print '</div>';
/*
* Boutons actions
*/
print '<div class="tabsAction">';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&amp;action=create&amp;menu_handler='.urlencode($menu_handler).'">'.$langs->trans("NewMenu").'</a>';
print '</div>';
}
else
{

View File

@ -280,7 +280,7 @@ class modAdherent extends DolibarrModules
'a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.gender'=>'Text','a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",
'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",
'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date',
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle::member_type','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'
);
$this->export_entities_array[$r]=array(
'a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.gender'=>'member','a.morphy'=>'member',

View File

@ -223,7 +223,7 @@ class modCommande extends DolibarrModules
'c.date_commande'=>"Date",'c.date_livraison'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",
'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','pj.ref'=>'Text',
'cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",
'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text'
'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref::product','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text'
);
$this->export_entities_array[$r]=array(
's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company',

View File

@ -217,9 +217,9 @@ class modProjet extends DolibarrModules
$this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('projecttask'=>'pt.rowid', 'task_time'=>'ptt.rowid');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
's.phone'=>'Text','s.email'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
'p.rowid'=>"List:projet:ref::project",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
'pt.rowid'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text",
'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',

View File

@ -339,7 +339,7 @@ class modSociete extends DolibarrModules
$this->export_TypeFields_array[$r]=array(
'c.civility'=>"List:c_civility:label:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",
'c.address'=>"Text",'c.zip'=>"Text",'c.town'=>"Text",'d.nom'=>'Text','co.label'=>"List:c_country:label:rowid",'co.code'=>"Text",'c.phone'=>"Text",
'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",
'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",
's.client'=>"Text",'s.fournisseur'=>"Text"
);
$this->export_entities_array[$r]=array(

View File

@ -148,31 +148,31 @@ class modStock extends DolibarrModules
$this->rights[4][4] = 'mouvement';
$this->rights[4][5] = 'creer';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
$this->rights[5][0] = 1011;
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[5][0] = 1011;
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][0] = 1012;
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][0] = 1012;
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[8][0] = 1014;
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
$this->rights[8][3] = 0; // Permission by default for new user (0/1)
$this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[8][0] = 1014;
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
$this->rights[8][3] = 0; // Permission by default for new user (0/1)
$this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[9][0] = 1015;
$this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label
$this->rights[9][3] = 0; // Permission by default for new user (0/1)
$this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[9][0] = 1015;
$this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label
$this->rights[9][3] = 0; // Permission by default for new user (0/1)
$this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
}
// Main menu entries
@ -199,7 +199,7 @@ class modStock extends DolibarrModules
'p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice'
);
$this->export_TypeFields_array[$r]=array(
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label::product",
'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric',
'p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','p.pmp'=>'Numeric','p.cost_price'=>'Numeric',
'ps.reel'=>'Numeric'
@ -211,7 +211,7 @@ class modStock extends DolibarrModules
'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock'
);
$this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet
$this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
$this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them.
$keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ps.reel'=>'Stock'));
@ -238,8 +238,8 @@ class modStock extends DolibarrModules
'p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.qty'=>'Qty','pl.eatby'=>'EatByDate','pl.sellby'=>'SellByDate'
);
$this->export_TypeFields_array[$r]=array(
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
'pb.batch'=>'Text','pb.qty'=>'Numeric','pl.eatby'=>'Date','pl.sellby'=>'Date'
);
@ -276,8 +276,8 @@ class modStock extends DolibarrModules
'sm.inventorycode'=>'InventoryCode'
);
$this->export_TypeFields_array[$r]=array(
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
'sm.rowid'=>'Numeric','sm.value'=>'Numeric','sm.datem'=>'Date','sm.batch'=>'Text','sm.label'=>'Text','sm.inventorycode'=>'Text'
);

View File

@ -99,39 +99,57 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
}
// Members
elseif ($action == 'MEMBER_VALIDATE' || $action == 'MEMBER_MODIFY')
elseif ($action == 'MEMBER_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$return=0;
$return=0;
if ($object->add_to_abo() < 0)
{
if (! empty($object->error)) $this->error=$object->error;
$this->errors=$object->errors;
$return=-1;
}
else
{
$return=1;
}
return $return;
}
elseif ($action == 'MEMBER_MODIFY')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$return=0;
// Add user into some linked tools (mailman, spip, etc...)
if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) // TODO Do del/add also if type change
{
if (is_object($object->oldcopy) && ($object->oldcopy->email != $object->email)) // If email has changed we delete mailman subscription for old email
{
if ($object->oldcopy->del_to_abo() < 0)
{
if (! empty($object->oldcopy->error)) $this->error=$object->oldcopy->error;
$this->errors=$object->oldcopy->errors;
$return=-1;
}
else
{
$return=1;
}
}
// We add subscription if new email or new type (new type may means more mailing-list to subscribe)
if ($object->add_to_abo() < 0)
{
if (! empty($object->error)) $this->error=$object->error;
$this->errors=$object->errors;
$return=-1;
}
else
{
$return=1;
}
}
if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))
{
if (is_object($object->oldcopy) && (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))) // If email has changed or if list has changed we delete mailman subscription for old email
{
if ($object->oldcopy->del_to_abo() < 0)
{
if (! empty($object->oldcopy->error)) $this->error=$object->oldcopy->error;
$this->errors=$object->oldcopy->errors;
$return=-1;
}
else
{
$return=1;
}
}
// We add subscription if new email or new type (new type may means more mailing-list to subscribe)
if ($object->add_to_abo() < 0)
{
if (! empty($object->error)) $this->error=$object->error;
$this->errors=$object->errors;
$return=-1;
}
else
{
$return=1;
}
}
return $return;
}

View File

@ -422,7 +422,9 @@ class Export
// 1 : Nom de la table
// 2 : Nom du champ contenant le libelle
// 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list.
if (count($InfoFieldList)==4)
// 4 : Name of element for getEntity().
if (! empty($InfoFieldList[3]))
$keyList=$InfoFieldList[3];
else
$keyList='rowid';
@ -430,6 +432,9 @@ class Export
if ($InfoFieldList[1] == 'c_stcomm') $sql = 'SELECT id as id, '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3])?'':', '.$InfoFieldList[3].' as code');
if ($InfoFieldList[1] == 'c_country') $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label, code as code';
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[1];
if (! empty($InfoFieldList[4])) {
$sql.= ' WHERE entity IN ('.getEntity($InfoFieldList[4]).')';
}
$resql = $this->db->query($sql);
if ($resql)

View File

@ -52,6 +52,7 @@ if (! $sortorder) $sortorder="DESC";
$backtopage=GETPOST('backtopage', 'alpha');
// Security check
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result=restrictedArea($user, 'stock');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -33,6 +33,7 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
// Security check
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result=restrictedArea($user, 'stock');

View File

@ -51,11 +51,15 @@ $result=restrictedArea($user, 'stock');
$id=GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$msid=GETPOST('msid', 'int');
$product_id=GETPOST("product_id");
$product_id=GETPOST("product_id", 'int');
$action=GETPOST('action', 'aZ09');
$cancel=GETPOST('cancel', 'alpha');
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'movementlist';
// Security check
//$result=restrictedArea($user, 'stock', $id, 'entrepot&stock');
$result=restrictedArea($user, 'stock');
$idproduct = GETPOST('idproduct', 'int');
$year = GETPOST("year");
$month = GETPOST("month");