diff --git a/htdocs/.htaccess b/htdocs/.htaccess new file mode 100644 index 00000000000..5a928f6da25 --- /dev/null +++ b/htdocs/.htaccess @@ -0,0 +1 @@ +Options -Indexes diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 0876dd81a19..6f510ad3706 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -51,6 +51,7 @@ $confirm = GETPOST('confirm', 'alpha'); $chartofaccounts = GETPOST('chartofaccounts', 'int'); +$permissiontoadd = $user->rights->accounting->chartofaccount; $permissiontodelete = $user->rights->accounting->chartofaccount; // Security check @@ -96,7 +97,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { $accounting = new AccountingAccount($db); - /* * Actions */ @@ -118,9 +118,11 @@ if (empty($reshook)) { if (!empty($cancel)) { $action = ''; } + $objectclass = 'AccountingAccount'; $uploaddir = $conf->accounting->multidir_output[$conf->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + if ($action == "delete") { $action = ""; } @@ -136,7 +138,7 @@ if (empty($reshook)) { } if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified - if ($chartofaccounts > 0) { + if ($chartofaccounts > 0 && $permissiontoadd) { // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; $sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts; @@ -180,7 +182,7 @@ if (empty($reshook)) { } } - if ($action == 'disable') { + if ($action == 'disable' && $permissiontoadd) { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); $result = $accounting->accountDeactivate($id, $mode); @@ -190,7 +192,7 @@ if (empty($reshook)) { if ($result < 0) { setEventMessages($accounting->error, $accounting->errors, 'errors'); } - } elseif ($action == 'enable') { + } elseif ($action == 'enable' && $permissiontoadd) { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); $result = $accounting->account_activate($id, $mode); @@ -277,6 +279,7 @@ if (strlen(trim($search_pcgtype))) { $sql .= natural_search("aa.pcg_type", $search_pcgtype); } $sql .= $db->order($sortfield, $sortorder); +//print $sql; // Count total nb of records $nbtotalofrecords = ''; @@ -454,7 +457,7 @@ if ($resql) { $totalarray['nbfield']++; } if (!empty($arrayfields['aa.pcg_type']['checked'])) { - print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help'], 1); + print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type,aa.account_number', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help'], 1); $totalarray['nbfield']++; } if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index caf98c7d91c..b629e45cf0d 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -34,7 +34,6 @@ $error = 0; // Load translation files required by the page $langs->loadLangs(array("bills", "accountancy", "compta")); -$mesg = ''; $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $id = GETPOST('id', 'int'); @@ -139,7 +138,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { } else { $result = $object->fetch($id); - $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; + $sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result2 = $db->query($sql); @@ -148,7 +147,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { // Clean code // To manage zero or not at the end of the accounting account - if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { + if (isset($conf->global->ACCOUNTING_MANAGE_ZERO) && $conf->global->ACCOUNTING_MANAGE_ZERO == 1) { $account_number = $account_number; } else { $account_number = clean_account($account_number); @@ -169,13 +168,12 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { $object->labelshort = GETPOST('labelshort', 'alpha'); $result = $object->update($user); - if ($result > 0) { $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id); header("Location: " . $urltogo); exit(); } else { - $mesg = $object->error; + setEventMessages($object->error, null, 'errors'); } } } else { @@ -255,13 +253,17 @@ if ($action == 'create') { print ''; // Chart of accounts type - print '
| '.$langs->trans("Email").' * | |
| '.$langs->trans("Company").' * | |
| '.$langs->trans("Company").' | |
| '.$langs->trans("Address").' | '."\n"; print ' |
| '.$langs->trans('Country').' | '; +print ' |
| '.$langs->trans('Country').'* | '; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); @@ -372,8 +390,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print ' |
| '.$langs->trans("Email").' * |
| '; $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index bdc65fb301b..44d4cf32a5c 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -384,7 +384,7 @@ if (empty($reshook)) { // Fac builddoc $donotredirect = 1; $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -593,10 +593,10 @@ foreach ($search_array_options as $key => $val) { $arrayofmassactions = array( - // 'presend'=>$langs->trans("SendByMail"), + // 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($user->rights->fournisseur->facture->creer) { +if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); } if ($massaction == 'createbills') { diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index b70fd7cd0b6..01ac72065ea 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -155,7 +155,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; - $help_url = ''; + $help_url = 'Module_Agenda_En'; llxHeader('', $title, $help_url); if (!empty($conf->notification->enabled)) { diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 2d736e1564b..24b9f6d4e67 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -218,7 +218,7 @@ if ($object->id) { $relativepathwithnofile = 'recruitmentcandidature/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 515ddfe80c0..8f8ac25c577 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -397,13 +397,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - 'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 0f1bdeef0fc..e8ede6f0bdd 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -218,7 +218,7 @@ if ($object->id) { //$relativepathwithnofile='recruitmentjobposition/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'recruitmentjobposition/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index c28a55e0b2d..99b2e5ade4e 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -400,13 +400,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index fb291a5a4a7..6f4c714fac4 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -141,7 +141,7 @@ if ($object->id > 0) { $modulepart = 'dolresource'; $permission = $user->rights->resource->write; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 5772de8af3a..fddb5259da9 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -134,7 +134,7 @@ if ($object->id) { $modulepart = 'salaries'; $permission = $user->rights->salaries->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 7c4f0a2cec3..d11d4584ad0 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -364,10 +364,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'buildsepa'=>$langs->trans("BuildSepa"), // TODO + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'buildsepa'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("BuildSepa"), // TODO ); -//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 53748c1465a..ea6aaa8d14e 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -186,7 +186,7 @@ abstract class ActionsCardCommon $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 68efa8e694c..c5f93e9f96a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -980,7 +980,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (GETPOST("type") == 'p') { $object->client = 2; } - if (!empty($conf->fournisseur->enabled) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur = 1; } @@ -1282,7 +1282,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ' |
| '; $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { @@ -1585,7 +1585,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { print ' | |||
| '.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).' | '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ' | ||
| '.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' | '; @@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '|||
| '; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { + if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ' | '; @@ -2256,7 +2256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "|||
| '.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).' | '; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); @@ -2460,7 +2460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier code - if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ' | ||
| '; print $langs->trans('SupplierCode').' | '; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); @@ -2667,7 +2667,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Supplier - if (!empty($conf->fournisseur->enabled) && $object->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ' | ||
| '.$langs->trans("SuppliersCategoriesShort").' | '; print ''; print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9d449922dd2..9e234559aad 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -231,8 +231,8 @@ class Societe extends CommonObject 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>435), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440), 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445), - 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>450), - 'fk_warehouse' =>array('type'=>'integer', 'label'=>'warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>455), + 'fk_account' =>array('type'=>'integer', 'label'=>'AccountingAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), + 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>455), 'logo' =>array('type'=>'varchar(255)', 'label'=>'Logo', 'enabled'=>1, 'visible'=>-1, 'position'=>400), 'logo_squarred' =>array('type'=>'varchar(255)', 'label'=>'Logo squarred', 'enabled'=>1, 'visible'=>-1, 'position'=>401), 'status' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), @@ -2636,7 +2636,7 @@ class Societe extends CommonObject } } if (empty($option) || preg_match('/supplier/', $option)) { - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) { $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3190ad5e64e..1ffd1563838 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -192,13 +192,13 @@ if ($object->fournisseur) { $obj = $db->fetch_object($resql); $nbCmdsFourn = $obj->nb; $thirdTypeArray['supplier'] = $langs->trans("supplier"); - if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); } - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) { + if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); } - if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) { + if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) { $elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals'); } } diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 746d1c403c7..4ed26f67018 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -178,7 +178,7 @@ if ($object->id) { $permission = $user->rights->societe->creer; $permtoedit = $user->rights->societe->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 0); } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c87d260f23e..a8a4c454c2c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -118,7 +118,7 @@ if ($result) { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found = 1; $third['customer']++; } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found = 1; $third['supplier']++; } if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { @@ -144,7 +144,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $dataseries[] = array($langs->trans("Customers"), round($third['customer'])); } - if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $dataseries[] = array($langs->trans("Suppliers"), round($third['supplier'])); } if (!empty($conf->societe->enabled)) { @@ -171,7 +171,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $statstring .= ' | '.$langs->trans("Customers").' | '.round($third['customer']).' | '; $statstring .= "
| '.$langs->trans("Suppliers").' | '.round($third['supplier']).' | '; $statstring2 .= "||
| '; print $langs->trans('SupplierCode').' | ';
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 92b43902405..122b881495f 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -112,7 +112,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
// Additional area permissions
$usercanclose = $user->rights->supplier_proposal->cloturer;
-$usercancreateorder = $user->rights->fournisseur->commande->creer;
+$usercancreateorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
// Permissions for includes
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
@@ -1859,7 +1859,7 @@ if ($action == 'create') {
}
// Create an order
- if (!empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) {
+ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($usercancreateorder) {
print '';
}
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 11fb3149aff..1a61ba5620e 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -165,7 +165,7 @@ if ($object->id > 0) {
$permission = $user->rights->supplier_proposal->creer;
$permtoedit = $user->rights->supplier_proposal->creer;
$param = '&id='.$object->id;
- include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
+ include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
print $langs->trans("ErrorUnknown");
}
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 71540aa2f11..4dee1705476 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -508,12 +508,12 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>$langs->trans("ReGeneratePDF"),
- 'builddoc'=>$langs->trans("PDFMerge"),
- //'presend'=>$langs->trans("SendByMail"),
+ 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
+ //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"),
);
if ($user->rights->supplier_proposal->supprimer) {
- $arrayofmassactions['predelete'] = ''.$langs->trans("Delete");
+ $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php
index 12dd2836ea2..e180dc33b3e 100644
--- a/htdocs/takepos/css/pos.css.php
+++ b/htdocs/takepos/css/pos.css.php
@@ -751,7 +751,7 @@ div#moreinfo, div#infowarehouse {
border: none;
color: white;
background-color: #8c907e;
- padding: 14px 28px;
+ padding: 14px 0px;
font-size: 16px;
cursor: pointer;
text-align: center;
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 432afdea73a..4c3ef11294f 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -486,7 +486,8 @@ function FreeZone() {
function TakeposOrderNotes() {
console.log("Open box to order notes");
- $.colorbox({href:"freezone.php?action=addnote&place="+place+"&idline="+selectedline, onClosed: function () { Refresh(); },width:"80%", height:"250px", transition:"none", iframe:"true", title:"trans("OrderNotes"); ?>"});
+ ModalBox('ModalNote');
+ $("#textinput").focus();
}
function Refresh() {
@@ -918,6 +919,20 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
+
+
+
+
+
global->TAKEPOS_ORDER_NOTES == 1) {
- $menus[$r++] = array('title'=>' '.$langs->trans("OrderNotes").' ', 'action'=>'TakeposOrderNotes();');
+ $menus[$r++] = array('title'=>''.$langs->trans("OrderNotes").' ', 'action'=>'TakeposOrderNotes();');
}
if ($conf->global->TAKEPOS_SUPPLEMENTS) {
$menus[$r++] = array('title'=>''.$langs->trans("ProductSupplements").' ', 'action'=>'LoadProducts(\'supplements\');');
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index d73f6499c93..c7a01e5d8bc 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -565,9 +565,9 @@ if ($action == "freezone") {
if ($action == "addnote") {
foreach ($invoice->lines as $line) {
- if ($line->id == $number) {
- $line->array_options['order_notes'] = $desc;
- $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
+ if ($line->id == $idline) {
+ $desc = GETPOST('addnote', 'alpha');
+ $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
}
}
$invoice->fetch($placeid);
@@ -1019,6 +1019,11 @@ function CreditNote() {
});
}
+function SetNote() {
+ $("#poslines").load("invoice.php?action=addnote&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() {
+ });
+}
+
$( document ).ready(function() {
console.log("Set customer info and sales in header placeid= status=statut; ?>");
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 7e0b857eb6d..87a9d6b1b47 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2285,7 +2285,7 @@ li.tmenu:hover {
opacity: .50; /* show only a slight shadow */
}
li.tmenusel a.tmenusel {
- text-decoration: underline !important;
+ text-decoration: underline !important;
}
.tmenuend .tmenuleft { width: 0px; }
.tmenuend { display: none; }
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index d2611e562d2..9bf6cbc13c4 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -40,9 +40,9 @@ $track_id = GETPOST('track_id', 'alpha', 3);
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
-$sortfield = GETPOST("sortfield", "aZ09comma");
-$sortorder = GETPOST("sortorder", 'aZ09comma');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
@@ -133,7 +133,8 @@ $title = $langs->trans("Ticket").' - '.$object->ref.' '.$object->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
}
-$help_url = 'FR:DocumentationModuleTicket';
+$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda';
+
llxHeader('', $title, $help_url);
if ($socid > 0) {
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index b8e0e79eede..740061f99ba 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -196,7 +196,7 @@ if ($object->id) {
$permtoedit = $user->rights->ticket->write;
$param = '&id='.$object->id;
- include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
+ include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
accessforbidden('', 0, 1);
}
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 0c726db3f62..19b352ee936 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -656,17 +656,17 @@ if ($search_dateclose_end) {
// List of mass actions available
$arrayofmassactions = array(
- //'presend'=>$langs->trans("SendByMail"),
- //'builddoc'=>$langs->trans("PDFMerge"),
+ //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
+ //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if ($user->rights->ticket->write) {
- $arrayofmassactions['close'] = $langs->trans("Close");
+ $arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Close");
}
if ($user->rights->ticket->write) {
- $arrayofmassactions['reopen'] = $langs->trans("ReOpen");
+ $arrayofmassactions['reopen'] = img_picto('', 'folder-open', 'class="pictofixedwidth"').$langs->trans("ReOpen");
}
if ($user->rights->ticket->delete) {
- $arrayofmassactions['predelete'] = ''.$langs->trans("Delete");
+ $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
diff --git a/htdocs/user/document.php b/htdocs/user/document.php
index 138408a3c2d..297243f36ef 100644
--- a/htdocs/user/document.php
+++ b/htdocs/user/document.php
@@ -179,7 +179,7 @@ if ($object->id) {
$permission = $user->rights->user->user->creer;
$permtoedit = $user->rights->user->user->creer;
$param = '&id='.$object->id;
- include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
+ include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
accessforbidden('', 0, 1);
}
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index eeb7118bb2e..c18b13a5bf8 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -525,15 +525,15 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array();
if ($permissiontoadd) {
- $arrayofmassactions['disable'] = $langs->trans("DisableUser");
+ $arrayofmassactions['disable'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("DisableUser");
}
if ($permissiontoadd) {
- $arrayofmassactions['reactivate'] = $langs->trans("Reactivate");
+ $arrayofmassactions['reactivate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Reactivate");
}
if ($permissiontoadd) {
- $arrayofmassactions['preaffecttag'] = ''.$langs->trans("AffectTag");
+ $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
}
-//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete");
+//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
$arrayofmassactions = array();
diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php
index 40265496dbf..c4141a7ac61 100755
--- a/htdocs/workstation/workstation_list.php
+++ b/htdocs/workstation/workstation_list.php
@@ -398,13 +398,13 @@ $param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(
- //'validate'=>$langs->trans("Validate"),
- //'generate_doc'=>$langs->trans("ReGeneratePDF"),
- //'builddoc'=>$langs->trans("PDFMerge"),
- //'presend'=>$langs->trans("SendByMail"),
+ //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
+ //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
+ //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if ($permissiontodelete) {
- $arrayofmassactions['predelete'] = ''.$langs->trans("Delete");
+ $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
| ||