diff --git a/.tx/config b/.tx/config index 0dea31a14d0..0044fb91f49 100644 --- a/.tx/config +++ b/.tx/config @@ -236,6 +236,12 @@ source_file = htdocs/langs/en_US/modulebuilder.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.mrp] +file_filter = htdocs/langs//mrp.lang +source_file = htdocs/langs/en_US/mrp.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.multicurrency] file_filter = htdocs/langs//multicurrency.lang source_file = htdocs/langs/en_US/multicurrency.lang diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index f551cf3e716..e0b8c6f70c2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -307,11 +307,11 @@ if ($resql) print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder); - if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, 'align="left"', $sortfield, $sortorder); + if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left '); 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']); if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_subtype', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_subtype']['help']); if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; $accountstatic = new AccountingAccount($db); @@ -403,7 +403,7 @@ if ($resql) } // Action - print ''; + print ''; if ($user->rights->accounting->chartofaccount) { print ''; print img_edit(); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 9f31fa663ed..36ecf11a4c7 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -532,8 +532,8 @@ if ($id) if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } if ($valuetoshow != '') { - print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { + print ''; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; } elseif (! empty($tabhelp[$id][$value])) { print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); @@ -662,23 +662,29 @@ if ($id) */ $valuetoshow=ucfirst($fieldlist[$field]); // By defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') - { - $valuetoshow=$langs->trans("Label"); - if ($id != 25) $valuetoshow.="*"; - } - if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='country_id') { $showfield=0; } - if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } + if ($fieldlist[$field]=='code') { + $valuetoshow=$langs->trans("Code"); + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { + $valuetoshow=$langs->trans("Label"); + if ($id != 25) $valuetoshow.="*"; + } + if ($fieldlist[$field]=='country') { + $valuetoshow=$langs->trans("Country"); + } + if ($fieldlist[$field]=='country_id') { + $showfield=0; + } + if ($fieldlist[$field]=='fk_pcg_version') { + $valuetoshow=$langs->trans("Pcg_version"); + } // Affiche nom du champ - if ($showfield) - { - print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder); + if ($showfield) { + print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "", $sortfield, $sortorder, $class.' '); } } - print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder); + print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList(''); print getTitleFieldOfList(''); print ''; @@ -757,7 +763,7 @@ if ($id) $class='tddict'; if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto'; // Show value for field - if ($showfield) print ''.$valuetoshow.''; + if ($showfield) print ''.$valuetoshow.''; } } @@ -769,17 +775,17 @@ if ($id) $url.='&'; // Active - print ''; + print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; else print $langs->trans("AlwaysActive"); print ""; // Modify link - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; else print ' '; // Delete link - if ($iserasable) print ''.img_delete().''; + if ($iserasable) print ''.img_delete().''; else print ' '; print "\n"; @@ -852,7 +858,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = } } elseif ($fieldlist[$field] == 'type_cdr') { - if ($fieldlist[$field] == 'type_cdr') print ''; + if ($fieldlist[$field] == 'type_cdr') print ''; else print ''; if ($fieldlist[$field] == 'type_cdr') { print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 7cb7d7d27f2..3a55e092d94 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -41,8 +41,7 @@ $rowid=GETPOST('rowid', 'alpha'); $code=GETPOST('code', 'alpha'); // Security access -if (empty($user->rights->accounting->chartofaccount)) -{ +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -468,29 +467,46 @@ if ($id) $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $class="left"; - if ($fieldlist[$field]=='type') { - if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); - else $valuetoshow=$langs->trans("Type"); + if ($fieldlist[$field]=='type') { + if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") { + $valuetoshow=$form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); + } else { + $valuetoshow=$langs->trans("Type"); + } } - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') - { + if ($fieldlist[$field]=='code') { + $valuetoshow=$langs->trans("Code"); + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments"); } - if ($fieldlist[$field]=='country') { + if ($fieldlist[$field]=='libelle_facture') { + $valuetoshow=$langs->trans("LabelOnDocuments"); + } + if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } - if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); } - if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); } - if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } - if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } + if ($fieldlist[$field]=='accountancy_code') { + $valuetoshow=$langs->trans("AccountancyCode"); + } + if ($fieldlist[$field]=='accountancy_code_sell') { + $valuetoshow=$langs->trans("AccountancyCodeSell"); + } + if ($fieldlist[$field]=='accountancy_code_buy') { + $valuetoshow=$langs->trans("AccountancyCodeBuy"); + } + if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { + $valuetoshow=$langs->trans("Pcg_version"); + } + if ($fieldlist[$field]=='range_account') { + $valuetoshow=$langs->trans("Comment"); + } + if ($fieldlist[$field]=='category_type') { + $valuetoshow=$langs->trans("Calculated"); + } - if ($valuetoshow != '') - { - print ''; + if ($valuetoshow != '') { + print ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; @@ -591,7 +607,7 @@ if ($id) print ''; print ''; print ''; - print ''; + print ''; if ($filterfound) { $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -613,38 +629,73 @@ if ($id) $valuetoshow=ucfirst($fieldlist[$field]); // By defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } - if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } - if ($fieldlist[$field]=='taux') { - if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate"); - else $valuetoshow=$langs->trans("Amount"); - $align='center'; + if ($fieldlist[$field]=='source') { + $valuetoshow=$langs->trans("Contact"); } - if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') - { + if ($fieldlist[$field]=='price') { + $valuetoshow=$langs->trans("PriceUHT"); + } + if ($fieldlist[$field]=='taux') { + if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") { + $valuetoshow=$langs->trans("Rate"); + } else { + $valuetoshow=$langs->trans("Amount"); + } + $class='center'; + } + if ($fieldlist[$field]=='type') { + $valuetoshow=$langs->trans("Type"); + } + if ($fieldlist[$field]=='code') { + $valuetoshow=$langs->trans("Code"); + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); } - if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; } - if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; } - if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); } - if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); } - if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } - if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } - if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } + if ($fieldlist[$field]=='country') { + $valuetoshow=$langs->trans("Country"); + } + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { + $showfield=0; + } + if ($fieldlist[$field]=='accountancy_code') { + $valuetoshow=$langs->trans("AccountancyCode"); + } + if ($fieldlist[$field]=='accountancy_code_sell') { + $valuetoshow=$langs->trans("AccountancyCodeSell"); + $sortable=0; + } + if ($fieldlist[$field]=='accountancy_code_buy') { + $valuetoshow=$langs->trans("AccountancyCodeBuy"); + $sortable=0; + } + if ($fieldlist[$field]=='fk_pcg_version') { + $valuetoshow=$langs->trans("Pcg_version"); + } + if ($fieldlist[$field]=='account_parent') { + $valuetoshow=$langs->trans("Accountsparent"); + } + if ($fieldlist[$field]=='pcg_type') { + $valuetoshow=$langs->trans("Pcg_type"); + } + if ($fieldlist[$field]=='pcg_subtype') { + $valuetoshow=$langs->trans("Pcg_subtype"); + } + if ($fieldlist[$field]=='type_template') { + $valuetoshow=$langs->trans("TypeOfTemplate"); + } + if ($fieldlist[$field]=='range_account') { + $valuetoshow=$langs->trans("Comment"); + } + if ($fieldlist[$field]=='category_type') { + $valuetoshow=$langs->trans("Calculated"); + } // Affiche nom du champ - if ($showfield) - { - print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder); + if ($showfield) { + print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "", $sortfield, $sortorder, $class.' '); } } - print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder); + print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList(''); print getTitleFieldOfList(''); print getTitleFieldOfList(''); @@ -670,7 +721,7 @@ if ($id) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -732,7 +783,7 @@ if ($id) $class='tddict'; // Show value for field - if ($showfield) print ''.$valuetoshow.''; + if ($showfield) print ''.$valuetoshow.''; } } @@ -750,7 +801,7 @@ if ($id) $url.='&'; // Active - print ''; + print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; else { @@ -759,13 +810,13 @@ if ($id) print ""; // Modify link - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; else print ' '; // Delete link if ($iserasable) { - print ''; + print ''; if ($user->admin) print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ''; diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index 8093a2fa883..ff559332316 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $langs->loadLangs(array("compta","admin","accountancy")); // Security check -if (empty($user->rights->accounting->chartofaccount)) -{ +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } @@ -112,7 +111,7 @@ foreach ($list_account_main as $key) { print $form->textwithpicto($label, $htmltext); print ''; // Value - print ''; // Do not force align=right, or it align also the content of the select box + print ''; // Do not force class=right, or it align also the content of the select box print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); print ''; print ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 5b39a38657f..4ea9ff9139a 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -156,7 +156,7 @@ foreach ($list_account_main as $key) { print $form->textwithpicto($label, $htmltext); print ''; // Value - print ''; // Do not force align=right, or it align also the content of the select box + print ''; // Do not force class=right, or it align also the content of the select box print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); print ''; print ''; @@ -179,7 +179,7 @@ foreach ($list_account as $key) { $label = $langs->trans($key); print '' . $label . ''; // Value - print ''; // Do not force align=right, or it align also the content of the select box + print ''; // Do not force class=right, or it align also the content of the select box print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); print ''; print ''; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 78fe73322f2..795edda5f4c 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -131,8 +131,8 @@ if ($result) print '' . $langs->trans("Label") . ''; print '' . $langs->trans("DateStart") . ''; print '' . $langs->trans("DateEnd") . ''; - print '' . $langs->trans("NumberOfAccountancyEntries") . ''; - print '' . $langs->trans("NumberOfAccountancyMovements") . ''; + print '' . $langs->trans("NumberOfAccountancyEntries") . ''; + print '' . $langs->trans("NumberOfAccountancyMovements") . ''; print '' . $langs->trans("Statut") . ''; print ''; @@ -147,8 +147,8 @@ if ($result) print '' . $obj->label . ''; print '' . dol_print_date($db->jdate($obj->date_start), 'day') . ''; print '' . dol_print_date($db->jdate($obj->date_end), 'day') . ''; - print '' . $object->getAccountancyEntriesByFiscalYear($obj->date_start, $obj->date_end) . ''; - print '' . $object->getAccountancyMovementsByFiscalYear($obj->date_start, $obj->date_end) . ''; + print '' . $object->getAccountancyEntriesByFiscalYear($obj->date_start, $obj->date_end) . ''; + print '' . $object->getAccountancyMovementsByFiscalYear($obj->date_start, $obj->date_end) . ''; print '' . $fiscalyearstatic->LibStatut($obj->statut, 5) . ''; print ''; $i++; diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 1efebf5c234..c8cf0aa9901 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -132,7 +132,7 @@ if ($result) { print '' . $langs->trans("Accountparent") . ''; print '' . $langs->trans("Pcgtype") . ''; print '' . $langs->trans("Pcgsubtype") . ''; - print '' . $langs->trans("Import") . ''; + print '' . $langs->trans("Import") . ''; print ''; $form = new Form($db); @@ -166,7 +166,7 @@ if ($result) { // Colonne choix ligne a ventiler $checked = ('label' == 'O') ? ' checked' : ''; - print ''; + print ''; print ''; print ''; @@ -174,7 +174,7 @@ if ($result) { $i ++; } - print ' '; + print ' '; print ''; print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 1e623c23860..996aa8500d2 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -430,16 +430,18 @@ if ($id) $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $class="left"; - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') - { + if ($fieldlist[$field]=='code') { + $valuetoshow=$langs->trans("Code"); + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); } + if ($fieldlist[$field]=='nature') { + $valuetoshow=$langs->trans("Nature"); + } - if ($valuetoshow != '') - { - print ''; + if ($valuetoshow != '') { + print ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; @@ -549,17 +551,22 @@ if ($id) */ $valuetoshow=ucfirst($fieldlist[$field]); // By defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } - if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); } + if ($fieldlist[$field]=='code') { + $valuetoshow=$langs->trans("Code"); + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { + $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='nature') { + $valuetoshow=$langs->trans("Nature"); + } // Affiche nom du champ - if ($showfield) - { - print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder); + if ($showfield) { + print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "", $sortfield, $sortorder, $class.' '); } } - print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder); + print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList(''); print getTitleFieldOfList(''); print getTitleFieldOfList(''); @@ -621,7 +628,7 @@ if ($id) $class='tddict'; // Show value for field - if ($showfield) print ''.$valuetoshow.''; + if ($showfield) print ''.$valuetoshow.''; } } @@ -696,11 +703,11 @@ $db->close(); /** * Show fields in insert/edit mode * - * @param array $fieldlist Array of fields - * @param Object $obj If we show a particular record, obj is filled with record fields - * @param string $tabname Name of SQL table - * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered - * @return void + * @param array $fieldlist Array of fields + * @param Object $obj If we show a particular record, obj is filled with record fields + * @param string $tabname Name of SQL table + * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered + * @return void */ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '') { diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index a81aa472ef7..df8ce99fa10 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -307,7 +307,7 @@ if ($result) print ''.$langs->trans('OptionModeProductBuyDesc')."\n"; print "\n"; - print '
'; + print '
'; print "
\n"; @@ -338,7 +338,7 @@ if ($result) print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1); print ''; print ' '; - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -348,14 +348,14 @@ if ($result) print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); - if ($accounting_product_mode == 'ACCOUNTANCY_SELL') print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder); - if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder); + if ($accounting_product_mode == 'ACCOUNTANCY_SELL') print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center '); + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center '); if ($accounting_product_mode == 'ACCOUNTANCY_BUY') $fieldtosortaccount="p.accountancy_code_buy"; else $fieldtosortaccount="p.accountancy_code_sell"; print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AssignDedicatedAccountingAccount"); $clickpitco=$form->showCheckAddButtons('checkforselect', 1); - print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"'); + print_liste_field_titre($clickpitco, '', '', '', '', '', '', '', 'center '); print ''; $product_static = new Product($db); @@ -408,10 +408,10 @@ if ($result) } if ($accounting_product_mode == 'ACCOUNTANCY_SELL') - print ''.$product_static->getLibStatut(3, 0).''; + print ''.$product_static->getLibStatut(3, 0).''; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') - print ''.$product_static->getLibStatut(3, 1).''; + print ''.$product_static->getLibStatut(3, 1).''; // Current accounting account print ''; @@ -450,7 +450,7 @@ if ($result) } // Checkbox select - print ''; + print ''; print ''; print ""; $i ++; @@ -485,7 +485,7 @@ if ($result) '; - print '
'; + print '
'; print ''; diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 4da7865624e..6d2c7644d85 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -248,7 +248,7 @@ if ($action != 'export_csv') print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder); print "\n"; $total_debit = 0; @@ -296,7 +296,7 @@ if ($action != 'export_csv') print '' . price($line->debit) . ''; print '' . price($line->credit) . ''; print '' . price($line->credit - $line->debit) . ''; - print '' . $link; + print '' . $link; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 7b9bf25c589..edf7383b595 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -73,19 +73,19 @@ $y = $year_current; print ''; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; $sql = "SELECT bk.numero_compte AS 'compte',"; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 7e3d3a6e68d..b3367ad1b8e 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -604,7 +604,7 @@ if ($action == 'create') print_liste_field_titre("LabelOperation"); print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); - print_liste_field_titre("Action", "", "", "", "", 'width="60" align="center"'); + print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); print "\n"; @@ -644,7 +644,7 @@ if ($action == 'create') print ''; print ''; - print '\n"; print ''; if (! empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'class="center"', $sortfield, $sortorder); -if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); -if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); -if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); +if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); +if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); +if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); +if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); +if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 33c7deb0cfd..8988491c927 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -286,7 +286,7 @@ print $formaccounting->select_account($search_accountancy_code_end, 'search_acco print ''; print ''; print ''; -print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'class="right"', $sortfield, $sortorder); -print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder, 'right '); +print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); -print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); +print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60"', $sortfield, $sortorder, 'center '); print "\n"; print ''; @@ -364,7 +364,7 @@ while ($i < min($num, $limit)) print ''; print ''; print ''; - print ''; + print ''; // TODO Add a link according to doc_type and fk_doc print ''; + print ''; - print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 9bef7a1c4fc..1a91f2dafbb 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -238,12 +238,12 @@ if ($resql) { print ''; print ''; print ''; - print ''; + print ''; if (empty($obj->lettering_code)) { - print ''; + print ''; } else - print ''; + print ''; print "\n"; } diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index bf2b8d4f948..df1d4317252 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -240,12 +240,12 @@ if ($resql) { print ''; print ''; print ''; - print ''; + print ''; if (empty($obj->lettering_code)) { - print ''; + print ''; } else - print ''; + print ''; print "\n"; } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index dbd0f680db7..f7a53c9e210 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -309,7 +309,9 @@ if ($result) { print ''; print ''; print ''; @@ -323,8 +325,8 @@ if ($result) { //print ''; print ''; print ''; - print ''; - print ''; + print '\n"; @@ -332,17 +334,17 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center '); $clickpicto=$form->showCheckAddButtons(); - print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center '); print "\n"; $facture_static = new Facture($db); @@ -368,7 +370,7 @@ if ($result) { // Ref Invoice print ''; - print ''; + print ''; // Ref Product print ''; - print ''; print ''; print ''; @@ -392,7 +394,7 @@ if ($result) { print ''; print ''; print ''; - print ''; @@ -401,19 +403,19 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); - print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"'); + print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center '); + print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center '); $checkpicto=''; if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1); - print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; $facture_static = new Facture($db); @@ -482,7 +484,7 @@ if ($result) { // Ref Invoice print ''; - print ''; + print ''; // Ref Product print ''; // Current account - print ''; // Suggested accounting account - print ''; // Column with checkbox - print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 5dbacd501b9..3a322c07ef3 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -270,7 +270,7 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); print_liste_field_titre(''); $checkpicto=$form->showCheckAddButtons(); - print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; $expensereport_static = new ExpenseReport($db); @@ -309,7 +309,7 @@ if ($result) { // Ref Invoice print ''; - print ''; + print ''; print ''; @@ -321,7 +321,7 @@ if ($result) { print ''; - print ''; + print ''; print ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 9d28206a91e..a6bec0246a0 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -319,7 +319,7 @@ if ($result) { print ''; print ''; print ''; - print ''; @@ -328,16 +328,16 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("IntoAccount", '', '', '', '', '', $sortfield, $sortorder, 'center '); $checkpicto=''; if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1); - print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; @@ -362,7 +362,7 @@ if ($result) { print ''; // Date - print ''; + print ''; // Fees label print ''; // Current account - print ''; // Suggested accounting account - print ''; - print ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 0c5ba39bd94..275af10701d 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -994,8 +994,8 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print "\n"; $r = ''; @@ -1044,8 +1044,8 @@ if (empty($action) || $action == 'view') { print $reflabel; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; } } @@ -1126,8 +1126,8 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; } } @@ -1163,8 +1163,8 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print ""; } } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 1c687fb98cc..4af51060b4b 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -328,8 +328,8 @@ if ($result) { // print ''; print ''; print ''; - print ''; - print ''; + print ''; @@ -339,17 +339,17 @@ if ($result) { print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center '); $checkpicto=$form->showCheckAddButtons(); - print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; $facturefournisseur_static = new FactureFournisseur($db); @@ -380,7 +380,7 @@ if ($result) { print $objp->invoice_label; print ''; - print ''; + print ''; // Ref product print ''; - print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index f864824c740..156f98fc6a2 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -392,7 +392,7 @@ if ($result) { print ''; print ''; print ''; - print ''; @@ -402,19 +402,19 @@ if ($result) { print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); - print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"'); + print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center '); + print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center '); $checkpicto=''; if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1); - print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); + print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; $facturefourn_static = new FactureFournisseur($db); @@ -475,7 +475,7 @@ if ($result) { print $objp->invoice_label; print ''; - print ''; + print ''; // Ref product print ''; // Current account - print ''; // Suggested accounting account - print ''; // Column with checkbox - print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6308857f958..77f3c7200f4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1281,9 +1281,12 @@ class Adherent extends CommonObject $this->public = $obj->public; $this->datec = $this->db->jdate($obj->datec); + $this->date_creation = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); + $this->date_modification= $this->db->jdate($obj->datem); $this->datefin = $this->db->jdate($obj->datefin); $this->datevalid = $this->db->jdate($obj->datev); + $this->date_validation = $this->db->jdate($obj->datev); $this->birth = $this->db->jdate($obj->birthday); $this->note_private = $obj->note_private; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php new file mode 100644 index 00000000000..b7f1f0e6db9 --- /dev/null +++ b/htdocs/admin/bom.php @@ -0,0 +1,560 @@ + + * + * 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/admin/bom.php + * \ingroup bom + * \brief Setup page of module BOM + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array('admin', 'errors', 'mrp', 'other')); + +if (! $user->admin) accessforbidden(); + +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'bom'; + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +if ($action == 'updateMask') +{ + $maskconstbom=GETPOST('maskconstBom', 'alpha'); + $maskbom=GETPOST('maskBom', 'alpha'); + + if ($maskconstbom) $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +elseif ($action == 'specimen') +{ + $modele=GETPOST('module', 'alpha'); + + $bom = new BOM($db); + $bom->initAsSpecimen(); + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + $file=dol_buildpath($reldir."core/modules/bom/doc/pdf_".$modele.".modules.php", 0); + if (file_exists($file)) + { + $filefound=1; + $classname = "pdf_".$modele; + break; + } + } + + if ($filefound) + { + require_once $file; + + $module = new $classname($db); + + if ($module->write_file($bom, $langs) > 0) + { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf"); + return; + } + else + { + setEventMessages($module->error, null, 'errors'); + dol_syslog($module->error, LOG_ERR); + } + } + else + { + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); + dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); + } +} + +// Activate a model +elseif ($action == 'set') +{ + $ret = addDocumentModel($value, $type, $label, $scandir); +} + +elseif ($action == 'del') +{ + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->BOM_ADDON_PDF == "$value") dolibarr_del_const($db, 'BOM_ADDON_PDF', $conf->entity); + } +} + +// Set default model +elseif ($action == 'setdoc') +{ + if (dolibarr_set_const($db, "BOM_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + { + // The constant that was read before the new set + // We therefore requires a variable to have a coherent view + $conf->global->BOM_ADDON_PDF = $value; + } + + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } +} + +elseif ($action == 'setmod') +{ + // TODO Check if numbering module chosen can be activated + // by calling method canBeActivated + + dolibarr_set_const($db, "BOM_ADDON", $value, 'chaine', 0, '', $conf->entity); +} + +elseif ($action == 'set_BOM_DRAFT_WATERMARK') +{ + $draft = GETPOST("BOM_DRAFT_WATERMARK"); + $res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +elseif ($action == 'set_BOM_FREE_TEXT') +{ + $freetext = GETPOST("BOM_FREE_TEXT", 'none'); // No alpha here, we want exact string + + $res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action=="setshippableiconinlist") { + // Activate Set Shippable Icon In List + $setshippableiconinlist = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SHIPPABLE_BOM_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); + if (! $res > 0) $error++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +/* + * View + */ + +$form=new Form($db); + +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); + +llxHeader("", $langs->trans("BOMsSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); + +$head = bomAdminPrepareHead(); + +dol_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom'); + +/* + * BOMs Numbering model + */ + +print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', ''); + +print '
' . $langs->trans("Label") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . 'Total' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . 'Total
' . price($line->debit) . '' . price($line->credit) . ''; + print ''; print 'id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">'; print img_edit(); print '  '; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index bc4b815100b..c1716dc18af 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -606,18 +606,18 @@ print "
'; +print ''; print $langs->trans('From') . ': '; print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1); print '
'; @@ -297,7 +297,7 @@ print '
'; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; @@ -305,14 +305,14 @@ print '
 '.$line->piece_num.'' . dol_print_date($line->doc_date, 'day') . '' . dol_print_date($line->doc_date, 'day') . ''; @@ -384,9 +384,9 @@ while ($i < min($num, $limit)) $accountingjournal = new AccountingJournal($db); $result = $accountingjournal->fetch('', $line->code_journal); $journaltoshow = (($result > 0)?$accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); - print '' . $journaltoshow . '' . $journaltoshow . ''; + print ''; print '' . img_edit() . ' '; print '' . img_delete() . ''; print '' . price($obj->debit) . '' . price($obj->credit) . '' . price(round($solde, 2)) . '' . $obj->code_journal . '' . $obj->code_journal . '' . $obj->lettering_code . '' . $obj->lettering_code . '
' . price($obj->debit) . '' . price($obj->credit) . '' . price(round($solde, 2)) . '' . $obj->code_journal . '' . $obj->code_journal . '' . $obj->lettering_code . '' . $obj->lettering_code . '
'; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { + print ''; + } print ''; $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print "
' . $facture_static->getNomUrl(1) . '' . dol_print_date($db->jdate($objp->datef), 'day') . '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; @@ -391,7 +393,7 @@ if ($result) { print '' . $objp->tva_intra . ''; + print ''; print $codecompta . ' '; print img_edit(); print ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 6a7d59a46ce..3d6469f6961 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -376,7 +376,9 @@ if ($result) { print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { + print ''; + } print ''; $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
' . $facture_static->getNomUrl(1) . '' . dol_print_date($db->jdate($objp->datef), 'day') . '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; @@ -513,7 +515,7 @@ if ($result) { print '' . $objp->tva_intra . ''; + print ''; print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("Unknown")); if ($objp->product_id > 0) { @@ -523,12 +525,12 @@ if ($result) { print ''; + print ''; print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; + print ''; print 'aarowid ? "checked" : "") . '/>'; print ''; @@ -282,15 +282,15 @@ if ($result) { print '
' . $expensereport_static->getNomUrl(1) . '' . dol_print_date($db->jdate($objp->date), 'day') . '' . dol_print_date($db->jdate($objp->date), 'day') . '' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . '' . price($objp->total_ht) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . $codeCompta . ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
' . $expensereport_static->getNomUrl(1) . '' . dol_print_date($db->jdate($objp->date), 'day') . '' . dol_print_date($db->jdate($objp->date), 'day') . ''; @@ -386,16 +386,16 @@ if ($result) { print ''; + print ''; print length_accountg(html_entity_decode($objp->code_buy)); print ''; + print ''; print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; + print ''; print 'aarowid ? "checked" : "") . '/>'; print '" . $langs->trans("SubledgerAccount") . "" . $langs->trans("LabelOperation") . "" . $langs->trans("PaymentMode") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $val["type_payment"] . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "
" . $reflabel . "" . $val["type_payment"] . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
" . $reflabel . "" . $val["type_payment"] . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
'; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
' . dol_print_date($db->jdate($objp->datef), 'day') . '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; @@ -404,7 +404,7 @@ if ($result) { print '' . $objp->tva_intra . ''; + print ''; print $codecompta . ' '; print img_edit(); print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
' . dol_print_date($db->jdate($objp->datef), 'day') . '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; @@ -506,7 +506,7 @@ if ($result) { print '' . $objp->tva_intra . ''; + print ''; print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("Unknown")); if ($objp->product_id > 0) { @@ -516,12 +516,12 @@ if ($result) { print ''; + print ''; print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; + print ''; print 'aarowid ? "checked" : "") . '/>'; print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''."\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/bom/"); + + if (is_dir($dir)) + { + $handle = opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 8) == 'mod_bom_' && substr($file, dol_strlen($file)-3, 3) == 'php') + { + $file = substr($file, 0, dol_strlen($file)-4); + + require_once $dir.$file.'.php'; + + $module = new $file($db); + + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + if ($module->isEnabled()) + { + + print ''; + + // Show example of numbering model + print ''."\n"; + + print ''; + + $bom=new BOM($db); + $bom->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $bom->type=0; + $nextval=$module->getNextValue($mysoc, $bom); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip.=$nextval.'
'; + } else { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + + print ''; + + print "\n"; + } + } + } + closedir($handle); + } + } +} +print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$module->name."\n"; + print $module->info(); + print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + if ($conf->global->BOM_ADDON == $file) + { + print img_picto($langs->trans("Activated"), 'switch_on'); + } + else + { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '

\n"; + + +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + /* + * Document templates generators + */ + + print load_fiche_titre($langs->trans("BOMsModelModule"), '', ''); + + // Load array def with activated templates + $def = array(); + $sql = "SELECT nom"; + $sql.= " FROM ".MAIN_DB_PREFIX."document_model"; + $sql.= " WHERE type = '".$type."'"; + $sql.= " AND entity = ".$conf->entity; + $resql=$db->query($sql); + if ($resql) + { + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } + } + else + { + dol_print_error($db); + } + + + print "\n"; + print "\n"; + print ''; + print ''; + print '\n"; + print '\n"; + print ''; + print ''; + print "\n"; + + clearstatcache(); + + foreach ($dirmodels as $reldir) + { + foreach (array('','/doc') as $valdir) + { + $dir = dol_buildpath($reldir."core/modules/bom".$valdir); + + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); + + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) + { + + if (file_exists($dir.'/'.$file)) + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + require_once $dir.'/'.$file; + $module = new $classname($db); + + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) + { + $var = !$var; + print ''; + + // Active + if (in_array($name, $def)) + { + print ''; + } + else + { + print '"; + } + + // Default + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); + //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1); + + + print ''; + + // Preview + print ''; + + print "\n"; + } + } + } + } + } + } + } + } + + print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print ''."\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print "'; + if ($conf->global->BOM_ADDON_PDF == $name) + { + print img_picto($langs->trans("Default"), 'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"), 'bill').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print '
'; + print "
"; + + /* + * Other options + */ + + print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + print ''; + print ''; + print ''; + print ''; + print "\n"; + print "\n"; + + $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); + $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); + $htmltext = ''.$langs->trans("AvailableVariables").':
'; + foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; + $htmltext.='
'; + + print ''; + print ''; + print ''; + print '\n"; + print ''; + + //Use draft Watermark + + print ""; + print ''; + print ""; + print '\n"; + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; + print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; + $variablename='BOM_FREE_TEXT'; + if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) + { + print ''; + } + else + { + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); + } + print '
'; + print ''; + print "
'; + print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; + print '
'; + print ''; + print ''; + print ''; + print "
'; + print '
'; +} + +/* + * Notifications + */ +/* +print load_fiche_titre($langs->trans("Notifications"), '', ''); +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print '\n"; + +print '
'.$langs->trans("Parameter").' 
'; +print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; +print '
'; +print "
'; +*/ + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 1f3e23e05d6..455175220a8 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -300,7 +300,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - print ''.$module->nom."\n"; + print ''.$module->name."\n"; print $module->info(); print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9d4d5f88bb9..6c3ed1f294b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -212,7 +212,7 @@ if (is_resource($handle)) { while (($file = readdir($handle))!==false) { - if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i', $file, $reg)) + if (preg_match('/(modGeneratePass[a-z]+)\.class\.php$/i', $file, $reg)) { // Charging the numbering class $classname = $reg[1]; @@ -398,7 +398,6 @@ print ''.$langs->trans("Action").''; print ''; // Disable clear password in database - print ''; print ''.$langs->trans("DoNotStoreClearPassword").''; print ''; @@ -413,6 +412,8 @@ if (! $conf->global->DATABASE_PWD_ENCRYPTED) print ''.$langs->trans("Activate").''; print ""; } + +// Database conf file encryption if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) { print ''; @@ -494,9 +495,21 @@ print ''; print ''; print ''; +print '
'; - -//print ''; +if (GETPOST('info','int') > 0) +{ + if (function_exists('password_hash')) + { + print $langs->trans("Note: The function password_hash exists on your PHP")."
\n"; + } + else + { + print $langs->trans("Note: The function password_hash does not exists on your PHP")."
\n"; + } + print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."
\n"; + print 'MAIN_SECURITY_SALT = '.$conf->global->MAIN_SECURITY_SALT."
\n"; +} print ''; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index f94117ef747..052e11f1ced 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -19,7 +19,7 @@ /** * \file admin/ticket.php * \ingroup ticket - * \brief This file is a module setup page + * \brief Page to setup module ticket */ require '../main.inc.php'; @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; // Load translation files required by the page -$langs->load("ticket"); +$langs->loadLangs(array("admin", "ticket")); // Access control if (!$user->admin) { @@ -91,16 +91,6 @@ if ($action == 'updateMask') { $error++; } - $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha'); - if (!empty($mail_new_ticket)) { - $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity); - } - if (!$res > 0) { - $error++; - } - $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha'); if (!empty($mail_intro)) { $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity); @@ -121,36 +111,6 @@ if ($action == 'updateMask') { $error++; } - $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha'); - if (!empty($mail_signature)) { - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); - } - if (!$res > 0) { - $error++; - } - - $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha'); - if (!empty($mail_signature)) { - $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity); - } - if (!$res > 0) { - $error++; - } - - $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha'); - if (!empty($mail_signature)) { - $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity); - } - if (!$res > 0) { - $error++; - } - $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha'); if (!empty($text_help)) { $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity); @@ -163,26 +123,14 @@ if ($action == 'updateMask') { } if ($action == 'setvarother') { - $param_enable_public_interface = GETPOST('TICKET_ENABLE_PUBLIC_INTERFACE', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', $param_enable_public_interface, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } - $param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity); if (!$res > 0) { $error++; } - $param_disable_email = GETPOST('TICKET_DISABLE_ALL_MAILS', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_DISABLE_ALL_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } - - $param_activate_log_by_email = GETPOST('TICKET_ACTIVATE_LOG_BY_EMAIL', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_ACTIVATE_LOG_BY_EMAIL', $param_activate_log_by_email, 'chaine', 0, '', $conf->entity); + $param_disable_email = GETPOST('TICKET_DISABLE_NOTIFICATION_MAILS', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_DISABLE_NOTIFICATION_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity); if (!$res > 0) { $error++; } @@ -242,9 +190,7 @@ $head = ticketAdminPrepareHead(); dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket"); -print $langs->trans("TicketSetupDictionaries") . ' : ' . dol_buildpath('/admin/dict.php', 2) . '
'; - -print $langs->trans("TicketPublicAccess") . ' : ' . dol_buildpath('/public/ticket/index.php', 2) . ''; +print ''.$langs->trans("TicketSetupDictionaries") . ' : ' . dol_buildpath('/admin/dict.php', 2) . '
'; dol_fiche_end(); @@ -353,80 +299,19 @@ if (!$conf->use_javascript_ajax) { print ''; print ''; } -print load_fiche_titre($langs->trans("TicketParamPublicInterface")); - -print ''; - -// Activate public interface -print ''; -print ''; -print ''; -print ''; - -// Check if email exists -print ''; -print ''; -print ''; -print ''; - -/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) -{ - // Show logo for module - print ''; - print ''; - print ''; - print ''; -}*/ - -// Show logo for company -print ''; -print ''; -print ''; -print ''; - -print '
' . $langs->trans("TicketsActivatePublicInterface") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_ENABLE_PUBLIC_INTERFACE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_ENABLE_PUBLIC_INTERFACE", $arrval, $conf->global->TICKET_ENABLE_PUBLIC_INTERFACE); -} -print ''; -print $form->textwithpicto('', $langs->trans("TicketsActivatePublicInterfaceHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsEmailMustExist") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_EMAIL_MUST_EXISTS", $arrval, $conf->global->TICKET_EMAIL_MUST_EXISTS); -} -print ''; -print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsShowModuleLogo") . ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKET_SHOW_MODULE_LOGO); - } - print ''; - print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); - print '
' . $langs->trans("TicketsShowCompanyLogo") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, $conf->global->TICKET_SHOW_COMPANY_LOGO); -} -print ''; -print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help'); -print '

'; print load_fiche_titre($langs->trans("TicketParams")); print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + // Activate email notifications -print ''; +/* +print ''; print ''; print ''; // Activate log by email -print ''; +print ''; print ''; print ''; +*/ // Also send to main email address if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print ''; + print ''; print ''; +/* +print ''; print ''; print ''; +*/ -if (!$conf->use_javascript_ajax) { +/*if (!$conf->use_javascript_ajax) { print ''; print ''; -} +}*/ // Auto assign ticket at user who created it -print ''; +print ''; print ''; -print ''; -print ''; +print '
'; +print ''; +print '
'; -// Interface topic -$url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC; -print ''; -print ''; -print ''; - -// Texte d'accueil homepage -$public_text_home = $conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans('TicketPublicInterfaceTextHome'); -print ''; -print ''; - -// Texte d'aide à la saisie du message -$public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'); -print ''; -print ''; - -print ''; -print ''; - -print '
' . $langs->trans("Parameter") . '
' . $langs->trans("TicketsDisableEmail") . '
' . $langs->trans("TicketsDisableEmail") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_DISABLE_ALL_MAILS'); @@ -441,7 +326,7 @@ print '
' . $langs->trans("TicketsLogEnableEmail") . '
' . $langs->trans("TicketsLogEnableEmail") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL'); @@ -454,11 +339,12 @@ print ''; print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help'); print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); @@ -474,7 +360,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } // Limiter la vue des tickets à ceux assignés à l'utilisateur -print '
' . $langs->trans("TicketsLimitViewAssignedOnly") . '
' . $langs->trans("TicketsLimitViewAssignedOnly") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_LIMIT_VIEW_ASSIGNED_ONLY'); @@ -487,14 +374,15 @@ print ''; print $form->textwithpicto('', $langs->trans("TicketsLimitViewAssignedOnlyHelp"), 1, 'help'); print '
' . $langs->trans("TicketsAutoAssignTicket") . '
' . $langs->trans("TicketsAutoAssignTicket") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE'); @@ -515,7 +403,7 @@ if (!$conf->use_javascript_ajax) { } // Admin var of module -print load_fiche_titre($langs->trans("TicketParamMail")); +print load_fiche_titre($langs->trans("Notification")); print ''; @@ -533,17 +421,26 @@ if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { print "\n"; } -// Email d'envoi des notifications -print ''; +// Activate log by email +/*print ''; print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL); +} +print ''; print ''; print ''; +*/ + +// @TODO Use module notification instead... // Email de réception des notifications -print ''; +print ''; print ''; print ''; print ''; -// Texte de création d'un ticket -$mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody'); -print ''; +// Email d'envoi des notifications +print ''; +print ''; print ''; +print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help'); +print ''; +print ''; // Texte d'introduction $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText'); -print ''; // Texte de signature $mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE : $langs->trans('TicketMessageMailSignatureText'); -print ''; -print ''; -print ''; -print "\n"; +print '
' . $langs->trans("TicketEmailNotificationFrom") . '
' . $langs->trans("TicketsLogEnableEmail") . ''; -print ''; -print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help'); +print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help'); print '
' . $langs->trans("TicketEmailNotificationTo") . '
' . $langs->trans("TicketEmailNotificationTo") . ''; print ''; @@ -551,21 +448,18 @@ print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1 print '
' . $langs->trans("TicketNewEmailBodyLabel") . ''; -print ''; -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); -$doleditor->Create(); -print '
' . $langs->trans("TicketEmailNotificationFrom") . ''; +print ''; -print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help'); -print '
' . $langs->trans("TicketMessageMailIntroLabelAdmin") . ''; +print '
' . $langs->trans("TicketMessageMailIntroLabelAdmin") . ''; print ''; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); @@ -577,7 +471,7 @@ print '
' . $langs->trans("TicketMessageMailSignatureLabelAdmin") . ''; +print '
' . $langs->trans("TicketMessageMailSignatureLabelAdmin") . ''; print ''; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); @@ -587,58 +481,12 @@ print ''; print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelpAdmin"), 1, 'help'); print '
' . $langs->trans("PublicInterface") . '
'; -// Url public interface -$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE; -print '
' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . ''; -print ''; -print ''; -print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help'); -print '
' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . ''; -print ''; -print ''; -print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help'); -print '
' . $langs->trans("TicketPublicInterfaceTextHomeLabelAdmin") . ''; -print ''; -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); -$doleditor->Create(); -print ''; -print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help'); -print '
' . $langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin") . ''; -print ''; -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); -$doleditor->Create(); -print ''; -print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help'); -print '

'; print ''; // End of page diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php new file mode 100644 index 00000000000..939a357999b --- /dev/null +++ b/htdocs/admin/ticket_public.php @@ -0,0 +1,453 @@ + + * Copyright (C) 2016 Christophe Battarel + * + * 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 admin/ticket_public.php + * \ingroup ticket + * \brief Page to public interface of module Ticket + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; + +// Load translation files required by the page +$langs->loadLangs(array("admin", "ticket")); + +// Access control +if (!$user->admin) { + accessforbidden(); +} + +// Parameters +$value = GETPOST('value', 'alpha'); +$action = GETPOST('action', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scandir', 'alpha'); +$type = 'ticket'; + +if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') +{ + if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity); +} + +if ($action == 'setvar') { + include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; + + $notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha'); + if (!empty($notification_email)) { + $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + // altairis : differentiate notification email FROM and TO + $notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha'); + if (!empty($notification_email_to)) { + $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha'); + if (!empty($mail_new_ticket)) { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha'); + if (!empty($mail_intro)) { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha'); + if (!empty($mail_signature)) { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha'); + if (!empty($mail_signature)) { + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha'); + if (!empty($mail_signature)) { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha'); + if (!empty($mail_signature)) { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } + + $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha'); + if (!empty($text_help)) { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity); + } + if (!$res > 0) { + $error++; + } +} + +if ($action == 'setvarother') { + $param_enable_public_interface = GETPOST('TICKET_ENABLE_PUBLIC_INTERFACE', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', $param_enable_public_interface, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + + $param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + + $param_disable_email = GETPOST('TICKET_DISABLE_CUSTOMER_MAILS', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + $param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + } + + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + } + + $param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } + + $param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha'); + $res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + } +} + + + +/* + * View + */ + +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + +$form = new Form($db); + +$help_url = "FR:Module_Ticket"; +$page_name = "TicketSetup"; +llxHeader('', $langs->trans($page_name), $help_url); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); + +// Configuration header +$head = ticketAdminPrepareHead(); + +dol_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); + +print ''.$langs->trans("TicketPublicAccess") . ' : ' . dol_buildpath('/public/ticket/index.php', 2) . ''; + +dol_fiche_end(); + + +$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; +if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) +{ + // Button off, click to enable + $enabledisablehtml.=''; + $enabledisablehtml.=img_picto($langs->trans("Disabled"), 'switch_off'); + $enabledisablehtml.=''; +} +else +{ + // Button on, click to disable + $enabledisablehtml.=''; + $enabledisablehtml.=img_picto($langs->trans("Activated"), 'switch_on'); + $enabledisablehtml.=''; +} +print $enabledisablehtml; +print ''; + +print '

'; + +if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) +{ + + if (!$conf->use_javascript_ajax) { + print '
'; + print ''; + print ''; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + + // Check if email exists + print ''; + print ''; + print ''; + print ''; + + /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + // Show logo for module + print ''; + print ''; + print ''; + print ''; + }*/ + + // Show logo for company + print ''; + print ''; + print ''; + print ''; + + // Also send to main email address + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + print ''; + print ''; + print ''; + print ''; + } + + if (!$conf->use_javascript_ajax) { + print ''; + print ''; + } + + // Auto assign ticket at user who created it + print ''; + print ''; + print ''; + print ''; + + print '
' . $langs->trans("Parameters") . ''; + print ''; + print '
' . $langs->trans("TicketsEmailMustExist") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_EMAIL_MUST_EXISTS", $arrval, $conf->global->TICKET_EMAIL_MUST_EXISTS); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help'); + print '
' . $langs->trans("TicketsShowModuleLogo") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKET_SHOW_MODULE_LOGO); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); + print '
' . $langs->trans("TicketsShowCompanyLogo") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, $conf->global->TICKET_SHOW_COMPANY_LOGO); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help'); + print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); + print '
' . $langs->trans("TicketsAutoAssignTicket") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help'); + print '

'; + + if (!$conf->use_javascript_ajax) { + print '
'; + } + + // Admin var of module + print load_fiche_titre($langs->trans("TicketParamMail")); + + print ''; + + print ''; + print ''; + print ''; + + print ''; + print ''; + print "\n"; + + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { + print ''; + print ''; + print "\n"; + } + + // Url public interface + $url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE; + print ''; + print ''; + print ''; + + // Interface topic + $url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC; + print ''; + print ''; + print ''; + + // Texte d'accueil homepage + $public_text_home = $conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans('TicketPublicInterfaceTextHome'); + print ''; + print ''; + + // Texte d'aide à la saisie du message + $public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'); + print ''; + print ''; + + // Activate email creation to user + print ''; + print ''; + print ''; + print ''; + + // Texte de création d'un ticket + $mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody'); + print ''; + print ''; + + print '
' . $langs->trans("Parameter") . '
' . $langs->trans("TicketCkEditorEmailNotActivated") . '
' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . ''; + print ''; + print ''; + print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help'); + print '
' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . ''; + print ''; + print ''; + print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help'); + print '
' . $langs->trans("TicketPublicInterfaceTextHomeLabelAdmin") . ''; + print ''; + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor->Create(); + print ''; + print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help'); + print '
' . $langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin") . ''; + print ''; + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor->Create(); + print ''; + print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help'); + print '
' . $langs->trans("TicketsDisableCustomerEmail") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help'); + print '
' . $langs->trans("TicketNewEmailBodyLabel") . ''; + print ''; + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); + $doleditor->Create(); + print ''; + print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help'); + print '
'; + + print '
'; + + print ''; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bom/admin/setup.php b/htdocs/bom/admin/setup.php index dd16ad92b8e..561b44fa262 100644 --- a/htdocs/bom/admin/setup.php +++ b/htdocs/bom/admin/setup.php @@ -44,7 +44,7 @@ require_once '../lib/bom.lib.php'; //require_once "../class/myclass.class.php"; // Translations -$langs->loadLangs(array("admin", "bom@bom")); +$langs->loadLangs(array("admin", "mrp")); // Access control if (! $user->admin) accessforbidden(); @@ -78,11 +78,11 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_bom@bom'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_bom'); // Configuration header $head = bomAdminPrepareHead(); -dol_fiche_head($head, 'settings', '', -1, "bom@bom"); +dol_fiche_head($head, 'settings', '', -1, "bom"); // Setup page goes here echo $langs->trans("BomSetupPage").'

'; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 9d45b8e86f8..0054e427996 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -63,7 +63,7 @@ dol_include_once('/bom/class/bom.class.php'); dol_include_once('/bom/lib/bom_bom.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("bom@bom","other")); +$langs->loadLangs(array("mrp","other")); // Get parameters $id = GETPOST('id', 'int'); @@ -154,7 +154,7 @@ if (empty($reshook)) $form=new Form($db); $formfile=new FormFile($db); -llxHeader('', 'BillOfMaterials', ''); +llxHeader('', 'NewBOM', ''); // Example : Adding jquery code print '
- +trans('Price').'">'; +if ($action=="addnote") echo ''; +?>
diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index 506c067790a..d3152b047a3 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -38,9 +38,6 @@ $query= GETPOST('query', 'alpha'); * View */ -header('Cache-Control: max-age=604800, public, must-revalidate'); -header('Pragma: cache'); - if ($query=="cat") { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -63,7 +60,7 @@ if ($query=="cat") { $filename=$obj['photo']; } - $file=DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); + $file=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); header('Location: '.$file); exit; } @@ -80,7 +77,7 @@ elseif ($query=="pro") preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file=="") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file); + else header('Location: '.$file.'&cache=1'); } else { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ed778f28b50..4d8130daeb4 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -120,6 +120,18 @@ if ($action == "freezone") { $invoice->fetch($placeid); } +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); + } + } + $invoice->fetch($placeid); +} + if ($action == "deleteline") { if ($idline > 0 and $placeid > 0) { //If exist invoice and line, to avoid errors if deleted from other device or no line selected $invoice->deleteline($idline); @@ -185,7 +197,9 @@ if ($action == "order" and $placeid != 0) { if ($count > 0) { $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; $db->query($sql); - $order_receipt_printer1.= '' . $line->product_label . '' . $line->qty . ''; + $order_receipt_printer1.= '' . $line->product_label . '' . $line->qty; + if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1.="
(".$line->array_options['options_order_notes'].")"; + $order_receipt_printer1.=''; } } @@ -200,7 +214,9 @@ if ($action == "order" and $placeid != 0) { if ($count > 0) { $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; $db->query($sql); - $order_receipt_printer2.= '' . $line->product_label . '' . $line->qty . ''; + $order_receipt_printer2.= '' . $line->product_label . '' . $line->qty; + if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer2.="
(".$line->array_options['options_order_notes'].")"; + $order_receipt_printer2.=''; } } @@ -325,7 +341,9 @@ if ($placeid > 0) { print ' order'; } print '" id="' . $line->rowid . '">'; - print '' . $line->product_label . $line->desc . ''; + print '' . $line->product_label . $line->desc; + if (!empty($line->array_options['options_order_notes'])) echo "
(".$line->array_options['options_order_notes'].")"; + print ''; print '' . $line->qty . ''; print '' . price($line->total_ttc) . ''; print ''; diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index fe6bf6b0a19..41f4c99a508 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -246,7 +246,11 @@ function Floors(){ } function FreeZone(){ - $.colorbox({href:"freezone.php?place="+place, onClosed: function () { Refresh(); },width:"80%", height:"30%", transition:"none", iframe:"true", title:"trans("FreeZone");?>"}); + $.colorbox({href:"freezone.php?action=freezone&place="+place, onClosed: function () { Refresh(); },width:"80%", height:"30%", transition:"none", iframe:"true", title:"trans("FreeZone");?>"}); +} + +function TakeposOrderNotes(){ + $.colorbox({href:"freezone.php?action=addnote&place="+place+"&idline="+selectedline, onClosed: function () { Refresh(); },width:"80%", height:"30%", transition:"none", iframe:"true", title:"trans("OrderNotes");?>"}); } function Refresh(){ @@ -457,6 +461,10 @@ if($conf->global->TAKEPOS_BAR_RESTAURANT){ if ($conf->global->TAKEPOSCONNECTOR) $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'TakeposPrinting(placeid);'); else $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'Print(placeid);'); } + if ($conf->global->TAKEPOSCONNECTOR && $conf->global->TAKEPOS_ORDER_NOTES==1){ + $menus[$r++]=array('title'=>$langs->trans("OrderNotes"), + 'action'=>'TakeposOrderNotes();'); + } } if ($conf->global->TAKEPOSCONNECTOR){ diff --git a/htdocs/theme/eldy/_global.css.php b/htdocs/theme/eldy/_global.css.php index ba6e97bdbda..ca24518e19e 100644 --- a/htdocs/theme/eldy/_global.css.php +++ b/htdocs/theme/eldy/_global.css.php @@ -104,9 +104,7 @@ textarea.cke_source:focus box-shadow: none; } -select { - /* padding: 4px 4px 2px 1px; */ -} + textarea { border-radius: 0; border-top:solid 1px rgba(0,0,0,.2); @@ -821,6 +819,7 @@ select.selectarrowonleft option { padding-top: 4px; padding-bottom: 5px; } + input, input[type=text], input[type=password], select, textarea { min-width: 20px; } @@ -1336,8 +1335,10 @@ div.tmenudiv { div.tmenudisabled, a.tmenudisabled { opacity: 0.6; } +a.tmenu, a.tmenusel, a.tmenudisabled { + font-weight: 300; +} a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudisabled:active { - font-weight: normal; padding: 0px 5px 0px 5px; white-space: nowrap; color: #; @@ -1346,14 +1347,12 @@ a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudis } a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { - font-weight: normal; padding: 0px 4px 0px 4px; white-space: nowrap; color: #; text-decoration: none; } a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { - font-weight: normal; padding: 0px 4px 0px 4px; margin: 0px 0px 0px 0px; white-space: nowrap; @@ -1403,7 +1402,9 @@ li.tmenusel::after, li.tmenu:hover::after{ border-width: 0px 6px 5px 6px; border-color: transparent transparent #ffffff transparent; } -/*li.tmenusel::before, li.tmenu:hover::before{ +/* +// add a bottom arrow +li.tmenusel::before, li.tmenu:hover::before{ content: ""; position:absolute; top:0px; @@ -1611,6 +1612,12 @@ a.tmenuimage:hover{ $found=1; break; } + else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité + { + $url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); + $found=1; + break; + } } // Img file not found if (! $found) @@ -2135,6 +2142,11 @@ div.tabBar div.titre { padding-top: 20px; } +div.tabBar.tabBarNoTop { + padding-top: 0; + border-top: 0; +} + /* tabBar used for creation/update/send forms */ div.tabBarWithBottom { padding-bottom: 18px; @@ -2798,7 +2810,7 @@ div.pagination li.paginationafterarrows { box-shadow: unset; -webkit-box-shadow: unset; } -.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover +.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover, .tagtr.oddeven { font-family: ; margin-bottom: 1px; @@ -2812,7 +2824,7 @@ div.pagination li.paginationafterarrows { background-color: #; } -.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover { +.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover, .tagtr.oddeven { font-family: ; margin-bottom: 1px; color: #202020; @@ -2878,7 +2890,7 @@ div.liste_titre_bydiv { /*width: calc(100% - 1px); 1px more, i don't know why so i remove */ width: calc(100%); } -tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr +tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr, tagtr.liste_titre { height: 26px !important; } @@ -2889,11 +2901,10 @@ div.colorback /* for the form "assign user" on time spent view */ margin-top: 5px; border: 1px solid #ddd; } -div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr +div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, .tagtr.liste_titre, .tagtr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr { background: rgb(); font-weight: ; -/* border-bottom: 1px solid #ddd; */ color: rgb(); font-family: ; @@ -3018,19 +3029,24 @@ div.tabBar .noborder { /* Prepare to remove class pair - impair */ .noborder > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre) { +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +{ background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); } -.noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre) { +.noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), +.noborder .oddeven.tagtr:nth-child(even):not(:last-child) .tagtd:not(.liste_titre) +{ border-bottom: 1px solid #ddd; } .noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre) +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) { background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); @@ -3038,7 +3054,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); } -.noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre) { +.noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), +.noborder .oddeven.tagtr:nth-child(odd):not(:last-child) .tagtd:not(.liste_titre) +{ border-bottom: 1px solid #ddd; } @@ -3554,20 +3572,15 @@ div.ui-tooltip.mytooltip { border: none !important; padding: 10px 15px; border-radius: 0; - margin: 2px; font-stretch: condensed; - -moz-box-shadow: 0.5px 0.5px 4px 0px rgba(0, 0, 0, 0.5); -webkit-box-shadow:0.5px 0.5px 4px 0px rgba(0, 0, 0, 0.5); -o-box-shadow: 0.5px 0.5px 4px 0px rgba(0, 0, 0, 0.5); box-shadow: 0.5px 0.5px 4px 0px rgba(0, 0, 0, 0.5); filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=134, Strength=5); - background: !important; color : ; - - } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5b5d1213e1e..2ca3056bd72 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -43,7 +43,7 @@ require_once __DIR__ . '/theme_vars.php'; - +if (defined('THEME_ONLY_CONSTANT')) return; session_cache_limiter('public'); diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fcff90c4359..b54006f3e6c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1819,6 +1819,12 @@ foreach($mainmenuusedarray as $val) $found=1; break; } + else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité + { + $url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); + $found=1; + break; + } } // Img file not found if (! $found) @@ -2759,6 +2765,10 @@ table.liste th, table.noborder th, table.noborder tr.liste_titre td { table.noborder td, div.noborder form, div.noborder form div, table.tableforservicepart1 td, table.tableforservicepart2 td { padding: 4px 6px 4px 6px; /* t r b l */ } +form.tagtable { + padding: unset !important; + border: unset !important; +} table.liste td, table.noborder td, div.noborder form div { padding: 8px 6px 8px 6px; /* t r b l */ @@ -3073,11 +3083,11 @@ div.liste_titre_bydiv { padding: 2px 0px 2px 0; width: calc(100% - 1px); } -tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr +tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr, tagtr.liste_titre { height: 26px !important; } -div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr +div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, .tagtr.liste_titre, .tagtr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr { background: rgb(); font-weight: ; @@ -3205,28 +3215,42 @@ div .tdtop { /* Prepare to remove class pair - impair */ -.noborder > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre) { +.noborder > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +{ background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); } -.noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre) { +.noborder > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(even):not(:last-child) td:not(.liste_titre), +.noborder .tagtr:nth-child(even):not(:last-child) .oddeven.tagtd:not(.liste_titre) +{ border-bottom: 1px solid #ddd; } -.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre) { +.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), +div:not(.fichecenter):not(.fichehalfleft):not(.ficheaddleft) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) +{ background: linear-gradient(to bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); } -.noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre) { +.noborder > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(:last-child) td:not(.liste_titre), +.noborder .tagtr:nth-child(odd):not(:last-child) .oddeven.tagtd:not(.liste_titre) +{ border-bottom: 1px solid #ddd; } +ul.noborder li:nth-child(even):not(.liste_titre) { + background-color: rgb() !important; +} + /* * Boxes diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index c71a2211e7f..fd434ef395f 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -49,8 +49,11 @@ $id = GETPOST('id', 'int'); $track_id = GETPOST('track_id', 'alpha', 3); $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); +$cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); +$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); + // Initialize technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ticketcard','globalcard')); @@ -155,10 +158,8 @@ if ($action == "change_property" && GETPOST('btn_update_ticket_prop', 'alpha') & $ret = $object->update($user); if ($ret > 0) { $log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); - } + + setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); } $action = 'view'; } @@ -183,6 +184,28 @@ $page_title = $actionobject->getTitle($action); llxHeader('', $page_title, $help_url); +if ($action == 'create') +{ + $formticket = new FormTicket($db); + + print load_fiche_titre($langs->trans('NewTicket'), '', 'title_ticket'); + + $formticket->withfromsocid = $socid ? $socid : $user->societe_id; + $formticket->withfromcontactid = $contactid ? $contactid : ''; + $formticket->withtitletopic = 1; + $formticket->withnotifytiersatcreate = ($notifyTiers?1:0); + $formticket->withusercreate = 1; + $formticket->withref = 1; + $formticket->fk_user_create = $user->id; + $formticket->withfile = 2; + $formticket->withextrafields = 1; + $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); + if (empty($defaultref)) { + $defaultref = ''; + } + + $formticket->showForm(1); +} if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') @@ -721,7 +744,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (empty($reshook)) { // Show link to add a message (if read and not closed) - if ($object->fk_statut < 8 && $action != "add_message") { + if ($object->fk_statut < Ticket::STATUS_CLOSED && $action != "add_message") { print ''; } @@ -730,22 +753,22 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (!$object->fk_soc && $user->rights->ficheinter->creer) { print ''; } - if ($object->fk_soc > 0 && $object->fk_statut < 8 && $user->rights->ficheinter->creer) { + if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { print ''; } // Close ticket if statut is read - if ($object->fk_statut > 0 && $object->fk_statut < 8 && $user->rights->ticket->write) { + if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print ''; } // Re-open ticket - if (!$user->socid && $object->fk_statut == 8 && !$user->societe_id) { + if (!$user->socid && $object->fk_statut == Ticket::STATUS_CLOSED && !$user->societe_id) { print ''; } // Delete ticket - if ($user->rights->ticket->delete && !$user->societe_id) { + if ($user->rights->ticket->delete && ! $user->societe_id) { print ''; } } @@ -758,7 +781,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $action = 'presend'; } - if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'edit_message_init') + if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'delete' || $action == 'edit_message_init') { print '
'; print ''; // ancre @@ -786,6 +809,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd print '
'; print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket'); + print '
'; + // Define output language $outputlangs = $langs; $newlang = ''; @@ -803,6 +828,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $formticket->id = $object->id; $formticket->withfile = 2; + $formticket->withcancel = 1; $formticket->param = array('fk_user_create' => $user->id); $formticket->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); @@ -839,7 +865,6 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $formticket->substit['__TICKETSUP_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); } - $formticket->showMessageForm('100%'); print '
'; } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 395ab2078c7..39d51017c41 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -133,7 +133,7 @@ class ActionsTicket dol_mkdir($upload_dir_tmp); } dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', dol_print_date(dol_now(), '%Y%m%d%H%M%S') . '-__file__'); - $action = !empty($object->track_id) ? 'add_message' : 'create_ticket'; + $action = !empty($object->track_id) ? 'add_message' : 'create'; ////} } @@ -156,21 +156,21 @@ class ActionsTicket // TODO Delete only files that was uploaded from email form dol_remove_file_process($_POST['removedfile'], 0); - $action = !empty($object->track_id) ? 'add_message' : 'create_ticket'; + $action = !empty($object->track_id) ? 'add_message' : 'create'; ////} } - if (GETPOST('add_ticket') && $user->rights->ticket->write) { + if (GETPOST('add','alpha') && $user->rights->ticket->write) { $error = 0; if (!GETPOST("subject")) { $error++; $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")); - $action = 'create_ticket'; + $action = 'create'; } elseif (!GETPOST("message")) { $error++; $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("message")); - $action = 'create_ticket'; + $action = 'create'; } if (!$error) { @@ -189,6 +189,8 @@ class ActionsTicket $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; + $object->fk_project = GETPOST('projectid', 'int'); + $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object); @@ -198,7 +200,7 @@ class ActionsTicket $error++; $this->error = $object->error; $this->errors = $object->errors; - $action = 'create_ticket'; + $action = 'create'; } if (!$error && $id > 0) @@ -338,19 +340,15 @@ class ActionsTicket if ($action == "mark_ticket_read" && $user->rights->ticket->write) { $object->fetch('', '', GETPOST("track_id", 'alpha')); - if ($object->markAsRead($user) > 0) { - // Log action in ticket logs table - $log_action = $langs->trans('TicketLogMesgReadBy', $user->getFullName($langs)); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); - } else { - setEventMessages($langs->trans('TicketMarkedAsReadButLogActionNotSaved'), null, 'errors'); - } + if ($object->markAsRead($user) > 0) + { + setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); + header("Location: card.php?track_id=" . $object->track_id . "&action=view"); exit; } else { - array_push($this->errors, $object->error); + $this->errors = $object->error; + $this->error = $object->error; } $action = 'view'; } @@ -396,12 +394,9 @@ class ActionsTicket // Log action in ticket logs table $object->fetch_user($usertoassign); $log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs)); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); - } else { - setEventMessages($langs->trans('TicketAssignedButLogActionNotSaved'), null, 'errors'); - } + + setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); + header("Location: card.php?track_id=" . $object->track_id . "&action=view"); exit; } else { @@ -436,12 +431,9 @@ class ActionsTicket if ($object->close()) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogClosedBy', $user->getFullName($langs)); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); - } else { - setEventMessages($langs->trans('TicketMarkedAsClosedButLogActionNotSaved'), null, 'warnings'); - } + + setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); + $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); header("Location: " . $url); } else { @@ -455,12 +447,9 @@ class ActionsTicket if (($_SESSION['email_customer'] == $object->origin_email || $_SESSION['email_customer'] == $object->thirdparty->email) && $object->close()) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages('
' . $langs->trans('TicketMarkedAsClosed') . '
', null, 'mesgs'); - } else { - setEventMessages($langs->trans('TicketMarkedAsClosedButLogActionNotSaved'), null, 'warnings'); - } + + setEventMessages('
' . $langs->trans('TicketMarkedAsClosed') . '
', null, 'mesgs'); + $url = 'view.php?action=view_ticket&track_id=' . GETPOST('track_id', 'alpha'); header("Location: " . $url); } else { @@ -495,10 +484,8 @@ class ActionsTicket if ($action == 'set_progression' && $user->rights->ticket->write) { if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $result = $object->setProgression(GETPOST('progress')); - // Log action in ticket logs table - $log_action = $langs->trans('TicketLogProgressSetTo', GETPOST('progress')); - $ret = $object->createTicketLog($user, $log_action); + $result = $object->setProgression(GETPOST('progress', 'alpha')); + $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); exit(); @@ -529,12 +516,12 @@ class ActionsTicket if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) { if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { // prevent browser refresh from reopening ticket several times - if ($object->fk_statut == 8) { - $res = $object->setStatut(4); + if ($object->fk_statut == Ticket::STATUS_CLOSED) { + $res = $object->setStatut(Ticket::STATUS_ASSIGNED); if ($res) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogReopen'); - $ret = $object->createTicketLog($user, $log_action); + $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); exit(); @@ -544,7 +531,7 @@ class ActionsTicket } // Categorisation dans projet elseif ($action == 'classin' && $user->rights->ticket->write) { if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('projectid', 'int')); $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); exit(); @@ -552,7 +539,7 @@ class ActionsTicket } // Categorisation dans contrat elseif ($action == 'setcontract' && $user->rights->ticket->write) { if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $object->setContract(GETPOST('contractid')); + $object->setContract(GETPOST('contractid', 'int')); $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); exit(); @@ -573,10 +560,7 @@ class ActionsTicket // output the result of comparing two files as plain text $log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message))); - $ret = $object->createTicketLog($user, $log_action); - if ($ret > 0) { - setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs'); - } + setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs'); } } @@ -590,7 +574,7 @@ class ActionsTicket if ($res) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status])); - $ret = $object->createTicketLog($user, $log_action); + $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); exit(); @@ -1013,7 +997,7 @@ class ActionsTicket { global $langs; - if ($action == 'create_ticket') { + if ($action == 'create') { return $langs->trans("CreateTicket"); } elseif ($action == 'edit') { return $langs->trans("EditTicket"); @@ -1498,9 +1482,13 @@ class ActionsTicket print '
'; if ($status == 1) + { $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=mark_ticket_read'; // To set as read, we use a dedicated action - else - $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=set_status&new_status=' . $status; + } + else + { + $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=set_status&new_status=' . $status; + } print ''; print img_picto($langs->trans($object->statuts_short[$status]), 'statut' . $status . '.png@ticket') . ' ' . $langs->trans($object->statuts_short[$status]); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index ec1e44e9f86..0eb1de8f8d2 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1396,19 +1396,22 @@ class Ticket extends CommonObject { global $conf, $langs; - if ($this->statut != 9) { // no closed + if ($this->statut != self::STATUS_CANCELED) { // no closed $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "ticket"; $sql .= " SET fk_statut = 1, date_read='" . $this->db->idate(dol_now()) . "'"; $sql .= " WHERE rowid = " . $this->id; - dol_syslog(get_class($this) . "::markAsRead sql=" . $sql); + dol_syslog(get_class($this) . "::markAsRead"); $resql = $this->db->query($sql); if ($resql) { + $this->actionmsg = $langs->trans('TicketLogMesgReadBy', $this->ref, $user->getFullName($langs)); + $this->actionmsg2 = $langs->trans('TicketLogMesgReadBy', $this->ref, $user->getFullName($langs)); + if (!$error && !$notrigger) { // Call trigger - $result=$this->call_trigger('TICKET_MARK_READ', $user); + $result=$this->call_trigger('TICKET_MODIFY', $user); if ($result < 0) { $error++; } @@ -1490,52 +1493,6 @@ class Ticket extends CommonObject } } - /** - * Create log for the ticket - * 1- create entry into database for message storage - * 2- if trigger, send an email to ticket contacts - * - * @param User $user User that create - * @param string $message Log message - * @param int $noemail 0=send email after, 1=disable emails - * @return int <0 if KO, >0 if OK - */ - public function createTicketLog(User $user, $message, $noemail = 0) - { - global $conf, $langs; - - $error = 0; - - $this->db->begin(); - - // Clean parameters - $this->message = trim($this->message); - - // Check parameters - if (!$message) { - $this->error = 'ErrorBadValueForParameter'; - return -1; - } - - // TODO Should call the trigger TICKET_MODIFY with $this->context with all data to record event - // so the event is stored by the agenda/event trigger - - if (!$error) { - $this->db->commit(); - - if ($conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL && !$noemail) { - $this->sendLogByEmail($user, $message); - } - - return 1; - } - else - { - $this->db->rollback(); - - return -1; - } - } /** * Send notification of changes by email diff --git a/htdocs/ticket/css/styles.css.php b/htdocs/ticket/css/styles.css.php index 1f7ed4810a2..a62a4e00a52 100644 --- a/htdocs/ticket/css/styles.css.php +++ b/htdocs/ticket/css/styles.css.php @@ -68,14 +68,17 @@ div.ticketform { border-radius: 10px 10px 10px 10px; margin: 1.5em; background : #ffffff; - - + text-align: center; } div.ticketform .index_create, .index_display { - float: left; - width: 33%; + display: inline-block; + width: 200px; + height: 58px; text-align: center; + vertical-align: middle; + margin: 20px; + text-transform: uppercase; } div.ticketform .orange { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0b3a1c101e8..89dbd0acedc 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -49,13 +49,13 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicate $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); -$msg_id = GETPOST('msg_id', 'int'); -$socid = GETPOST('socid', 'int'); -$projectid = GETPOST('projectid', 'int'); +$msg_id = GETPOST('msg_id', 'int'); +$socid = GETPOST('socid', 'int'); +$projectid = GETPOST('projectid', 'int'); $search_fk_soc=GETPOST('$search_fk_soc', 'int')?GETPOST('$search_fk_soc', 'int'):GETPOST('socid', 'int'); $search_fk_project=GETPOST('search_fk_project', 'int')?GETPOST('search_fk_project', 'int'):GETPOST('projectid', 'int'); $search_fk_status = GETPOST('search_fk_statut', 'array'); -$mode = GETPOST('mode', 'alpha'); +$mode = GETPOST('mode', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; @@ -79,8 +79,8 @@ $extralabels = $extrafields->fetch_name_optionals_label('ticket'); $search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Default sort order (if not yet defined by previous GETPOST) -if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. -if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="t.datec"; +if (! $sortorder) $sortorder="DESC"; if (GETPOST('search_fk_status', 'alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility @@ -462,7 +462,7 @@ if ($projectid) print '' . $langs->trans('NewTicket').''; + $newcardbutton = '' . $langs->trans('NewTicket').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/ticket/new.php b/htdocs/ticket/new.php deleted file mode 100644 index 267e3e63847..00000000000 --- a/htdocs/ticket/new.php +++ /dev/null @@ -1,96 +0,0 @@ - - * Copyright (C) 2016 Christophe Battarel - * - * 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/ticket/new.php - * \ingroup ticket - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . '/ticket/class/actions_ticket.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticket.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; - -// Load translation files required by the page -$langs->loadLangs(array('companies', 'other', 'ticket')); - -// Get parameters -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); -$contactid = GETPOST('contactid', 'int'); -$msg_id = GETPOST('msg_id', 'int'); -$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); - -$action = GETPOST('action', 'aZ09'); - -// Protection if external user -if (!$user->rights->ticket->read || !$user->rights->ticket->write) { - accessforbidden(); -} - -$object = new Ticket($db); -$actionobject = new ActionsTicket($db); - - -/* - * Actions - */ - -$actionobject->doActions($action, $object); - - - -/* - * View - */ - -$form = new Form($db); - -$help_url = 'FR:DocumentationModuleTicket'; -$page_title = $actionobject->getTitle($action); -llxHeader('', $page_title, $help_url); - - -if ($action == 'create_ticket') { - $formticket = new FormTicket($db); - - print load_fiche_titre($langs->trans('NewTicket'), '', 'title_ticket'); - - $formticket->withfromsocid = $socid ? $socid : $user->societe_id; - $formticket->withfromcontactid = $contactid ? $contactid : ''; - $formticket->withtitletopic = 1; - $formticket->withnotifytiersatcreate = ($notifyTiers?1:0); - $formticket->withusercreate = 1; - $formticket->withref = 1; - $formticket->fk_user_create = $user->id; - $formticket->withfile = 2; - $formticket->withextrafields = 1; - $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); - if (empty($defaultref)) { - $defaultref = ''; - } - - $formticket->showForm(1); -} - -//$somethingshown=$object->showLinkedObjectBlock(); - -// End of page -llxFooter(''); -$db->close(); diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index cedd5b4741c..597f4b88de6 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -163,17 +163,17 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase // Do a list of movement into warehouse 1 // Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9 - $result=$localobject->_create($user, $product1id, $warehouse1id, 10, 3, 9.9, 'Movement for unit test 1', 'Inventory Code Test'); + $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.9, 'Movement for unit test 1', 'Inventory Code Test'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); // Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->_create($user, $product1id, $warehouse1id, 10, 3, 9.7, 'Movement for unit test 2', 'Inventory Code Test'); + $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.7, 'Movement for unit test 2', 'Inventory Code Test'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); // Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->_create($user, $product1id, $warehouse1id, -5, 2, 999, 'Movement for unit test 3', 'Inventory Code Test'); + $result=$localobject->livraison($user, $product1id, $warehouse1id, 5, 999, 'Movement for unit test 3', 'Inventory Code Test'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -191,17 +191,17 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase // Do same but into warehouse 2 // Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9 - $result=$localobject->_create($user, $product1id, $warehouse2id, 10, 3, 9.9, 'Movement for unit test 1 wh 2', 'Inventory Code Test 2'); + $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.9, 'Movement for unit test 1 wh 2', 'Inventory Code Test 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); // Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->_create($user, $product1id, $warehouse2id, 10, 3, 9.7, 'Movement for unit test 2 wh 2', 'Inventory Code Test 2'); + $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.7, 'Movement for unit test 2 wh 2', 'Inventory Code Test 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); // Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->_create($user, $product1id, $warehouse2id, -5, 2, 999, 'Movement for unit test 3 wh 2', 'Inventory Code Test 2'); + $result=$localobject->livraison($user, $product1id, $warehouse2id, 5, 999, 'Movement for unit test 3 wh 2', 'Inventory Code Test 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0);