diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e29b7dbeaa0..d5118d66824 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -438,8 +438,11 @@ class Form $s='';$textfordialog=''; - $htmltext=str_replace('"',""",$htmltext); - if ($tooltiptrigger != '') + if ($tooltiptrigger == '') + { + $htmltext=str_replace('"',""",$htmltext); + } + else { $classfortooltip='classfortooltiponclick'; $textfordialog.=''; @@ -6448,7 +6451,7 @@ class Form */ function selectExpenseCategories($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array()) { - global $db,$conf,$langs; + global $db, $conf, $langs, $user; $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; $sql.= ' AND entity IN (0,'.getEntity('').')'; @@ -6459,13 +6462,14 @@ class Form if ($resql) { $out = ''; + if (! empty($htmlname) && $user->admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if (!empty($target)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2626e917460..538c6593ff3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2720,7 +2720,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB $title=$tmparray[0]; $alt=empty($tmparray[1])?'':$tmparray[1]; - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 0c7fb86a02d..afce2644124 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -60,11 +60,6 @@ function user_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserGUISetup"); - $head[$h][2] = 'guisetup'; - $h++; - if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; @@ -73,6 +68,11 @@ function user_prepare_head($object) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; + $head[$h][1] = $langs->trans("UserGUISetup"); + $head[$h][2] = 'guisetup'; + $h++; + if (! empty($conf->agenda->enabled)) { if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index f068247248a..4d84c0a6d05 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules $r++; // Array to add new pages in new tabs - $this->tabs = array('user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array('data'=>'user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index d57800872fd..75bb6a04a07 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -91,26 +91,7 @@ class modHoliday extends DolibarrModules $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 - // 'objecttype:-tabname'); // To remove an existing tab identified by code tabname - // where objecttype can be - // 'thirdparty' to add a tab in third party view - // 'intervention' to add a tab in intervention view - // 'order_supplier' to add a tab in supplier order view - // 'invoice_supplier' to add a tab in supplier invoice view - // 'invoice' to add a tab in customer invoice view - // 'order' to add a tab in customer order view - // 'product' to add a tab in product view - // 'stock' to add a tab in stock view - // 'propal' to add a tab in propal view - // 'member' to add a tab in fundation member view - // 'contract' to add a tab in contract view - // 'user' to add a tab in user view - // 'group' to add a tab in group view - // 'contact' to add a tab in contact view - // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) - $this->tabs = array('user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array('data'=>'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 8362343f8cb..e31b15d81dd 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -118,59 +118,59 @@ class modStock extends DolibarrModules $this->rights[4][5] = 'creer'; 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] = 'advance_inventory'; // 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] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[6][5] = 'create'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - + $this->rights[7][0] = 1013; $this->rights[7][1] = 'inventoryWritePermission'; // Permission label $this->rights[7][3] = 0; // Permission by default for new user (0/1) $this->rights[7][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[7][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] = 'advance_inventory'; // 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] = 'advance_inventory'; // 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 $this->menu = array(); // List of menus to add $r=0; - + // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=0; $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_code[$r]=$this->rights_class; $this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("stock","lire")); - $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock'); - $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'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",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','ps.reel'=>'Numeric'); - $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock'); + $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock'); + $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'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",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','ps.reel'=>'Numeric'); + $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'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_sql_start[$r]='SELECT DISTINCT '; @@ -185,12 +185,12 @@ class modStock extends DolibarrModules // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_code[$r]=$this->rights_class.'_lot'; $this->export_label[$r]="WarehousesAndProductsBatchDetail"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("stock","lire")); - $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.eatby'=>'EatByDate','pb.sellby'=>'SellByDate','pb.qty'=>'Qty'); - $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'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",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','pb.batch'=>'Text','pb.eatby'=>'Date','pb.sellby'=>'Date','pb.qty'=>'Numeric'); - $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','pb.rowid'=>'batch','pb.batch'=>'batch','pb.eatby'=>'batch','pb.sellby'=>'batch','pb.qty'=>'batch'); + $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.eatby'=>'EatByDate','pb.sellby'=>'SellByDate','pb.qty'=>'Qty'); + $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'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",'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.eatby'=>'Date','pb.sellby'=>'Date','pb.qty'=>'Numeric'); + $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','pb.rowid'=>'batch','pb.batch'=>'batch','pb.eatby'=>'batch','pb.sellby'=>'batch','pb.qty'=>'batch'); $this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r]=array('batch'=>array('pb.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_sql_start[$r]='SELECT DISTINCT '; @@ -199,6 +199,26 @@ class modStock extends DolibarrModules $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock').')'; } + $r++; + $this->export_code[$r]=$this->rights_class.'_movement'; + $this->export_label[$r]="StockMovements"; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_permission[$r]=array(array("stock","lire")); + $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LocationSummary','e.description'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.zip'=>'Zip','e.town'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.tobuy'=>'OnBuy','p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','sm.rowid'=>'MovementId','sm.value'=>'Qty','sm.datem'=>'DateMovement','sm.label'=>'LabelMovement','sm.inventorycode'=>'InventoryCode'); + $this->export_TypeFields_array[$r]=array('e.rowid'=>'List:entrepot:label','e.label'=>'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",'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'); + $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.description'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.zip'=>'warehouse','e.town'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.tobuy'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','sm.rowid'=>'movement','sm.value'=>'movement','sm.datem'=>'movement','sm.label'=>'movement','sm.inventorycode'=>'movement'); + if ($conf->productbatch->enabled) + { + $this->export_fields_array[$r]['sm.batch']='Batch'; + $this->export_TypeFields_array[$r]['sm.batch']='Text'; + $this->export_entities_array[$r]['sm.batch']='movement'; + } + $this->export_aggregate_array[$r]=array('sm.value'=>'SUM'); // TODO Not used yet + $this->export_dependencies_array[$r]=array('movement'=>array('sm.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_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'stock_mouvement as sm, '.MAIN_DB_PREFIX.'entrepot as e'; + $this->export_sql_end[$r] .=' WHERE p.rowid = sm.fk_product AND sm.fk_entrepot = e.rowid'; + $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock').')'; + // Imports //-------- diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index d6d984193d9..2259a91e15a 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -80,7 +80,7 @@ class modWebsites extends DolibarrModules // New pages on tabs // ----------------- - $this->tabs = array(); + $this->tabs[] = array('data'=>'thirdparty:+websites:WebSites:website:$user->rights->websites->read:/societe/website.php?mainmenu=home&id=__ID__'); // To add a new tab identified by code tabname1 // Boxes //------ diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 6ad9f0d80d8..3110aa37459 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'; $langs->load("companies"); $langs->load("users"); @@ -126,6 +127,10 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } +$canedituser=(! empty($user->admin) || $user->rights->user->user->creer); + +$object = new ExpenseReport($db); +$objectuser = new User($db); /* @@ -172,6 +177,51 @@ if (empty($reshook)) $permtodelete = $user->rights->expensereport->supprimer; $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + if ($action == 'update' && ! $cancel) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + if ($canedituser) // Case we can edit all field + { + $error = 0; + + if (!$error) + { + $objectuser->fetch($id); + + $objectuser->oldcopy = clone $objectuser; + + $db->begin(); + + $objectuser->default_range = GETPOST('default_range'); + $objectuser->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat'); + + if (!$error) { + $ret = $objectuser->update($user); + if ($ret < 0) { + $error++; + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorLoginAlreadyExists", $objectuser->login), null, 'errors'); + } + else + { + setEventMessages($objectuser->error, $objectuser->errors, 'errors'); + } + } + } + + if (!$error && !count($objectuser->errors)) { + setEventMessages($langs->trans("UserModified"), null, 'mesgs'); + $db->commit(); + } + else { + $db->rollback(); + } + } + } + } } @@ -338,7 +388,7 @@ if ($resql) if ($optioncss != '') print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -355,9 +405,43 @@ if ($resql) dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); + print '
'; print '
'; - print '
'; + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) + { + print ''; + + if ($action == 'edit') + { + print ''; + print ''; + + print ''; + print ''; + } + else + { + print ''; + print ''; + + print ''; + print ''; + } + + print '
'.$langs->trans("DefaultCategoryCar").''; + print $form->selectExpenseCategories($fuser->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1); + print '
'.$langs->trans("DefaultRangeNumber").''; + $maxRangeNum = ExpenseReportIk::getMaxRangeNumber($fuser->default_c_exp_tax_cat); + print $form->selectarray('default_range', range(0, $maxRangeNum), $fuser->default_range); + print '
'.$langs->trans("DefaultCategoryCar").''; + print dol_getIdFromCode($db, $fuser->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + print '
'.$langs->trans("DefaultRangeNumber").''; + print $fuser->default_range; + print '
'; + } + + print '
'; /*if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { @@ -370,17 +454,31 @@ if ($resql) dol_fiche_end(); - print '
'; - - $canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id)); - - // Boutons d'actions - if ($canedit) + if ($action != 'edit') { - print ''.$langs->trans("AddTrip").''; - } + print '
'; - print '
'; + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) + { + print ''.$langs->trans("Modify").''; + } + + $canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id)); + + // Boutons d'actions + if ($canedit) + { + print ''.$langs->trans("AddTrip").''; + } + + print '
'; + } + else + { + print '
'; + print ''; + print '

'; + } } else { @@ -653,22 +751,22 @@ if ($resql) } // Start date if (! empty($arrayfields['d.date_debut']['checked'])) { - print ''.($obj->date_debut > 0 ? dol_print_date($obj->date_debut, 'day') : '').''; + print ''.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').''; if (! $i) $totalarray['nbfield']++; } // End date if (! empty($arrayfields['d.date_fin']['checked'])) { - print ''.($obj->date_fin > 0 ? dol_print_date($obj->date_fin, 'day') : '').''; + print ''.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').''; if (! $i) $totalarray['nbfield']++; } // Date validation if (! empty($arrayfields['d.date_valid']['checked'])) { - print ''.($obj->date_valid > 0 ? dol_print_date($obj->date_valid, 'day') : '').''; + print ''.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').''; if (! $i) $totalarray['nbfield']++; } // Date approval if (! empty($arrayfields['d.date_approve']['checked'])) { - print ''.($obj->date_approve > 0 ? dol_print_date($obj->date_approve, 'day') : '').''; + print ''.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').''; if (! $i) $totalarray['nbfield']++; } // Amount HT diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 49c60078666..4c15a7c4480 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -99,6 +99,7 @@ $entitytolang = array( 'subproduct' => 'SubProduct', 'service' => 'Service', 'stock' => 'Stock', + 'movement' => 'StockMovement', 'batch' => 'Batch', 'warehouse' => 'Warehouse', 'category' => 'Category', diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3f66ea2fedd..7756f5cc3e5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1170,8 +1170,6 @@ RuleForGeneratedPasswords=Rule to generate suggested passwords or validate passw DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page UsersSetup=Users module setup UserMailRequired=EMail required to create a new user -DefaultCategoryCar=Default car category -DefaultRangeNumber=Default range number ##### HRM setup ##### HRMSetup=HRM module setup ##### Company setup ##### diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 86c25591ef3..a772cb2f58b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -808,6 +808,10 @@ ModuleBuilder=Module Builder SetMultiCurrencyCode=Set currency BulkActions=Bulk actions ClickToShowHelp=Click to show tooltip help +Website=Web site +WebSites=Web sites +ExpenseReport=Expense report +ExpenseReports=Expense reports HR=HR HRAndBank=HR and Bank AutomaticallyCalculated=Automatically calculated diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 6019977120e..88eb244713e 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -22,6 +22,7 @@ Movements=Movements ErrorWarehouseRefRequired=Warehouse reference name is required ListOfWarehouses=List of warehouses ListOfStockMovements=List of stock movements +MovementId=Movement ID StockMovementForId=Movement ID %d ListMouvementStockProject=List of stock movements associated to project StocksArea=Warehouses area @@ -130,6 +131,7 @@ StockMustBeEnoughForInvoice=Stock level must be enough to add product/service to StockMustBeEnoughForOrder=Stock level must be enough to add product/service to order (check is done on current real stock when adding a line into order whatever is rule for automatic stock change) StockMustBeEnoughForShipment= Stock level must be enough to add product/service to shipment (check is done on current real stock when adding a line into shipment whatever is rule for automatic stock change) MovementLabel=Label of movement +DateMovement=Date of movement InventoryCode=Movement or inventory code IsInPackage=Contained into package WarehouseAllowNegativeTransfer=Stock can be negative diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index da4b3efa8f8..ad4f7217d6f 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -1,6 +1,4 @@ # Dolibarr language file - Source file is en_US - trips -ExpenseReport=Expense report -ExpenseReports=Expense reports ShowExpenseReport=Show expense report Trips=Expense reports TripsAndExpenses=Expenses reports @@ -73,6 +71,8 @@ EX_FUE_VP=Fuel PV EX_TOL_VP=Toll PV EX_PAR_VP=Parking PV EX_CAM_VP=PV maintenance and repair +DefaultCategoryCar=Default transportation mode +DefaultRangeNumber=Default range number ErrorDoubleDeclaration=You have declared another expense report into a similar date range. AucuneLigne=There is no expense report declared yet diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index bd4db42c2fa..847a2cb4647 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -17,7 +17,6 @@ EditCss=Edit Style/CSS or HTML header EditMenu=Edit menu EditMedias=Edit medias EditPageMeta=Edit Meta -Website=Web site AddWebsite=Add website Webpage=Web page/container AddPage=Add page/container @@ -39,7 +38,7 @@ VirtualHostUrlNotDefined=URL of the virtual host served by external web server n NoPageYet=No pages yet SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.

You can also include content of another Page/Container with the following syntax:
<?php dolIncludeHtmlContent($websitekey.'/alias_of_content_to_include.php'); ?>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext">
For same file into documents/ecm (open access using the sharing hash key), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile">
For a file into documents/media (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=relative_dir/filename.ext">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/media (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=relative_dir/filename.ext"> +YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.

You can also include content of another Page/Container with the following syntax:
<?php dolIncludeHtmlContent($websitekey.'/alias_of_container_to_include.php'); ?>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext">
For same file into documents/ecm (open access using the sharing hash key), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile">
For a file into documents/media (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=relative_dir/filename.ext">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/media (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=relative_dir/filename.ext">
ClonePage=Clone page/container CloneSite=Clone site ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page. @@ -51,4 +50,5 @@ CreateByFetchingExternalPage=Create page/container by fetching page from externa OrEnterPageInfoManually=Or create empty page from scratch... FetchAndCreate=Fetch and Create ExportSite=Export site -IDOfPage=Id of page \ No newline at end of file +IDOfPage=Id of page +WebsiteAccounts=Web sites accounts \ No newline at end of file diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ef6e10757d1..3d3bfa1b6d1 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1988,7 +1988,7 @@ else print $object->getLibCustProspStatut(); print ''; - // Prospect/Customer + // Supplier print ''.$langs->trans('Supplier').''; print yn($object->fournisseur); print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 24789902411..49c0b3db04f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1048,7 +1048,16 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['s.nom']['checked'])) { print ''; + //if (! empty($arrayfields['s.name_alias']['checked'])) // Hide alias from output + //{ + $savalias=$companystatic->name_alias; + $companystatic->name_alias=''; + //} print $companystatic->getNomUrl(1,'',100); + //if (! empty($arrayfields['s.name_alias']['checked'])) // Hide alias from output + //{ + $companystatic->name_alias=$savalias; + //} print "\n"; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index d95c0bc554f..439586468c4 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -145,7 +145,7 @@ if ($id > 0 || ! empty($ref)) $soc->fetch($object->socid); $head = societe_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"),0,'company'); + dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"), -1, 'company'); print '
'; print ''; @@ -159,10 +159,15 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - // Alias names (commercial, trademark or alias names) - print '"; + // Prospect/Customer + /*print ''; + + // Supplier + print '';*/ if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { @@ -171,7 +176,7 @@ if ($id > 0 || ! empty($ref)) if ($object->client) { - print '
'.$langs->trans('AliasNames').''; - print $object->name_alias; - print "
'.$langs->trans('ProspectCustomer').''; + print $object->getLibCustProspStatut(); + print '
'.$langs->trans('Supplier').''; + print yn($object->fournisseur); + print '
'; + print '
'; print $langs->trans('CustomerCode').''; print $object->code_client; if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; @@ -180,7 +185,7 @@ if ($id > 0 || ! empty($ref)) if ($object->fournisseur) { - print '
'; + print '
'; print $langs->trans('SupplierCode').''; print $object->code_fournisseur; if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php new file mode 100644 index 00000000000..7f390973ec2 --- /dev/null +++ b/htdocs/societe/website.php @@ -0,0 +1,184 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos GarcĂ­a + * + * 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 . + */ + +/** + * \file htdocs/societe/website.php + * \ingroup societe + * \brief Page of web sites accounts + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +$langs->load("companies"); + +$search_status=GETPOST('search_status'); + +// Security check +$id = GETPOST('id','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $socid, '&societe'); + +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='a.login'; +if (! $sortorder) $sortorder='ASC'; + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('websitethirdparty')); + + +/* + * Actions + */ + +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Cancel + if (GETPOST('cancel','alpha') && ! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $actioncode=''; + $search_agenda_label=''; + } +} + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +if ($id > 0) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $langs->load("companies"); + + + $object = new Societe($db); + $result = $object->fetch($id); + + $title=$langs->trans("WebisteAccounts"); + llxHeader('',$title); + + $head = societe_prepare_head($object); + + dol_fiche_head($head, 'websites', $langs->trans("ThirdParty"), -1, 'company'); + + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
'; + + print '
'; + + print ''; + + // Prefix + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + + if ($object->client) + { + print ''; + } + + if ($object->fournisseur) + { + print ''; + } + + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
'; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
'; + + print '
'; + + dol_fiche_end(); + + + + $morehtmlcenter=''; + if (! empty($conf->website->enabled)) + { + if (! empty($user->rights->societe->lire)) + { + $morehtmlcenter.=''.$langs->trans("AddWebsiteAccount").''; + } + else + { + $morehtmlcenter.=''.$langs->trans("AddAction").''; + } + } + + print '
'; + + $param='&id='.$id; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + + print_barre_liste($langs->trans("WebsiteAccounts"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1); + + + + + + +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index 6a20b34d302..bac39e67d87 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -34,7 +34,7 @@ CKEDITOR.editorConfig = function( config ) [ ['Templates','NewPage'], ['Save'], - ['Source','Maximize','Preview'], + ['Maximize','Preview'], ['PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['CreateDiv','ShowBlocks'], @@ -46,7 +46,8 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Anchor'], ['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'], ['Styles','Format','Font','FontSize'], - ['TextColor','BGColor'] + ['TextColor','BGColor'], + ['Source'] ]; // Used for mailing fields diff --git a/htdocs/theme/eldy/img/object_movement.png b/htdocs/theme/eldy/img/object_movement.png new file mode 100644 index 00000000000..aec344a3f8d Binary files /dev/null and b/htdocs/theme/eldy/img/object_movement.png differ diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 6677e240a04..0f26169adf3 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -312,18 +312,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $resql=$db->query($sql); if ($resql) { - $var=true; $num = $db->num_rows($resql); - if ($num > 0) - { - print ''; + print '
'; - print ''; - print ''; - print ''; - } + print ''; + print ''; + print ''; $i = 0; while ($i < $num && $i < $MAXLIST) @@ -343,7 +339,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco } $db->free($resql); - if ($num > 0) print "
'; - print '
'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").' '.$num.'
'; + print '
'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").' '.$num.'
"; + if ($num <= 0) print '
'.$langs->trans("None").''; + print "
"; } else { @@ -369,18 +366,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $resql=$db->query($sql); if ($resql) { - $var=true; $num = $db->num_rows($resql); - if ($num > 0) - { - print ''; + print '
'; - print ''; - print ''; - print ''; - } + print ''; + print ''; + print ''; $i = 0; while ($i < $num && $i < $MAXLIST) @@ -402,7 +395,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco } $db->free($resql); - if ($num > 0) print "
'; - print '
'.$langs->trans("LastHolidays",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllHolidays").' '.$num.'
'; + print '
'.$langs->trans("LastHolidays",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllHolidays").' '.$num.'
"; + if ($num <= 0) print ''.$langs->trans("None").''; + print ""; } else { @@ -428,18 +422,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $resql=$db->query($sql); if ($resql) { - $var=true; $num = $db->num_rows($resql); - if ($num > 0) - { - print ''; + print '
'; - print ''; - print ''; - print ''; - } + print ''; + print ''; + print ''; $i = 0; while ($i < $num && $i < $MAXLIST) @@ -460,7 +450,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco } $db->free($resql); - if ($num > 0) print "
'; - print '
'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").' '.$num.'
'; + print '
'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").' '.$num.'
"; + if ($num <= 0) print ''.$langs->trans("None").''; + print ""; } else { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 106fa322cf1..a62ac060d74 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -46,7 +46,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'; $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); @@ -370,9 +369,6 @@ if (empty($reshook)) { $dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear')); $object->dateemployment = $dateemployment; - $object->default_range = GETPOST('default_range'); - $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat'); - if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) @@ -1126,20 +1122,6 @@ if ($action == 'create' || $action == 'adduserldap') } */ - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) - { - print ''.$langs->trans("DefaultCategoryCar").''; - print ''; - print $form->selectExpenseCategories($object->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1); - print ''; - - print ''.$langs->trans("DefaultRangeNumber").''; - print ''; - $maxRangeNum = ExpenseReportIk::getMaxRangeNumber($object->default_c_exp_tax_cat); - print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range); - print ''; - } - // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1540,19 +1522,6 @@ else print ''.dol_print_date($object->datepreviouslogin,"dayhour").''; print "\n"; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) - { - print ''.$langs->trans("DefaultCategoryCar").''; - print ''; - print dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); - print ''; - - print ''.$langs->trans("DefaultRangeNumber").''; - print ''; - print $object->default_range; - print ''; - } - // Multicompany // This is now done with hook formObjectOptions (included into /core/tpl/extrafields_view.tpl.php) /* @@ -1737,81 +1706,6 @@ else include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; - /* - if ($action == 'presend') - { - // Show email form - - // By default if $action=='presend' - $titreform='SendMail'; - $topicmail=1; - $action='send'; - $modelmail='user'; - - print '
'; - print '
'; - print load_fiche_titre($langs->trans($titreform)); - - dol_fiche_head(); - - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - // $newlang = $object->thirdparty->default_lang; - - // Cree l'objet formulaire mail - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); - - if($formmail->fromtype === 'user'){ - $formmail->fromid = $user->id; - - } - $formmail->trackid='thi'.$object->id; - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set - { - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'thi'.$object->id); - } - $formmail->withfrom=1; - $formmail->withtopic=$topicmail; - $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$object->email; - $formmail->withtofree=1; - $formmail->withtocc=1; - $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - // Tableau des substitutions - $formmail->setSubstitFromObject($object, $outputlangs); - $formmail->substit['__LASTNAME__']=$object->lastname; - $formmail->substit['__FIRSTNAME__']=$object->firstname; - - // Tableau des parametres complementaires du post - $formmail->param['action']=$action; - $formmail->param['models']=$modelmail; - $formmail->param['models_id']=GETPOST('modelmailselected','int'); - $formmail->param['socid']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - print $formmail->get_form(); - - dol_fiche_end(); - } - */ - if (GETPOST('action','aZ09') != 'presend' && GETPOST('action','aZ09') != 'send') { /* @@ -2481,20 +2375,6 @@ else print "\n"; } - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) - { - print ''.$langs->trans("DefaultCategoryCar").''; - print ''; - print $form->selectExpenseCategories($object->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1); - print ''; - - print ''.$langs->trans("DefaultRangeNumber").''; - print ''; - $maxRangeNum = ExpenseReportIk::getMaxRangeNumber($object->default_c_exp_tax_cat); - print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range); - print ''; - } - // Multicompany // This is now done with hook formObjectOptions /* diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 49e95cd40a3..806be3e5e36 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -201,7 +201,7 @@ class User extends CommonObject $sql.= " u.color,"; $sql.= " u.dateemployment,"; $sql.= " u.ref_int, u.ref_ext,"; - $sql.= " u.default_range, u.default_c_exp_tax_cat,"; + $sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode $sql.= " c.code as country_code, c.label as country,"; $sql.= " d.code_departement as state_code, d.nom as state"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index fa33f9bae43..28ebb4d439e 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -1386,7 +1386,7 @@ if (count($object->records) > 0) if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { $htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource"); - print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 0, 2, 'tooltipsubstitution'); + print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); } print ''; // end websitehelp