Merge remote-tracking branch 'Upstream/develop' into develop-loan

This commit is contained in:
aspangaro 2014-09-23 21:24:29 +02:00
commit a58025c601
390 changed files with 3258 additions and 3047 deletions

View File

@ -74,9 +74,9 @@ For users:
- Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
- New: Direct invoice creation from predefined invoice
- New: Add dunning into accountancy report - New: Add dunning into accountancy report
For users, new experimental module:
New experimental module:
- New: Module Accounting Expert to manage accountancy - New: Module Accounting Expert to manage accountancy
Special Thanks to developpers : Special Thanks to developpers :
Olivier Geffroy Olivier Geffroy
@ -111,7 +111,11 @@ For developers:
- New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: renamed table llx_c_pays to llx_c_country & libelle field to label.
- Qual: Renamed table llx_c_civilite into llx_c_civility, - Qual: Renamed table llx_c_civilite into llx_c_civility,
field civilite into label in the same table, field civilite into label in the same table,
and field civilite into civility in other table and field civilite into civility in other table.
- Qual: Renamed all files & links "liste.php" into "list.php".
- Qual: Renamed all files & links "fiche.php" into "card.php".
- Qual: Replace all constants COMPTA_* by ACCOUNTING_*.
- Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module
WARNING: Following changes may create regression for some external modules, but was necessary to make WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better: Dolibarr better:
@ -121,7 +125,8 @@ Dolibarr better:
- Table llx_c_pays were renamed into llx_c_country. - Table llx_c_pays were renamed into llx_c_country.
- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after - Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after
creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead. creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
- A lot of pages called fiche.php were renamed into card.php
- A lot of pages called liste.php were renamed into list.php
***** ChangeLog for 3.6.1 compared to 3.6.* ***** ***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users: For users:

View File

@ -139,12 +139,12 @@ if ($result) {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("AccountNumber"), "account.php", "aa.account_number", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("AccountNumber"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Label"), "account.php", "aa.label", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "aa.label", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Accountparent"), "account.php", "aa.account_parent", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Accountparent"), $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Pcgtype"), "account.php", "aa.pcg_type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Pcgsubtype"), "account.php", "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Active"), "account.php", "aa.active", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("&nbsp;"); print_liste_field_titre("&nbsp;");
print '</tr>'; print '</tr>';

View File

@ -44,17 +44,17 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters COMPTA_* & ACCOUNTING_* // Other parameters ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTING_LIMIT_LIST_VENTILATION', 'ACCOUNTING_LIMIT_LIST_VENTILATION',
'ACCOUNTING_LENGTH_GACCOUNT', 'ACCOUNTING_LENGTH_GACCOUNT',
'ACCOUNTING_LENGTH_AACCOUNT', 'ACCOUNTING_LENGTH_AACCOUNT',
'COMPTA_ACCOUNT_CUSTOMER', 'ACCOUNTING_ACCOUNT_CUSTOMER',
'COMPTA_ACCOUNT_SUPPLIER', 'ACCOUNTING_ACCOUNT_SUPPLIER',
'COMPTA_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
'COMPTA_PRODUCT_SOLD_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
'COMPTA_SERVICE_BUY_ACCOUNT', 'ACCOUNTING_SERVICE_BUY_ACCOUNT',
'COMPTA_SERVICE_SOLD_ACCOUNT', 'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
'ACCOUNTING_ACCOUNT_SUSPENSE', 'ACCOUNTING_ACCOUNT_SUSPENSE',
'ACCOUNTING_ACCOUNT_TRANSFER_CASH' 'ACCOUNTING_ACCOUNT_TRANSFER_CASH'
); );
@ -63,22 +63,22 @@ $list = array (
* Actions * Actions
*/ */
$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES'; $accounting_mode = defined('ACCOUNTING_MODE')?ACCOUNTING_MODE:'RECETTES-DEPENSES';
if ($action == 'update') if ($action == 'update')
{ {
$error = 0; $error = 0;
$compta_modes = array( $accounting_modes = array(
'RECETTES-DEPENSES', 'RECETTES-DEPENSES',
'CREANCES-DETTES' 'CREANCES-DETTES'
); );
$compta_mode = GETPOST('compta_mode','alpha'); $accounting_mode = GETPOST('accounting_mode','alpha');
if (in_array($compta_mode,$compta_modes)) { if (in_array($accounting_mode,$accounting_modes)) {
if (!dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode, 'chaine', 0, '', $conf->entity)) { if (!dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) {
$error++; $error++;
} }
} else { } else {
@ -160,12 +160,12 @@ print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Cas du parametre COMPTA_MODE // Cas du parametre ACCOUNTING_MODE
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>'; print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; print '<tr '.$bc[false].'><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT // Write info on way to count VAT
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
@ -179,7 +179,7 @@ print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// // print nl2br($langs->trans('OptionModeTrueInfoExpert')); // // print nl2br($langs->trans('OptionModeTrueInfoExpert'));
//} //}
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>'; print '<tr '.$bc[true].'><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n"; print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
print '</form>'; print '</form>';

View File

@ -98,17 +98,17 @@ if ($resql) {
$compta_prodsell = $obj->accountancy_code_sell; $compta_prodsell = $obj->accountancy_code_sell;
if (empty($compta_prodsell)) { if (empty($compta_prodsell)) {
if ($obj->product_type == 0) if ($obj->product_type == 0)
$compta_prodsell = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
else else
$compta_prodsell = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} }
$compta_prodbuy = $obj->accountancy_code_buy; $compta_prodbuy = $obj->accountancy_code_buy;
if (empty($compta_prodbuy)) { if (empty($compta_prodbuy)) {
if ($obj->product_type == 0) if ($obj->product_type == 0)
$compta_prodbuy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
else else
$compta_prodbuy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
} }
$product_static = new Product($db); $product_static = new Product($db);

View File

@ -112,8 +112,9 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0"; $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }
@ -168,17 +169,17 @@ if ($result) {
if (! empty($objp->type)) { if (! empty($objp->type)) {
if ($objp->type == 1) { if ($objp->type == 1) {
$objp->code_sell = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} else { } else {
$objp->code_sell = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} }
} else { } else {
$code_sell_notset = 'color:blue'; $code_sell_notset = 'color:blue';
if ($objp->type == 1) { if ($objp->type == 1) {
$objp->code_sell = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} else { } else {
$objp->code_sell = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} }
} }
} }
@ -219,7 +220,7 @@ if ($result) {
// Colonne choix ligne a ventiler // Colonne choix ligne a ventiler
print '<td align="center">'; print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->code_sell ? "checked" : "") . '/>'; print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -129,8 +129,8 @@ if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
// Variables // Variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
$cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef")); $accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
@ -349,7 +349,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} else if ($tabtype[$key] == 'payment_supplier') { } else if ($tabtype[$key] == 'payment_supplier') {
$sqlmid = 'SELECT facf.facnumber'; $sqlmid = 'SELECT facf.facnumber';
@ -364,7 +364,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_SUPPLIER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
} else if ($tabtype[$key] == 'company') { } else if ($tabtype[$key] == 'company') {
$sqlmid = 'SELECT fac.facnumber'; $sqlmid = 'SELECT fac.facnumber';
@ -379,11 +379,11 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} else { } else {
$bookkeeping->doc_ref = $k; $bookkeeping->doc_ref = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} }
$result = $bookkeeping->create(); $result = $bookkeeping->create();
@ -434,9 +434,9 @@ if ($action == 'export_csv') {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep; print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep;
if ($val["lib"] == '(SupplierInvoicePayment)') { if ($val["lib"] == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
} else { } else {
print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
} }
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;

View File

@ -121,8 +121,8 @@ if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
// les variables // les variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
$cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
@ -318,7 +318,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} else if ($tabtype[$key] == 'payment_supplier') { } else if ($tabtype[$key] == 'payment_supplier') {
$sqlmid = 'SELECT facf.facnumber'; $sqlmid = 'SELECT facf.facnumber';
@ -333,7 +333,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_SUPPLIER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
} else if ($tabtype[$key] == 'company') { } else if ($tabtype[$key] == 'company') {
$sqlmid = 'SELECT fac.facnumber'; $sqlmid = 'SELECT fac.facnumber';
@ -348,11 +348,11 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->doc_ref = $objmid->facnumber; $bookkeeping->doc_ref = $objmid->facnumber;
} }
$bookkeeping->code_tiers = $k; $bookkeeping->code_tiers = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} else { } else {
$bookkeeping->doc_ref = $k; $bookkeeping->doc_ref = $k;
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
} }
$result = $bookkeeping->create(); $result = $bookkeeping->create();
@ -399,9 +399,9 @@ if ($action == 'export_csv') {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep; print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep;
if ($obj->label == '(SupplierInvoicePayment)') { if ($obj->label == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
} else { } else {
print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
} }
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;

View File

@ -111,8 +111,8 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
// les variables // les variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER)) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"); $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)) ? $conf->global->COMPTA_VAT_ACCOUNT : $langs->trans("CodeNotDef"); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
$tabfac = array (); $tabfac = array ();
$tabht = array (); $tabht = array ();
@ -128,9 +128,9 @@ if ($result) {
$compta_prod = $obj->compte; $compta_prod = $obj->compte;
if (empty($compta_prod)) { if (empty($compta_prod)) {
if ($obj->product_type == 0) if ($obj->product_type == 0)
$compta_prod = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT)) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"); $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef");
else else
$compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT)) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"); $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef");
} }
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
@ -174,7 +174,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_docdet = $val["fk_facturefourndet"]; $bookkeeping->fk_docdet = $val["fk_facturefourndet"];
$bookkeeping->code_tiers = $tabcompany[$key]['code_fournisseur']; $bookkeeping->code_tiers = $tabcompany[$key]['code_fournisseur'];
$bookkeeping->label_compte = $tabcompany[$key]['name']; $bookkeeping->label_compte = $tabcompany[$key]['name'];
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_SUPPLIER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->debit = ($mt <= 0) ? $mt : 0;
@ -288,7 +288,7 @@ if ($action == 'export_csv') {
} }
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep;
print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
@ -416,7 +416,6 @@ if ($action == 'export_csv') {
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . " >"; print "<tr " . $bc[$var] . " >";
// print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>"; print "<td>" . length_accountg($k) . "</td>";
@ -431,7 +430,6 @@ if ($action == 'export_csv') {
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . " >"; print "<tr " . $bc[$var] . " >";
// print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td><td>" . $langs->trans("VAT") . "</td>"; print "<td>" . length_accountg($k) . "</td><td>" . $langs->trans("VAT") . "</td>";
@ -443,7 +441,6 @@ if ($action == 'export_csv') {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
// Third party // Third party
// print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";

View File

@ -125,17 +125,17 @@ if ($result) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
// les variables // les variables
$cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER)) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"); $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef");
$compta_soc = (! empty($obj->code_compta)) ? $obj->code_compta : $cptcli; $compta_soc = (! empty($obj->code_compta)) ? $obj->code_compta : $cptcli;
$compta_prod = $obj->compte; $compta_prod = $obj->compte;
if (empty($compta_prod)) { if (empty($compta_prod)) {
if ($obj->product_type == 0) if ($obj->product_type == 0)
$compta_prod = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
else else
$compta_prod = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT)) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
} }
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)) ? $conf->global->COMPTA_VAT_ACCOUNT : $langs->trans("CodeNotDef"); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
// Invoice lines // Invoice lines
@ -183,7 +183,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key; $bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturedet"]; $bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->code_tiers = $tabcompany[$key]['code_client']; $bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
$bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
$bookkeeping->label_compte = $tabcompany[$key]['name']; $bookkeeping->label_compte = $tabcompany[$key]['name'];
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
@ -267,7 +267,7 @@ if ($action == 'export_csv') {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep;
print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
@ -422,7 +422,6 @@ if ($action == 'export_csv') {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
// Third party // Third party
// print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
@ -441,7 +440,6 @@ if ($action == 'export_csv') {
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
// print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>"; print "<td>" . length_accountg($k) . "</td>";
@ -457,7 +455,6 @@ if ($action == 'export_csv') {
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
// print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>"; print "<td>" . length_accountg($k) . "</td>";

View File

@ -114,7 +114,9 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0"; $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
@ -177,9 +179,9 @@ if ($result) {
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.$objp->ref.'</a></td>'; // print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref.'</a></td>';
// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.$objp->ref_supplier.'</a></td>'; // print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref_supplier.'</a></td>';
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
@ -199,7 +201,7 @@ if ($result) {
print '</td>'; print '</td>';
// Colonne choix ligne a ventiler // Colonne choix ligne a ventiler
print '<td align="center">'; print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->code_buy ? "checked" : "") . '/>'; print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";

View File

@ -84,7 +84,7 @@ if ($object->id > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
// Reference // Reference
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>'; print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
@ -139,7 +139,7 @@ if ($object->id > 0)
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create">'.$langs->trans("AddAction").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create">'.$langs->trans("AddAction").'</a></div>';
} }
print '</div>'; print '</div>';

View File

@ -21,7 +21,7 @@
*/ */
/** /**
* \file htdocs/adherents/fiche.php * \file htdocs/adherents/card.php
* \ingroup member * \ingroup member
* \brief Page of member * \brief Page of member
*/ */
@ -564,7 +564,7 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confir
} }
else else
{ {
header("Location: liste.php"); header("Location: list.php");
exit; exit;
} }
} }
@ -1284,13 +1284,13 @@ else
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
} }
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
} }
// Confirm send card by mail // Confirm send card by mail
if ($action == 'sendinfo') if ($action == 'sendinfo')
{ {
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1); print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
} }
// Confirm resiliate // Confirm resiliate
@ -1321,7 +1321,7 @@ else
$formquestion=array(); $formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false')); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
} }
// Confirm remove member // Confirm remove member
@ -1329,7 +1329,7 @@ else
{ {
$formquestion=array(); $formquestion=array();
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
} }
/* /*
@ -1337,7 +1337,7 @@ else
*/ */
if ($action == 'add_spip') if ($action == 'add_spip')
{ {
print $form->formconfirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); print $form->formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
} }
/* /*
@ -1345,7 +1345,7 @@ else
*/ */
if ($action == 'del_spip') if ($action == 'del_spip')
{ {
print $form->formconfirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); print $form->formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
} }
$rowspan=17; $rowspan=17;
@ -1355,7 +1355,7 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
@ -1543,7 +1543,7 @@ else
// Modify // Modify
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=edit">'.$langs->trans("Modify")."</a></div>"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$rowid.'&action=edit">'.$langs->trans("Modify")."</a></div>";
} }
else else
{ {
@ -1555,7 +1555,7 @@ else
{ {
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Validate")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Validate")."</a></div>\n";
} }
else else
{ {
@ -1568,7 +1568,7 @@ else
{ {
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$rowid.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n";
} }
else else
{ {
@ -1581,7 +1581,7 @@ else
{ {
if ($object->statut >= 1) if ($object->statut >= 1)
{ {
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n"; if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n"; else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
} }
else else
@ -1599,7 +1599,7 @@ else
{ {
if ($user->rights->adherent->supprimer) if ($user->rights->adherent->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$rowid.'&action=resign">'.$langs->trans("Resiliate")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$rowid.'&action=resign">'.$langs->trans("Resiliate")."</a></div>\n";
} }
else else
{ {
@ -1638,7 +1638,7 @@ else
// Delete // Delete
if ($user->rights->adherent->supprimer) if ($user->rights->adherent->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>\n";
} }
else else
{ {
@ -1652,11 +1652,11 @@ else
if ($isinspip == 1) if ($isinspip == 1)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=del_spip">'.$langs->trans("DeleteIntoSpip")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=del_spip">'.$langs->trans("DeleteIntoSpip")."</a></div>\n";
} }
if ($isinspip == 0) if ($isinspip == 0)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
} }
} }

View File

@ -299,7 +299,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
$insertid=$acct->addline($dateop, $operation, $label, $cotisation, $num_chq, '', $user, $emetteur_nom, $emetteur_banque); $insertid=$acct->addline($dateop, $operation, $label, $cotisation, $num_chq, '', $user, $emetteur_nom, $emetteur_banque);
if ($insertid > 0) if ($insertid > 0)
{ {
$inserturlid=$acct->add_url_line($insertid, $object->id, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $object->getFullname($langs), 'member'); $inserturlid=$acct->add_url_line($insertid, $object->id, DOL_URL_ROOT.'/adherents/card.php?rowid=', $object->getFullname($langs), 'member');
if ($inserturlid > 0) if ($inserturlid > 0)
{ {
// Met a jour la table cotisation // Met a jour la table cotisation
@ -482,7 +482,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
} }
// Generate PDF (whatever is option MAIN_DISABLE_PDF_AUTOUPDATE) so we can include it into email // Generate PDF (whatever is option MAIN_DISABLE_PDF_AUTOUPDATE) so we can include it into email
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
facture_pdf_create($db, $invoice, $invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
@ -554,7 +555,7 @@ if ($rowid)
print '<input type="hidden" name="rowid" value="'.$object->id.'">'; print '<input type="hidden" name="rowid" value="'.$object->id.'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';

View File

@ -1558,7 +1558,7 @@ class Adherent extends CommonObject
if ($option == 'card') if ($option == 'card')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
} }
if ($option == 'subscription') if ($option == 'subscription')

View File

@ -97,17 +97,17 @@ if ($result)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.lastname",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder);
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder);
} }
print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateEnd"),"cotisations.php","c.datef",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),"cotisations.php","c.cotisation",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
// Static objects // Static objects

View File

@ -113,7 +113,7 @@ if ($id > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';

View File

@ -127,7 +127,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
// Formulaire recherche adherent // Formulaire recherche adherent
print '<form action="liste.php" method="post">'; print '<form action="list.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="search">'; print '<input type="hidden" name="action" value="search">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/adherents/liste.php * \file htdocs/adherents/list.php
* \ingroup member * \ingroup member
* \brief Page to list all members of foundation * \brief Page to list all members of foundation
*/ */
@ -294,7 +294,7 @@ if ($resql)
print "</td>\n"; print "</td>\n";
// Lastname // Lastname
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">"; print "<td><a href=\"card.php?rowid=$objp->rowid\">";
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
@ -348,16 +348,16 @@ if ($resql)
print '<td align="center">'; print '<td align="center">';
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print "<a href=\"fiche.php?rowid=".$objp->rowid."&action=edit&backtopage=1\">".img_edit()."</a>"; print "<a href=\"card.php?rowid=".$objp->rowid."&action=edit&backtopage=1\">".img_edit()."</a>";
} }
print '&nbsp;'; print '&nbsp;';
if ($user->rights->adherent->supprimer && $objp->statut == -1) if ($user->rights->adherent->supprimer && $objp->statut == -1)
{ {
print "<a href=\"fiche.php?rowid=".$objp->rowid."&action=delete&backtopage=1\">".img_picto($langs->trans("Delete"),'disable.png')."</a>"; print "<a href=\"card.php?rowid=".$objp->rowid."&action=delete&backtopage=1\">".img_picto($langs->trans("Delete"),'disable.png')."</a>";
} }
if ($user->rights->adherent->supprimer && $objp->statut == 1) if ($user->rights->adherent->supprimer && $objp->statut == 1)
{ {
print "<a href=\"fiche.php?rowid=".$objp->rowid."&action=resign&backtopage=1\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>"; print "<a href=\"card.php?rowid=".$objp->rowid."&action=resign&backtopage=1\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>";
} }
print "</td>"; print "</td>";

View File

@ -87,7 +87,7 @@ if ($id)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
// Reference // Reference
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>'; print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';

View File

@ -353,7 +353,7 @@ if ($rowid > 0)
} }
// Add // Add
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a></div>';
// Delete // Delete
if ($user->rights->adherent->configurer) if ($user->rights->adherent->configurer)
@ -364,7 +364,7 @@ if ($rowid > 0)
print "</div>"; print "</div>";
// Show list of members (nearly same code than in page liste.php) // Show list of members (nearly same code than in page list.php)
$membertypestatic=new AdherentType($db); $membertypestatic=new AdherentType($db);
@ -526,11 +526,11 @@ if ($rowid > 0)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
if ($objp->societe != '') if ($objp->societe != '')
{ {
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n"; print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n";
} }
else else
{ {
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).'</a></td>'."\n"; print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).'</a></td>'."\n";
} }
// Login // Login
@ -588,12 +588,12 @@ if ($rowid > 0)
print '<td align="center">'; print '<td align="center">';
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<a href="fiche.php?rowid='.$objp->rowid.'&action=edit&return=liste.php">'.img_edit().'</a>'; print '<a href="card.php?rowid='.$objp->rowid.'&action=edit&return=list.php">'.img_edit().'</a>';
} }
print '&nbsp;'; print '&nbsp;';
if ($user->rights->adherent->supprimer) if ($user->rights->adherent->supprimer)
{ {
print '<a href="fiche.php?rowid='.$objp->rowid.'&action=resign&return=liste.php">'.img_picto($langs->trans("Resiliate"),'disable.png').'</a>'; print '<a href="card.php?rowid='.$objp->rowid.'&action=resign&return=list.php">'.img_picto($langs->trans("Resiliate"),'disable.png').'</a>';
} }
print "</td>"; print "</td>";

View File

@ -37,39 +37,39 @@ accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
// Other parameters COMPTA_* // Other parameters ACCOUNTING_*
$list = array( $list = array(
'COMPTA_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
'COMPTA_PRODUCT_SOLD_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
'COMPTA_SERVICE_BUY_ACCOUNT', 'ACCOUNTING_SERVICE_BUY_ACCOUNT',
'COMPTA_SERVICE_SOLD_ACCOUNT', 'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
'COMPTA_VAT_ACCOUNT', 'ACCOUNTING_VAT_ACCOUNT',
'COMPTA_VAT_BUY_ACCOUNT', 'ACCOUNTING_VAT_BUY_ACCOUNT',
'COMPTA_ACCOUNT_CUSTOMER', 'ACCOUNTING_ACCOUNT_CUSTOMER',
'COMPTA_ACCOUNT_SUPPLIER' 'ACCOUNTING_ACCOUNT_SUPPLIER'
); );
/* /*
* Actions * Actions
*/ */
$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES'; $accounting_mode = defined('ACCOUNTING_MODE')?ACCOUNTING_MODE:'RECETTES-DEPENSES';
if ($action == 'update') if ($action == 'update')
{ {
$error = 0; $error = 0;
$compta_modes = array( $accounting_modes = array(
'RECETTES-DEPENSES', 'RECETTES-DEPENSES',
'CREANCES-DETTES' 'CREANCES-DETTES'
); );
$compta_mode = GETPOST('compta_mode','alpha'); $accounting_mode = GETPOST('accounting_mode','alpha');
if (in_array($compta_mode,$compta_modes)) { if (in_array($accounting_mode,$accounting_modes)) {
if (!dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode, 'chaine', 0, '', $conf->entity)) { if (!dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) {
$error++; $error++;
} }
} else { } else {
@ -113,12 +113,12 @@ print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Cas du parametre COMPTA_MODE // Cas du parametre ACCOUNTING_MODE
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>'; print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; print '<tr '.$bc[false].'><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT // Write info on way to count VAT
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
@ -132,7 +132,7 @@ print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// // print nl2br($langs->trans('OptionModeTrueInfoExpert')); // // print nl2br($langs->trans('OptionModeTrueInfoExpert'));
//} //}
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>'; print '<tr '.$bc[true].'><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n"; print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
print '</form>'; print '</form>';

View File

@ -133,7 +133,7 @@ $tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libe
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1"; $tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
$tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country"; $tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1"; $tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
@ -187,7 +187,7 @@ $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,regio
$tabfield[3] = "code,libelle,country_id,country"; $tabfield[3] = "code,libelle,country_id,country";
$tabfield[4] = "code,label"; $tabfield[4] = "code,label";
$tabfield[5] = "code,label"; $tabfield[5] = "code,label";
$tabfield[6] = "code,libelle,type,position"; $tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; $tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
$tabfield[8] = "code,libelle,country_id,country"; $tabfield[8] = "code,libelle,country_id,country";
$tabfield[9] = "code,label,unicode"; $tabfield[9] = "code,label,unicode";
@ -214,7 +214,7 @@ $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
$tabfieldvalue[3] = "code,libelle,country"; $tabfieldvalue[3] = "code,libelle,country";
$tabfieldvalue[4] = "code,label"; $tabfieldvalue[4] = "code,label";
$tabfieldvalue[5] = "code,label"; $tabfieldvalue[5] = "code,label";
$tabfieldvalue[6] = "code,libelle,type,position"; $tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
$tabfieldvalue[8] = "code,libelle,country"; $tabfieldvalue[8] = "code,libelle,country";
$tabfieldvalue[9] = "code,label,unicode"; $tabfieldvalue[9] = "code,label,unicode";
@ -241,7 +241,7 @@ $tabfieldinsert[2] = "code_departement,nom,fk_region";
$tabfieldinsert[3] = "code_region,nom,fk_pays"; $tabfieldinsert[3] = "code_region,nom,fk_pays";
$tabfieldinsert[4] = "code,label"; $tabfieldinsert[4] = "code,label";
$tabfieldinsert[5] = "code,label"; $tabfieldinsert[5] = "code,label";
$tabfieldinsert[6] = "code,libelle,type,position"; $tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible"; $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
$tabfieldinsert[8] = "code,libelle,fk_country"; $tabfieldinsert[8] = "code,libelle,fk_country";
$tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[9] = "code_iso,label,unicode";

View File

@ -36,7 +36,7 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters COMPTA_* & ACCOUNTING_* // Other parameters SALARIES_*
$list = array ( $list = array (
'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
'SALARIES_ACCOUNTING_ACCOUNT_CHARGE' 'SALARIES_ACCOUNTING_ACCOUNT_CHARGE'

View File

@ -48,11 +48,11 @@ function printBookmarksList($aDb, $aLangs)
// Menu bookmark // Menu bookmark
$ret.= '<div class="menu_titre">'; $ret.= '<div class="menu_titre">';
$ret.= '<table class="nobordernopadding" width="100%" summary="bookmarkstable"><tr><td>'; $ret.= '<table class="nobordernopadding" width="100%" summary="bookmarkstable"><tr><td>';
$ret.= '<a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/liste.php">'.$langs->trans('Bookmarks').'</a>'; $ret.= '<a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</a>';
$ret.= '</td><td align="right">'; $ret.= '</td><td align="right">';
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
$ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url).'">'; $ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url).'">';
//$ret.=img_picto($langs->trans('AddThisPageToBookmarks'),'edit_add').' '; //$ret.=img_picto($langs->trans('AddThisPageToBookmarks'),'edit_add').' ';
$ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark'); $ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark');
$ret.= '</a>'; $ret.= '</a>';

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \file htdocs/bookmarks/fiche.php * \file htdocs/bookmarks/card.php
* \brief Page display/creation of bookmarks * \brief Page display/creation of bookmarks
* \ingroup bookmark * \ingroup bookmark
*/ */
@ -54,7 +54,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if (GETPOST("cancel")) if (GETPOST("cancel"))
{ {
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php')); if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php'));
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -86,7 +86,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if ($res > 0) if ($res > 0)
{ {
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/liste.php'); if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/list.php');
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -205,7 +205,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$bookmark->id.'">'; print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/fiche.php?id='.$bookmark->id.'">'; print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$bookmark->id.'">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
} }
@ -285,7 +285,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
// Remove // Remove
if ($user->rights->bookmark->supprimer && $action != 'edit') if ($user->rights->bookmark->supprimer && $action != 'edit')
{ {
print " <a class=\"butActionDelete\" href=\"liste.php?bid=".$bookmark->id."&amp;action=delete\">".$langs->trans("Delete")."</a>\n"; print " <a class=\"butActionDelete\" href=\"list.php?bid=".$bookmark->id."&amp;action=delete\">".$langs->trans("Delete")."</a>\n";
} }
print '</div>'; print '</div>';

View File

@ -16,7 +16,7 @@
*/ */
/** /**
* \file htdocs/bookmarks/liste.php * \file htdocs/bookmarks/list.php
* \brief Page to display list of bookmarks * \brief Page to display list of bookmarks
* \ingroup bookmark * \ingroup bookmark
*/ */
@ -112,7 +112,7 @@ if ($resql)
// Id // Id
print '<td align="left">'; print '<td align="left">';
print "<a href=\"fiche.php?id=".$obj->bid."\">".img_object($langs->trans("ShowBookmark"),"bookmark").' '.$obj->bid."</a>"; print "<a href=\"card.php?id=".$obj->bid."\">".img_object($langs->trans("ShowBookmark"),"bookmark").' '.$obj->bid."</a>";
print '</td>'; print '</td>';
$lieninterne=0; $lieninterne=0;
@ -178,7 +178,7 @@ if ($resql)
print '<td align="right" class="nowrap">'; print '<td align="right" class="nowrap">';
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
print "<a href=\"".DOL_URL_ROOT."/bookmarks/fiche.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> "; print "<a href=\"".DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";
} }
if ($user->rights->bookmark->supprimer) if ($user->rights->bookmark->supprimer)
{ {
@ -206,7 +206,7 @@ print "<div class=\"tabsAction\">\n";
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewBookmark").'</a>'; print '<a class="butAction" href="card.php?action=create">'.$langs->trans("NewBookmark").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/boutique/client/fiche.php * \file htdocs/boutique/client/card.php
* \ingroup boutique * \ingroup boutique
* \brief Page fiche client OSCommerce * \brief Page fiche client OSCommerce
*/ */
@ -82,7 +82,7 @@ if ($id > 0)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;'; print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/card.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;';
print dol_print_date($dbosc->jdate($objp->date_purchased),'dayhour')."</a>\n"; print dol_print_date($dbosc->jdate($objp->date_purchased),'dayhour')."</a>\n";
print $objp->total . "</a></TD>\n"; print $objp->total . "</a></TD>\n";

View File

@ -47,7 +47,7 @@ if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
print_barre_liste("Liste des clients", $page, "index.php"); print_barre_liste("Liste des clients", $page, $_SERVER["PHP_SELF"]);
$sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter"; $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter";
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers as c"; $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers as c";
@ -61,8 +61,8 @@ if ($resql)
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Firstname"),"index.php", "c.customers_firstname"); print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"], "c.customers_firstname");
print_liste_field_titre($langs->trans("Lastname"),"index.php", "c.customers_lastname"); print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"], "c.customers_lastname");
print '<td>'.$langs->trans("EMail").'</td><td align="center">'.$langs->trans("Newsletter").'</td>'; print '<td>'.$langs->trans("EMail").'</td><td align="center">'.$langs->trans("Newsletter").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
@ -71,8 +71,8 @@ if ($resql)
$objp = $dbosc->fetch_object($resql); $objp = $dbosc->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n"; print '<td><a href="card.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></td>\n"; print '<td><a href="card.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></td>\n";
print "<td>$objp->customers_email_address</td>\n"; print "<td>$objp->customers_email_address</td>\n";
print "<td align=\"center\">$objp->customers_newsletter</td>\n"; print "<td align=\"center\">$objp->customers_newsletter</td>\n";
print "</tr>\n"; print "</tr>\n";

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/boutique/commande/fiche.php * \file htdocs/boutique/commande/card.php
* \ingroup boutique * \ingroup boutique
* \brief Page fiche commande OSCommerce * \brief Page fiche commande OSCommerce
*/ */
@ -49,7 +49,7 @@ if ($id > 0)
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">'; print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td width="20%">Date</td><td width="80%" colspan="2">'.$commande->date.'</td></tr>'; print '<tr><td width="20%">Date</td><td width="80%" colspan="2">'.$commande->date.'</td></tr>';
print '<td width="20%">Client</td><td width="80%" colspan="2"><a href="'.DOL_URL_ROOT.'/boutique/client/fiche.php?id='.$commande->client_id.'">'.$commande->client_name.'</a></td></tr>'; print '<td width="20%">Client</td><td width="80%" colspan="2"><a href="'.DOL_URL_ROOT.'/boutique/client/card.php?id='.$commande->client_id.'">'.$commande->client_name.'</a></td></tr>';
print '<td width="20%">Paiement</td><td width="80%" colspan="2">'.$commande->payment_method.'</td></tr>'; print '<td width="20%">Paiement</td><td width="80%" colspan="2">'.$commande->payment_method.'</td></tr>';
@ -88,14 +88,14 @@ if ($id > 0)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td align="left" width="40%">'; print '<td align="left" width="40%">';
print '<a href="fiche.php?id='.$objp->products_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>'; print '<a href="card.php?id='.$objp->products_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
print '<a href="fiche.php?id='.$objp->products_id.'">'.$objp->products_name.'</a>'; print '<a href="card.php?id='.$objp->products_id.'">'.$objp->products_name.'</a>';
print "</td>"; print "</td>";
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n"; print '<td align="center"><a href="card.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n"; print "<td align=\"right\"><a href=\"card.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n"; print "<td align=\"right\"><a href=\"card.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -71,10 +71,10 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;'; print '<td><a href="card.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;';
print $objp->orders_id ."</a></td><td>"; print $objp->orders_id ."</a></td><td>";
print dol_print_date($dbosc->jdate($objp->date_purchased),'dayhour').'</td>'; print dol_print_date($dbosc->jdate($objp->date_purchased),'dayhour').'</td>';
print '<td><a href="../client/fiche.php?id='.$objp->customers_id.'">'.$objp->customers_name."</a></TD>\n"; print '<td><a href="../client/card.php?id='.$objp->customers_id.'">'.$objp->customers_name."</a></TD>\n";
print '<td align="right">'.price($objp->value).'</td>'; print '<td align="right">'.price($objp->value).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -75,7 +75,7 @@ if ($resql)
$objp = $dbosc->fetch_object($resql); $objp = $dbosc->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<TD><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_model.'</a></TD>'; print '<TD><a href="'.DOL_URL_ROOT.'/boutique/livre/card.php?oscid='.$objp->products_id.'">'.$objp->products_model.'</a></TD>';
print '<TD align="center">'.$objp->rat."</TD>\n"; print '<TD align="center">'.$objp->rat."</TD>\n";
print '<TD align="center">'.$objp->products_quantity."</TD>\n"; print '<TD align="center">'.$objp->products_quantity."</TD>\n";
print '<TD align="center">'.$objp->products_status."</TD>\n"; print '<TD align="center">'.$objp->products_status."</TD>\n";

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/boutique/critiques/fiche.php * \file htdocs/boutique/critiques/card.php
* \ingroup boutique * \ingroup boutique
* \brief Page fiche critique OS Commerce * \brief Page fiche critique OS Commerce
*/ */

View File

@ -72,7 +72,7 @@ if ($resql) {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print "<TD>".substr($objp->products_name, 0, 30)."</TD>\n"; print "<TD>".substr($objp->products_name, 0, 30)."</TD>\n";
print '<TD><a href="fiche.php?id='.$objp->reviews_id.'">'.substr($objp->reviews_text, 0, 40)." ...</a></td>\n"; print '<TD><a href="card.php?id='.$objp->reviews_id.'">'.substr($objp->reviews_text, 0, 40)." ...</a></td>\n";
print "<td align=\"center\">$objp->reviews_rating</TD>\n"; print "<td align=\"center\">$objp->reviews_rating</TD>\n";
print "</TR>\n"; print "</TR>\n";
$i++; $i++;

View File

@ -62,7 +62,7 @@ if ($resql)
$i = 0; $i = 0;
print "<table class=\noborder\" width=\"100%\">"; print "<table class=\noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre("Client","index.php", "c.customers_lastname"); print_liste_field_titre("Client",$_SERVER["PHP_SELF"], "c.customers_lastname");
print '<td>'.$langs->trans("Product").'</td>'; print '<td>'.$langs->trans("Product").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
@ -71,8 +71,8 @@ if ($resql)
$objp = $dbosc->fetch_object($resql); $objp = $dbosc->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->customers_firstname $objp->customers_lastname</a></TD>\n"; print "<td width='70%'><a href=\"card.php?id=$objp->rowid\">$objp->customers_firstname $objp->customers_lastname</a></TD>\n";
print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>"; print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/card.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -73,7 +73,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>"; print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/card.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>";
print '<td align="center">'.$objp->nb.'</td>'; print '<td align="center">'.$objp->nb.'</td>';
print '<td align="center"><a href="index.php?products_id='.$objp->products_id.'">Voir les clients</td>'; print '<td align="center"><a href="index.php?products_id='.$objp->products_id.'">Voir les clients</td>';

View File

@ -44,7 +44,7 @@ if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
print_barre_liste("Liste des clients", $page, "index.php"); print_barre_liste("Liste des clients", $page, $_SERVER["PHP_SELF"]);
$sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter"; $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter";
$sql .= " FROM ".DB_NAME_OSC.".customers as c"; $sql .= " FROM ".DB_NAME_OSC.".customers as c";
@ -58,8 +58,8 @@ if ($resql)
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Firstname"),"index.php", "c.customers_firstname"); print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"], "c.customers_firstname");
print_liste_field_titre($langs->trans("Lastname"),"index.php", "c.customers_lastname"); print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"], "c.customers_lastname");
print '<td>'.$langs->trans("EMail").'</td><td align="center">'.$langs->trans("Newsletter").'</td>'; print '<td>'.$langs->trans("EMail").'</td><td align="center">'.$langs->trans("Newsletter").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
@ -68,8 +68,8 @@ if ($resql)
$objp = $dbosc->fetch_object($resql); $objp = $dbosc->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n"; print '<td><a href="card.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></td>\n"; print '<td><a href="card.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></td>\n";
print "<td>$objp->customers_email_address</td>\n"; print "<td>$objp->customers_email_address</td>\n";
print "<td align=\"center\">$objp->customers_newsletter</td>\n"; print "<td align=\"center\">$objp->customers_newsletter</td>\n";
print "</tr>\n"; print "</tr>\n";

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/boutique/produits/osc-liste.php * \file htdocs/boutique/produits/osc-list.php
* \ingroup boutique * \ingroup boutique
* \brief Page gestion produits du module OsCommerce * \brief Page gestion produits du module OsCommerce
*/ */
@ -46,7 +46,7 @@ $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
print_barre_liste("Liste des produits oscommerce", $page, "osc-liste.php"); print_barre_liste("Liste des produits oscommerce", $page, "osc-list.php");
$sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id"; $sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id";
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products as p, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description as d, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."manufacturers as m"; $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products as p, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description as d, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."manufacturers as m";

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/categories/fiche.php * \file htdocs/categories/card.php
* \ingroup category * \ingroup category
* \brief Page to create a new category * \brief Page to create a new category
*/ */

View File

@ -551,7 +551,7 @@ else if ($id || $ref)
{ {
$langs->load("mails"); $langs->load("mails");
print '<td class="nowrap">'.$langs->trans("NbOfEMailingsReceived").'</td>'; print '<td class="nowrap">'.$langs->trans("NbOfEMailingsReceived").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/liste.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td>';
} }
else else
{ {
@ -642,7 +642,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
if ($user->rights->categorie->creer) if ($user->rights->categorie->creer)
{ {
print '<td align="right">'; print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/categories/fiche.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==1||$typeid==2)?'socid':'id').'='.$object->id.'&type='.$typeid).'">'; print '<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==1||$typeid==2)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
print $langs->trans("CreateCat").' '; print $langs->trans("CreateCat").' ';
print img_picto($langs->trans("Create"),'filenew'); print img_picto($langs->trans("Create"),'filenew');
print "</a>"; print "</a>";

View File

@ -212,7 +212,7 @@ else
print "<tr class='liste_titre'><td colspan='2'>".$langs->trans("SubCats").'</td><td align="right">'; print "<tr class='liste_titre'><td colspan='2'>".$langs->trans("SubCats").'</td><td align="right">';
if ($user->rights->categorie->creer) if ($user->rights->categorie->creer)
{ {
print "<a href='".DOL_URL_ROOT."/categories/fiche.php?action=create&amp;catorigin=".$object->id."&amp;socid=".$object->socid."&amp;type=".$type."&amp;urlfrom=".urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type)."'>"; print "<a href='".DOL_URL_ROOT."/categories/card.php?action=create&amp;catorigin=".$object->id."&amp;socid=".$object->socid."&amp;type=".$type."&amp;urlfrom=".urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type)."'>";
print img_picto($langs->trans("Create"),'filenew'); print img_picto($langs->trans("Create"),'filenew');
print "</a>"; print "</a>";
} }

View File

@ -22,7 +22,7 @@
*/ */
/** /**
* \file htdocs/comm/action/fiche.php * \file htdocs/comm/action/card.php
* \ingroup agenda * \ingroup agenda
* \brief Page for event card * \brief Page for event card
*/ */
@ -93,7 +93,10 @@ if (! empty($_POST['removedassigned']))
$idtoremove=$_POST['removedassigned']; $idtoremove=$_POST['removedassigned'];
if (! empty($_SESSION['assignedtouser'])) $tmpassigneduserids=dol_json_decode($_SESSION['assignedtouser'],1); if (! empty($_SESSION['assignedtouser'])) $tmpassigneduserids=dol_json_decode($_SESSION['assignedtouser'],1);
else $tmpassigneduserids=array(); else $tmpassigneduserids=array();
unset($tmpassigneduserids[$idtoremove]); foreach ($tmpassigneduserids as $key => $val)
{
if ($val['id'] == $idtoremove) unset($tmpassigneduserids[$key]);
}
//var_dump($_POST['removedassigned']);exit; //var_dump($_POST['removedassigned']);exit;
$_SESSION['assignedtouser']=dol_json_encode($tmpassigneduserids); $_SESSION['assignedtouser']=dol_json_encode($tmpassigneduserids);
$donotclearsession=1; $donotclearsession=1;
@ -105,11 +108,14 @@ if (! empty($_POST['removedassigned']))
if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
{ {
// Add a new user // Add a new user
if (GETPOST('affectedto') > 0) if (GETPOST('assignedtouser') > 0)
{ {
$assignedtouser=array(); $assignedtouser=array();
if (! empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); if (! empty($_SESSION['assignedtouser']))
$assignedtouser[GETPOST('affectedto')]=array('transparency'=>GETPOST('transparency'),'mandatory'=>1); {
$assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
}
$assignedtouser[GETPOST('assignedtouser')]=array('id'=>GETPOST('assignedtouser'), 'transparency'=>GETPOST('transparency'),'mandatory'=>1);
$_SESSION['assignedtouser']=dol_json_encode($assignedtouser); $_SESSION['assignedtouser']=dol_json_encode($assignedtouser);
} }
$donotclearsession=1; $donotclearsession=1;
@ -202,22 +208,23 @@ if ($action == 'add')
$object->percentage = $percentage; $object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$listofuserid=dol_json_decode($_SESSION['assignedtouser']); $listofuserid=array();
if (! empty($_SESSION['assignedtouser'])) $listofuserid=dol_json_decode($_SESSION['assignedtouser']);
$i=0; $i=0;
foreach($listofuserid as $key => $value) foreach($listofuserid as $key => $value)
{ {
if ($i == 0) // First entry if ($i == 0) // First entry
{ {
$usertodo=new User($db); $usertodo=new User($db);
if ($key > 0) if ($value['id'] > 0)
{ {
$usertodo->fetch($key); $usertodo->fetch($value['id']);
} }
$object->usertodo = $usertodo; $object->usertodo = $usertodo;
$object->transparency = (GETPOST("transparency")=='on'?1:0); $object->transparency = (GETPOST("transparency")=='on'?1:0);
} }
$object->userassigned[$key]=array('id'=>$key, 'transparency'=>(GETPOST("transparency")=='on'?1:0)); $object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>(GETPOST("transparency")=='on'?1:0));
$i++; $i++;
} }
@ -281,6 +288,8 @@ if ($action == 'add')
{ {
if (! $object->error) if (! $object->error)
{ {
unset($_SESSION['assignedtouser']);
$db->commit(); $db->commit();
if (! empty($backtopage)) if (! empty($backtopage))
{ {
@ -289,7 +298,7 @@ if ($action == 'add')
} }
elseif($idaction) elseif($idaction)
{ {
header("Location: ".DOL_URL_ROOT.'/comm/action/fiche.php?id='.$idaction); header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction);
} }
else else
{ {
@ -337,6 +346,7 @@ if ($action == 'update')
if ($p2min == -1) $p2min='0'; if ($p2min == -1) $p2min='0';
$object->fetch($id); $object->fetch($id);
$object->fetch_userassigned();
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
@ -363,26 +373,26 @@ if ($action == 'update')
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors');
$action = 'edit'; $action = 'edit';
} }
// Users // Users
$listofuserid=dol_json_decode($_SESSION['assignedtouser']); $listofuserid=array();
$i=0; //$assignedtouser=(GETPOST("assignedtouser") >0)?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : 0);
foreach($listofuserid as $key => $value) $assignedtouser=(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : 0);
if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first
if (! empty($_SESSION['assignedtouser']))
{ {
if ($i == 0) // First entry // Restore array with key with same value than param 'id'
$tmplist1=dol_json_decode($_SESSION['assignedtouser'], true); $tmplist2=array();
foreach($tmplist1 as $key => $val)
{ {
$usertodo=new User($db); if ($val['id'] && $val['id'] != $assignedtouser) $listofuserid[$val['id']]=$val;
if ($key > 0)
{
$usertodo->fetch($key);
}
$object->usertodo = $usertodo;
$object->transparency=(GETPOST("transparency")=='on'?1:0);
} }
}
$object->userassigned[$key]=array('id'=>$key, 'transparency'=>(GETPOST("transparency")=='on'?1:0)); $object->userassigned=array(); // Clear old content
foreach($listofuserid as $key => $val)
$i++; {
$object->userassigned[$val['id']]=array('id'=>$val['id'], 'mandatory'=>0, 'transparency'=>(GETPOST("transparency")=='on'?1:0));
} }
if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
@ -424,6 +434,8 @@ if ($action == 'update')
if ($result > 0) if ($result > 0)
{ {
unset($_SESSION['assignedtouser']);
$db->commit(); $db->commit();
} }
else else
@ -438,6 +450,7 @@ if ($action == 'update')
{ {
if (! empty($backtopage)) if (! empty($backtopage))
{ {
unset($_SESSION['assignedtouser']);
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -474,6 +487,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
if ($action == 'mupdate') if ($action == 'mupdate')
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_userassigned();
$shour = dol_print_date($object->datep,"%H"); $shour = dol_print_date($object->datep,"%H");
$smin = dol_print_date($object->datep, "%M"); $smin = dol_print_date($object->datep, "%M");
@ -638,17 +653,28 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>'; if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>';
}
// Assigned to // Assigned to
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$listofuserid=array();
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
$assignedtouser=GETPOST("affectedtouser")?GETPOST("affectedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id); $assignedtouser=GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id);
$_SESSION['assignedtouser']=dol_json_encode(array($assignedtouser=>array('transparency'=>1,'mandatory'=>1))); if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser,'mandatory'=>0,'transparency'=>$object->transparency); // Owner first
$_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'affectedto',1); /*
//print $form->select_dolusers(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1); if (empty($donotclearsession))
{
$assignedtouser=GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id);
$_SESSION['assignedtouser']=dol_json_encode(array($assignedtouser=>array('id'=>$assignedtouser,'transparency'=>1,'mandatory'=>1)));
}*/
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
//print $form->select_dolusers(GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
@ -716,7 +742,7 @@ if ($action == 'create')
$numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid');
if ($numproject==0) if ($numproject==0)
{ {
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>'; print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -768,10 +794,11 @@ if ($action == 'create')
// View or edit // View or edit
if ($id > 0) if ($id > 0)
{ {
$result=$object->fetch($id); $result1=$object->fetch($id);
$object->fetch_optionals($id,$extralabels); $result2=$object->fetch_userassigned();
$result3=$object->fetch_optionals($id,$extralabels);
if ($result < 0) if ($result1 < 0 || $result2 < 0 || $result3 < 0)
{ {
dol_print_error($db,$object->error); dol_print_error($db,$object->error);
exit; exit;
@ -808,7 +835,7 @@ if ($id > 0)
// Confirmation suppression action // Confirmation suppression action
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1); print $form->formconfirm("card.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1);
} }
if ($action == 'edit') if ($action == 'edit')
@ -888,18 +915,22 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>'; if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>';
}
// Assigned to // Assigned to
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
$listofuserid=array(); $listofuserid=array();
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first
$listofuserid=array_merge($listofuserid,$object->userassigned);
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'affectedto',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
//print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'affectedto',1); //print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'assignedtouser',1);
print '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
@ -950,7 +981,7 @@ if ($id > 0)
$numprojet=$formproject->select_projects($object->societe->id,$object->fk_project,'projectid'); $numprojet=$formproject->select_projects($object->societe->id,$object->fk_project,'projectid');
if ($numprojet==0) if ($numprojet==0)
{ {
print ' &nbsp; <a href="../../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>'; print ' &nbsp; <a href="../../projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -1020,13 +1051,16 @@ if ($id > 0)
// Full day event // Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>'; print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>';
$rowspan=4;
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
// Date start // Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">'; print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
else print dol_print_date($object->datep,'day'); else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td rowspan="5" align="center" valign="middle" width="180">'."\n"; print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">'; print '<input type="hidden" name="action" value="show_month">';
@ -1079,11 +1113,23 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>'; if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
}
// Assigned to // Assigned to
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; //if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$listofuserid=array();
if (empty($donotclearsession))
{
if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first
$listofuserid=array_merge($listofuserid,$object->userassigned);
$_SESSION['assignedtouser']=dol_json_encode($listofuserid);
//var_dump($_SESSION['assignedtouser']);
}
print $form->select_dolusers_forevent('view','assignedtouser',1);
print '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
@ -1205,7 +1251,7 @@ if ($id > 0)
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
(($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->create)) (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->create))
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
} }
else else
{ {
@ -1215,7 +1261,7 @@ if ($id > 0)
if ($user->rights->agenda->allactions->delete || if ($user->rights->agenda->allactions->delete ||
(($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete)) (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete))
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a></div>'; print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a></div>';
} }
else else
{ {

View File

@ -62,15 +62,16 @@ class ActionComm extends CommonObject
var $priority; // Small int (0 By default) var $priority; // Small int (0 By default)
var $note; // Description var $note; // Description
var $userassigned; // Array of user ids var $userassigned = array(); // Array of user ids
var $usertodo; // Object user of owner var $usertodo; // Object user of owner
var $userdone; // Object user that did action (deprecated) var $userdone; // Object user that did action (deprecated)
var $socid;
var $contactid;
var $societe; // Company linked to action (optional) var $societe; // Company linked to action (optional)
var $contact; // Contact linked to action (optional) var $contact; // Contact linked to action (optional)
var $fk_project; // Id of project (optional) var $fk_project; // Id of project (optional)
// Properties for links to other objects // Properties for links to other objects
var $fk_element; // Id of record var $fk_element; // Id of record
var $elementtype; // Type of record. This if property ->element of object linked to. var $elementtype; // Type of record. This if property ->element of object linked to.
@ -211,22 +212,43 @@ class ActionComm extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm","id"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm","id");
// Actions on extra fields (by external module or standard code) // Now insert assignedusers
$hookmanager->initHooks(array('actioncommdao')); if (! $error)
$parameters=array('actcomm'=>$this->id); {
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks foreach($this->userassigned as $key => $val)
if (empty($reshook)) {
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".($val['mandatory']?$val['mandatory']:'0').", ".($val['transparency']?$val['transparency']:'0').", ".($val['answer_status']?$val['answer_status']:'0').")";
$resql = $this->db->query($sql);
if (! $resql)
{
$error++;
$this->errors[]=$this->db->lasterror();
}
//var_dump($sql);exit;
}
}
if (! $error)
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used // Actions on extra fields (by external module or standard code)
{ $hookmanager->initHooks(array('actioncommdao'));
$result=$this->insertExtraFields(); $parameters=array('actcomm'=>$this->id);
if ($result < 0) $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
{ if (empty($reshook))
$error++; {
} if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
} {
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
else if ($reshook < 0) $error++;
} }
else if ($reshook < 0) $error++;
if (! $error && ! $notrigger) if (! $error && ! $notrigger)
{ {
@ -354,6 +376,34 @@ class ActionComm extends CommonObject
} }
} }
/**
* Initialize this->userassigned array
*
* @return int <0 if KO, >0 if OK
*/
function fetch_userassigned()
{
global $langs;
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$resql2=$this->db->query($sql);
if ($resql2)
{
while ($obj = $this->db->fetch_object($resql2))
{
$this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency);
}
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/** /**
* Delete event from database * Delete event from database
* *
@ -498,7 +548,28 @@ class ActionComm extends CommonObject
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;
if (! $notrigger) // Now insert assignedusers
if (! $error)
{
$sql ="DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'user'";
$resql = $this->db->query($sql);
foreach($this->userassigned as $key => $val)
{
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".($val['manadatory']?$val['manadatory']:'0').", ".($val['transparency']?$val['transparency']:'0').", ".($val['answer_status']?$val['answer_status']:'0').")";
$resql = $this->db->query($sql);
if (! $resql)
{
$error++;
$this->errors[]=$this->db->lasterror();
}
//var_dump($sql);exit;
}
}
if (! $error && ! $notrigger)
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ACTION_MODIFY',$user); $result=$this->call_trigger('ACTION_MODIFY',$user);
@ -534,9 +605,11 @@ class ActionComm extends CommonObject
* @param int $fk_element Id of element action is linked to * @param int $fk_element Id of element action is linked to
* @param string $elementtype Type of element action is linked to * @param string $elementtype Type of element action is linked to
* @param string $filter Other filter * @param string $filter Other filter
* @param string $sortfield Sort on this field
* @param string $sortorder ASC or DESC
* @return array or string Error string if KO, array with actions if OK * @return array or string Error string if KO, array with actions if OK
*/ */
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='') static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='')
{ {
global $conf, $langs; global $conf, $langs;
@ -552,6 +625,7 @@ class ActionComm extends CommonObject
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'"; else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
} }
if (! empty($filter)) $sql.= $filter; if (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
dol_syslog(get_class()."::getActions", LOG_DEBUG); dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
@ -765,7 +839,7 @@ class ActionComm extends CommonObject
$result=''; $result='';
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">'; if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">'; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$label=$this->label; $label=$this->label;
if (empty($label)) $label=$this->libelle; // Fro backward compatibility if (empty($label)) $label=$this->libelle; // Fro backward compatibility
@ -957,7 +1031,7 @@ class ActionComm extends CommonObject
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$url=$urlwithroot.'/comm/action/fiche.php?id='.$obj->id; $url=$urlwithroot.'/comm/action/card.php?id='.$obj->id;
$event['url']=$url; $event['url']=$url;
$event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); $event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
$event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); $event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));

View File

@ -1104,7 +1104,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
//$param='month='.$monthshown.'&year='.$year; //$param='month='.$monthshown.'&year='.$year;
$hourminsec='100000'; $hourminsec='100000';
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">'; print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
print img_picto($langs->trans("NewAction"),'edit_add.png'); print img_picto($langs->trans("NewAction"),'edit_add.png');
print '</a>'; print '</a>';
} }

View File

@ -410,6 +410,8 @@ if ($resql)
$event->location=$obj->location; $event->location=$obj->location;
$event->transparency=$obj->transparency; $event->transparency=$obj->transparency;
$event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact;
$event->societe->id=$obj->fk_soc; $event->societe->id=$obj->fk_soc;
$event->contact->id=$obj->fk_contact; $event->contact->id=$obj->fk_contact;
@ -656,7 +658,7 @@ jQuery(document).ready(function() {
if (ids == \'none\') /* No event */ if (ids == \'none\') /* No event */
{ {
/* alert(\'no event\'); */ /* alert(\'no event\'); */
url = "'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&affectedto="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'" url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'"
window.location.href = url; window.location.href = url;
} }
else if (ids.indexOf(",") > -1) /* There is several events */ else if (ids.indexOf(",") > -1) /* There is several events */
@ -668,7 +670,7 @@ jQuery(document).ready(function() {
else /* One event */ else /* One event */
{ {
/* alert(\'one event\'); */ /* alert(\'one event\'); */
url = "'.DOL_URL_ROOT.'/comm/action/fiche.php?action=view&id="+ids url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=view&id="+ids
window.location.href = url; window.location.href = url;
} }
}); });
@ -779,7 +781,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
} }
//$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
// Show rect of event // Define all rects with event (cases1 is first half hour, cases2 is second half hour)
for ($h = $begin_h; $h < $end_h; $h++) for ($h = $begin_h; $h < $end_h; $h++)
{ {
$color = ''; //init $color = ''; //init
@ -797,12 +799,22 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$busy=$event->transparency; $busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy; $cases1[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label; $cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
$cases1[$h][$event->id]['string'].='xxx';
}
} }
if ($event->date_start_in_calendar < $c && $dateendtouse > $b) if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
{ {
$busy=$event->transparency; $busy=$event->transparency;
$cases2[$h][$event->id]['busy']=$busy; $cases2[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label; $cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
$cases2[$h][$event->id]['string'].='xxx';
}
} }
} }
else else
@ -812,6 +824,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$cases2[$h][$event->id]['busy']=$busy; $cases2[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=$event->label; $cases1[$h][$event->id]['string']=$event->label;
$cases2[$h][$event->id]['string']=$event->label; $cases2[$h][$event->id]['string']=$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
$cases2[$h][$event->id]['typecode']=$event->type_code;
break; break;
} }
} }

View File

@ -95,7 +95,7 @@ if ($action == 'add' || $action == 'update')
} }
elseif ($origin == 'shipment') elseif ($origin == 'shipment')
{ {
header("Location: ../expedition/fiche.php?id=".$originid); header("Location: ../expedition/card.php?id=".$originid);
exit; exit;
} }
else else
@ -135,7 +135,7 @@ if ($action == 'add' || $action == 'update')
} }
elseif ($origin == 'shipment') elseif ($origin == 'shipment')
{ {
header("Location: ../expedition/fiche.php?id=".$originid); header("Location: ../expedition/card.php?id=".$originid);
exit; exit;
} }
else else

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \file htdocs/comm/fiche.php * \file htdocs/comm/card.php
* \ingroup commercial compta * \ingroup commercial compta
* \brief Page to show customer card of a third party * \brief Page to show customer card of a third party
*/ */
@ -439,11 +439,11 @@ if ($id > 0)
// Status // Status
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="2">'.$object->getLibProspCommStatut(4).'</td>'; print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="2">'.$object->getLibProspCommStatut(4).'</td>';
print '<td>'; print '<td>';
if ($object->stcomm_id != -1) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=-1&amp;action=cstc">'.img_action(0,-1).'</a>'; if ($object->stcomm_id != -1) print '<a href="card.php?socid='.$object->id.'&amp;stcomm=-1&amp;action=cstc">'.img_action(0,-1).'</a>';
if ($object->stcomm_id != 0) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=0&amp;action=cstc">'.img_action(0,0).'</a>'; if ($object->stcomm_id != 0) print '<a href="card.php?socid='.$object->id.'&amp;stcomm=0&amp;action=cstc">'.img_action(0,0).'</a>';
if ($object->stcomm_id != 1) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=1&amp;action=cstc">'.img_action(0,1).'</a>'; if ($object->stcomm_id != 1) print '<a href="card.php?socid='.$object->id.'&amp;stcomm=1&amp;action=cstc">'.img_action(0,1).'</a>';
if ($object->stcomm_id != 2) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=2&amp;action=cstc">'.img_action(0,2).'</a>'; if ($object->stcomm_id != 2) print '<a href="card.php?socid='.$object->id.'&amp;stcomm=2&amp;action=cstc">'.img_action(0,2).'</a>';
if ($object->stcomm_id != 3) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=3&amp;action=cstc">'.img_action(0,3).'</a>'; if ($object->stcomm_id != 3) print '<a href="card.php?socid='.$object->id.'&amp;stcomm=3&amp;action=cstc">'.img_action(0,3).'</a>';
print '</td></tr>'; print '</td></tr>';
} }
@ -592,7 +592,7 @@ if ($id > 0)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/liste.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>'; print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
//if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>'; //if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
//else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>'; //else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
@ -606,7 +606,7 @@ if ($id > 0)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n"; print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>'; print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
print '<td align="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>'; print '<td align="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
@ -647,7 +647,7 @@ if ($id > 0)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/liste.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' ('.$num.')</a></td></tr></table></td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' ('.$num.')</a></td></tr></table></td>';
print '</tr>'; print '</tr>';
} }
$i = 0; $i = 0;
@ -719,7 +719,7 @@ if ($id > 0)
$fichinter_static->statut=$objp->fk_statut; $fichinter_static->statut=$objp->fk_statut;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n"; print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n";
//print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n"; //print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
print '<td align="right" width="120">'.convertSecondToTime($objp->duration).'</td>'."\n"; print '<td align="right" width="120">'.convertSecondToTime($objp->duration).'</td>'."\n";
print '<td align="right" width="100">'.$fichinter_static->getLibStatut(5).'</td>'."\n"; print '<td align="right" width="100">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
@ -835,19 +835,19 @@ if ($id > 0)
if (! empty($conf->commande->enabled) && $user->rights->commande->creer) if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
{ {
$langs->load("orders"); $langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
} }
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
$langs->load("contracts"); $langs->load("contracts");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
} }
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
{ {
$langs->load("fichinter"); $langs->load("fichinter");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
} }
// Add invoice // Add invoice
@ -856,7 +856,7 @@ if ($id > 0)
if (! empty($conf->deplacement->enabled)) if (! empty($conf->deplacement->enabled))
{ {
$langs->load("trips"); $langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
} }
if (! empty($conf->facture->enabled)) if (! empty($conf->facture->enabled))
@ -888,7 +888,7 @@ if ($id > 0)
{ {
if ($user->rights->agenda->myactions->create) if ($user->rights->agenda->myactions->create)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a></div>';
} }
else else
{ {

View File

@ -59,12 +59,12 @@ llxHeader('','Contacts');
if ($type == "c" || $type == "p") if ($type == "c" || $type == "p")
{ {
$label = $langs->trans("Customers"); $label = $langs->trans("Customers");
$urlfiche="fiche.php"; $urlfiche="card.php";
} }
if ($type == "f") if ($type == "f")
{ {
$label = $langs->trans("Suppliers"); $label = $langs->trans("Suppliers");
$urlfiche="fiche.php"; $urlfiche="card.php";
} }
/* /*
@ -154,8 +154,8 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact"); print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>'; print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
print "<td>$obj->firstname</TD>"; print "<td>$obj->firstname</TD>";
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';

View File

@ -91,7 +91,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$var=false; $var=false;
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/liste.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchACustomerOrder").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchACustomerOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
@ -105,7 +105,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{ {
$var=false; $var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAContract").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAContract").'</td></tr>';
@ -217,7 +217,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td class="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>'; print '<tr '.$bc[$var].'><td class="nowrap"><a href="../commande/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
@ -417,7 +417,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr ".$bc[$var]."><td><a href=\"../contrat/fiche.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>"; print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
print '<td>'; print '<td>';
$companystatic->id=$objp->rowid; $companystatic->id=$objp->rowid;
$companystatic->name=$objp->name; $companystatic->name=$objp->name;
@ -497,7 +497,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print "</td>"; print "</td>";
print '<td align="left"><a href="fiche.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n"; print '<td align="left"><a href="card.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n";
print '<td align="right">'; print '<td align="right">';
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n"; print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/comm/mailing/fiche.php * \file htdocs/comm/mailing/card.php
* \ingroup mailing * \ingroup mailing
* \brief Fiche mailing, onglet general * \brief Fiche mailing, onglet general
*/ */
@ -174,7 +174,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
dol_syslog("fiche.php: select targets", LOG_DEBUG); dol_syslog("card.php: select targets", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -182,7 +182,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
if ($num) if ($num)
{ {
dol_syslog("comm/mailing/fiche.php: nb of targets = ".$num, LOG_DEBUG); dol_syslog("comm/mailing/card.php: nb of targets = ".$num, LOG_DEBUG);
$now=dol_now(); $now=dol_now();
@ -280,7 +280,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
// Mail successful // Mail successful
$nbok++; $nbok++;
dol_syslog("comm/mailing/fiche.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); dol_syslog("comm/mailing/card.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
@ -296,7 +296,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
{ {
//Update status communication of thirdparty prospect //Update status communication of thirdparty prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")"; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")";
dol_syslog("fiche.php: set prospect thirdparty status", LOG_DEBUG); dol_syslog("card.php: set prospect thirdparty status", LOG_DEBUG);
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
@ -305,7 +305,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
//Update status communication of contact prospect //Update status communication of contact prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("fiche.php: set prospect contact status", LOG_DEBUG); dol_syslog("card.php: set prospect contact status", LOG_DEBUG);
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
@ -323,7 +323,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
// Mail failed // Mail failed
$nbko++; $nbko++;
dol_syslog("comm/mailing/fiche.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING); dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
@ -364,7 +364,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
} }
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id; $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id;
dol_syslog("comm/mailing/fiche.php: update global status", LOG_DEBUG); dol_syslog("comm/mailing/card.php: update global status", LOG_DEBUG);
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
@ -631,7 +631,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
{ {
if ($object->delete($object->id)) if ($object->delete($object->id))
{ {
$url= (! empty($urlfrom) ? $urlfrom : 'liste.php'); $url= (! empty($urlfrom) ? $urlfrom : 'list.php');
header("Location: ".$url); header("Location: ".$url);
exit; exit;
} }
@ -769,7 +769,7 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
@ -858,7 +858,7 @@ else
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;id='.$object->id.'">'.$langs->trans("EditMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;id='.$object->id.'">'.$langs->trans("EditMailing").'</a>';
} }
//print '<a class="butAction" href="fiche.php?action=test&amp;id='.$object->id.'">'.$langs->trans("PreviewMailing").'</a>'; //print '<a class="butAction" href="card.php?action=test&amp;id='.$object->id.'">'.$langs->trans("PreviewMailing").'</a>';
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
{ {
@ -1066,7 +1066,7 @@ else
print "</div>"; print "</div>";
print "\n"; print "\n";
print '<form name="edit_mailing" action="fiche.php" method="post" enctype="multipart/form-data">'."\n"; print '<form name="edit_mailing" action="card.php" method="post" enctype="multipart/form-data">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';

View File

@ -144,7 +144,7 @@ if ($action == 'delete')
} }
else else
{ {
header("Location: liste.php"); header("Location: list.php");
exit; exit;
} }
} }
@ -180,7 +180,7 @@ if ($object->fetch($id) >= 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';

View File

@ -51,7 +51,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
// Recherche emails // Recherche emails
$var=false; $var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAMailing").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAMailing").'</td></tr>';
@ -162,7 +162,7 @@ if ($result)
print '<td colspan="2">'.$langs->trans("LastMailings",$limit).'</td>'; print '<td colspan="2">'.$langs->trans("LastMailings",$limit).'</td>';
print '<td align="center">'.$langs->trans("DateCreation").'</td>'; print '<td align="center">'.$langs->trans("DateCreation").'</td>';
print '<td align="center">'.$langs->trans("NbOfEMails").'</td>'; print '<td align="center">'.$langs->trans("NbOfEMails").'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'.$langs->trans("AllEMailings").'</a></td></tr>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td></tr>';
$num = $db->num_rows($result); $num = $db->num_rows($result);
if ($num > 0) if ($num > 0)
@ -176,7 +176,7 @@ if ($result)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>'; print '<td class="nowrap"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre,38).'</td>'; print '<td>'.dol_trunc($obj->titre,38).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>';
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>'; print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \file htdocs/comm/mailing/liste.php * \file htdocs/comm/mailing/list.php
* \ingroup mailing * \ingroup mailing
* \brief Liste des mailings * \brief Liste des mailings
*/ */
@ -136,7 +136,7 @@ if ($result)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/fiche.php?id='.$obj->rowid.'">'; print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).'</a></td>'; print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).'</a></td>';
print '<td>'.$obj->titre.'</td>'; print '<td>'.$obj->titre.'</td>';
// Date creation // Date creation

View File

@ -156,7 +156,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
@ -176,7 +176,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} else { } else {
$langs->load("errors"); $langs->load("errors");
@ -475,7 +475,7 @@ else if ($action == 'add' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
@ -664,10 +664,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
// Go back to draft // Go back to draft
if ($action == 'modif' && $user->rights->propal->creer) { if ($action == 'modif' && $user->rights->propal->creer)
{
$object->set_draft($user); $object->set_draft($user);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
@ -676,7 +678,7 @@ if ($action == 'modif' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
@ -890,7 +892,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['prod_entry_mode']); unset($_POST ['prod_entry_mode']);
@ -1018,7 +1020,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['qty']); unset($_POST ['qty']);
@ -1060,7 +1062,7 @@ else if ($action == 'builddoc' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result = propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($db, $result); dol_print_error($db, $result);
@ -1146,7 +1148,7 @@ else if ($action == 'up' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid')); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid'));
@ -1165,7 +1167,7 @@ else if ($action == 'down' && $user->rights->propal->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid')); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid'));
@ -1460,7 +1462,7 @@ if ($action == 'create')
$numprojet = $formproject->select_projects($soc->id, $projectid); $numprojet = $formproject->select_projects($soc->id, $projectid);
if ($numprojet == 0) { if ($numprojet == 0) {
$langs->load("projects"); $langs->load("projects");
print ' &nbsp; <a href="../projet/fiche.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>'; print ' &nbsp; <a href="../projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -1961,7 +1963,7 @@ if ($action == 'create')
print '<td colspan="3">'; print '<td colspan="3">';
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($object->fk_project); $proj->fetch($object->fk_project);
print '<a href="../projet/fiche.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; print '<a href="../projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
print $proj->ref; print $proj->ref;
print '</a>'; print '</a>';
print '</td>'; print '</td>';
@ -2010,26 +2012,34 @@ if ($action == 'create')
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified
// by // by
// hook // hook
if (empty($reshook) && ! empty($extrafields->attribute_label)) { if (empty($reshook) && ! empty($extrafields->attribute_label))
foreach ($extrafields->attribute_label as $key => $label) { {
if ($action == 'edit_extras') { foreach ($extrafields->attribute_label as $key => $label)
{
if ($action == 'edit_extras')
{
$value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]);
} else { }
else
{
$value = $object->array_options ["options_" . $key]; $value = $object->array_options ["options_" . $key];
} }
if ($extrafields->attribute_type [$key] == 'separate') { if ($extrafields->attribute_type [$key] == 'separate')
{
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key);
} else { }
else
{
print '<tr><td'; print '<tr><td';
if (! empty($extrafields->attribute_required [$key])) if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
print ' class="fieldrequired"';
print '>' . $label . '</td><td colspan="5">'; print '>' . $label . '</td><td colspan="5">';
// Convert date into timestamp format // Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
} }
if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key) { if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">'; print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">'; print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">'; print '<input type="hidden" name="attribute" value="' . $key . '">';
@ -2041,7 +2051,9 @@ if ($action == 'create')
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>'; print '</form>';
} else { }
else
{
print $extrafields->showOutputField($key, $value); print $extrafields->showOutputField($key, $value);
if ($object->statut == 0 && $user->rights->propal->creer) if ($object->statut == 0 && $user->rights->propal->creer)
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>'; print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
@ -2201,7 +2213,7 @@ if ($action == 'create')
// else on // else on
// page. // page.
{ {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>'; print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
} }
// Edit // Edit
if ($object->statut == 1 && $user->rights->propal->creer) { if ($object->statut == 1 && $user->rights->propal->creer) {
@ -2225,7 +2237,7 @@ if ($action == 'create')
// Create an order // Create an order
if (! empty($conf->commande->enabled) && $object->statut == 2) { if (! empty($conf->commande->enabled) && $object->statut == 2) {
if ($user->rights->commande->creer) { if ($user->rights->commande->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/commande/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddOrder") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/commande/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddOrder") . '</a></div>';
} }
} }
@ -2234,7 +2246,7 @@ if ($action == 'create')
$langs->load("contracts"); $langs->load("contracts");
if ($user->rights->contrat->creer) { if ($user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>';
} }
} }
@ -2338,7 +2350,7 @@ if ($action == 'create')
// Build document if it not exists // Build document if it not exists
if (! $file || ! is_readable($file)) { if (! $file || ! is_readable($file)) {
$result = propale_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($db, $result); dol_print_error($db, $result);
exit(); exit();

View File

@ -10,6 +10,7 @@
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-214 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-214 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -1746,7 +1747,7 @@ class Propal extends CommonObject
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
//$ret=$object->fetch($id); // Reload to get new records //$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $this->generateDocument($conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
// Call trigger // Call trigger
@ -1768,7 +1769,7 @@ class Propal extends CommonObject
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
//$ret=$object->fetch($id); // Reload to get new records //$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $this->generateDocument($conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
// Call trigger // Call trigger
@ -2673,6 +2674,41 @@ class Propal extends CommonObject
} }
} }
/**
* Create a document onto disk according to template module.
*
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
$langs->load("propale");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->PROPALE_ADDON_PDF))
{
$modele = $conf->global->PROPALE_ADDON_PDF;
}
else
{
$modele = 'azur';
}
}
$modelpath = "core/modules/propale/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }

View File

@ -127,7 +127,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'.$propalstatic->LibStatut($status,0).'</td>'; print '<td>'.$propalstatic->LibStatut($status,0).'</td>';
print '<td align="right"><a href="liste.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>'; print '<td align="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
print "</tr>\n"; print "</tr>\n";
} }
} }
@ -399,7 +399,7 @@ if (! empty($conf->propal->enabled))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=1">('.$num.')</a></td></tr>'; print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1">('.$num.')</a></td></tr>';
if ($num) if ($num)
{ {
@ -433,7 +433,7 @@ if (! empty($conf->propal->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@ -471,7 +471,7 @@ if (! empty($conf->propal->enabled))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=2">('.$num.')</a></td></tr>'; print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2">('.$num.')</a></td></tr>';
if ($num) if ($num)
{ {
@ -505,7 +505,7 @@ if (! empty($conf->propal->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@ -370,7 +370,7 @@ if ($result)
print $objp->ref_client; print $objp->ref_client;
print '</td>'; print '</td>';
$url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->rowid; $url = DOL_URL_ROOT.'/comm/card.php?socid='.$objp->rowid;
// Company // Company
$companystatic->id=$objp->rowid; $companystatic->id=$objp->rowid;

View File

@ -242,7 +242,7 @@ if ($resql)
if ($num == 1 && $socname) if ($num == 1 && $socname)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
header("Location: fiche.php?socid=".$obj->rowid); header("Location: card.php?socid=".$obj->rowid);
exit; exit;
} }
else else

View File

@ -184,7 +184,7 @@ if ($socid > 0)
print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>'; print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>';
print '<td align="center">'.price2num($obj->remise_percent).'%</td>'; print '<td align="center">'.price2num($obj->remise_percent).'%</td>';
print '<td align="left">'.$obj->note.'</td>'; print '<td align="left">'.$obj->note.'</td>';
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }

View File

@ -367,7 +367,7 @@ if ($socid > 0)
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>'; print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
print '<td align="right">'.price($obj->amount_ttc).'</td>'; print '<td align="right">'.price($obj->amount_ttc).'</td>';
print '<td align="center">'; print '<td align="center">';
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
print '</td>'; print '</td>';
if ($user->rights->societe->creer || $user->rights->facture->creer) if ($user->rights->societe->creer || $user->rights->facture->creer)
{ {
@ -524,7 +524,7 @@ if ($socid > 0)
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>'; print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
print '<td align="right">'.price($obj->amount_ttc).'</td>'; print '<td align="right">'.price($obj->amount_ttc).'</td>';
print '<td align="center">'; print '<td align="center">';
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>'; print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@ -167,7 +167,7 @@ if ($id > 0 || ! empty($ref))
// Client // Client
print "<tr><td>".$langs->trans("Customer")."</td>"; print "<tr><td>".$langs->trans("Customer")."</td>";
print '<td colspan="2">'; print '<td colspan="2">';
print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a>'; print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->nom.'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -26,7 +26,7 @@
*/ */
/** /**
* \file htdocs/commande/fiche.php * \file htdocs/commande/card.php
* \ingroup commande * \ingroup commande
* \brief Page to show customer order * \brief Page to show customer order
*/ */
@ -178,7 +178,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($object->id); // Reload to get new records $ret = $object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
@ -491,7 +491,7 @@ else if ($action == 'setconditions' && $user->rights->commande->creer) {
} }
$ret = $object->fetch($object->id); // Reload to get new records $ret = $object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
} }
@ -722,7 +722,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['prod_entry_mode']); unset($_POST ['prod_entry_mode']);
@ -847,7 +847,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
} }
$ret = $object->fetch($object->id); // Reload to get new records $ret = $object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['qty']); unset($_POST ['qty']);
@ -911,8 +911,9 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }
} }
} }
@ -958,7 +959,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($object->id); // Reload to get new records $ret = $object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
} }
@ -1023,8 +1024,9 @@ else if ($action == 'up' && $user->rights->commande->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#' . GETPOST('rowid')); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#' . GETPOST('rowid'));
exit(); exit();
@ -1044,8 +1046,9 @@ else if ($action == 'down' && $user->rights->commande->creer) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#' . GETPOST('rowid')); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#' . GETPOST('rowid'));
exit(); exit();
@ -1073,7 +1076,7 @@ else if ($action == 'builddoc') // In get or post
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result = commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($db, $result); dol_print_error($db, $result);
@ -1553,7 +1556,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">'; print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
$numprojet = $formproject->select_projects($soc->id, $projectid); $numprojet = $formproject->select_projects($soc->id, $projectid);
if ($numprojet == 0) { if ($numprojet == 0) {
print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/fiche.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>'; print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -1875,7 +1878,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/commande/liste.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref // Ref
print '<tr><td width="18%">' . $langs->trans('Ref') . '</td>'; print '<tr><td width="18%">' . $langs->trans('Ref') . '</td>';
@ -2296,14 +2299,14 @@ if ($action == 'create' && $user->rights->commande->creer) {
} }
// Edit // Edit
if ($object->statut == 1 && $user->rights->commande->creer) { if ($object->statut == 1 && $user->rights->commande->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?id=' . $object->id . '&amp;action=modif">' . $langs->trans('Modify') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&amp;action=modif">' . $langs->trans('Modify') . '</a></div>';
} }
// Create event // Create event
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
// "workflow" action so should appears somewhere else on // "workflow" action so should appears somewhere else on
// page. // page.
{ {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>'; print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
} }
// Send // Send
if ($object->statut > 0) { if ($object->statut > 0) {
@ -2338,7 +2341,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
if ($object->statut > 0 && $object->statut < 3 && $object->getNbOfServicesLines() > 0) { if ($object->statut > 0 && $object->statut < 3 && $object->getNbOfServicesLines() > 0) {
if ($user->rights->ficheinter->creer) { if ($user->rights->ficheinter->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fichinter/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddIntervention') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fichinter/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddIntervention') . '</a></div>';
} else { } else {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('AddIntervention') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('AddIntervention') . '</a></div>';
} }
@ -2355,7 +2358,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
$langs->load("contracts"); $langs->load("contracts");
if ($user->rights->contrat->creer) { if ($user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/fiche.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>';
} }
} }
@ -2462,7 +2465,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
// Build document if it not exists // Build document if it not exists
if (! $file || ! is_readable($file)) { if (! $file || ! is_readable($file)) {
$result = commande_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($db, $result); dol_print_error($db, $result);
exit(); exit();

View File

@ -7,6 +7,7 @@
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -2699,7 +2700,7 @@ class Commande extends CommonOrder
$result=''; $result='';
if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id;
if ($short) return $url; if ($short) return $url;
@ -3011,6 +3012,40 @@ class Commande extends CommonOrder
} }
} }
/**
* Create a document onto disk accordign to template module.
*
* @param string $modele Force le mnodele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs,$hookmanager;
$langs->load("orders");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->COMMANDE_ADDON_PDF))
{
$modele = $conf->global->COMMANDE_ADDON_PDF;
}
else
{
$modele = 'einstein';
}
}
$modelpath = "core/modules/commande/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }

View File

@ -152,7 +152,7 @@ if ($id > 0 || ! empty($ref))
*/ */
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';

View File

@ -106,7 +106,7 @@ if ($id > 0 || ! empty($ref))
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'; print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">';

View File

@ -63,7 +63,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
// Search customer orders // Search customer orders
$var=false; $var=false;
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/liste.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
@ -141,7 +141,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>'; print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>';
print '<td align="right"><a href="liste.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
print $commandestatic->LibStatut($status,$bool,3); print $commandestatic->LibStatut($status,$bool,3);
print '</a>'; print '</a>';
print '</td>'; print '</td>';
@ -194,8 +194,8 @@ if (! empty($conf->commande->enabled))
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>"; print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$i++; $i++;
} }
} }
@ -268,7 +268,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>'; print '</tr>';
@ -303,7 +303,7 @@ if (! empty($conf->commande->enabled))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=1">('.$num.')</a></td></tr>'; print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1">('.$num.')</a></td></tr>';
if ($num) if ($num)
{ {
@ -337,7 +337,7 @@ if (! empty($conf->commande->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@ -374,7 +374,7 @@ if (! empty($conf->commande->enabled))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=2">('.$num.')</a></td></tr>'; print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2">('.$num.')</a></td></tr>';
if ($num) if ($num)
{ {
@ -408,7 +408,7 @@ if (! empty($conf->commande->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@ -22,7 +22,7 @@
*/ */
/** /**
* \file htdocs/commande/liste.php * \file htdocs/commande/list.php
* \ingroup commande * \ingroup commande
* \brief Page to list orders * \brief Page to list orders
*/ */

View File

@ -79,7 +79,7 @@ if ($id > 0 || ! empty($ref))
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';

View File

@ -579,10 +579,10 @@ if (($action != 'create' && $action != 'add') || !$error)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),'orderstoinvoice.php','c.ref','','&amp;socid='.$socid,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomerOrder'),'orderstoinvoice.php','c.ref_client','','&amp;socid='.$socid,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('OrderDate'),'orderstoinvoice.php','c.date_commande','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DeliveryDate'),'orderstoinvoice.php','c.date_livraison','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '</tr>'; print '</tr>';

View File

@ -48,7 +48,7 @@ foreach($linkedObjectBlock as $object)
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td> <tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td> <a href="<?php echo DOL_URL_ROOT.'/commande/card.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php <td align="right"><?php
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {

View File

@ -589,7 +589,7 @@ if ($id > 0 || ! empty($ref))
} }
elseif ($links[$key]['type']=='payment_sc') elseif ($links[$key]['type']=='payment_sc')
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
//print $langs->trans("SocialContributionPayment"); //print $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/compta/bank/fiche.php * \file htdocs/compta/bank/card.php
* \ingroup banque * \ingroup banque
* \brief Page to create/view a bank account * \brief Page to create/view a bank account
*/ */

View File

@ -882,7 +882,7 @@ class Account extends CommonObject
if (empty($mode)) if (empty($mode))
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
} }
else if ($mode == 'transactions') else if ($mode == 'transactions')

View File

@ -250,7 +250,7 @@ print "</table>";
print '<div class="tabsAction">'."\n"; print '<div class="tabsAction">'."\n";
if ($user->rights->banque->configurer) if ($user->rights->banque->configurer)
{ {
print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>'; print '<a class="butAction" href="card.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -304,13 +304,13 @@ if ($result)
{ {
if ($key) print '<br>'; if ($key) print '<br>';
if ($links[$key]['type']=='payment') { if ($links[$key]['type']=='payment') {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPayment'),'payment').' '; print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("Payment"); print $langs->trans("Payment");
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='payment_supplier') { else if ($links[$key]['type']=='payment_supplier') {
print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPayment'),'payment').' '; print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("Payment"); print $langs->trans("Payment");
print '</a>'; print '</a>';
@ -328,25 +328,25 @@ if ($result)
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='payment_sc') { else if ($links[$key]['type']=='payment_sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPayment'),'payment').' '; print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment"); print $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='payment_vat') { else if ($links[$key]['type']=='payment_vat') {
print '<a href="'.DOL_URL_ROOT.'/compta/tva/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowVAT'),'payment').' '; print img_object($langs->trans('ShowVAT'),'payment').' ';
print $langs->trans("VATPayment"); print $langs->trans("VATPayment");
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='payment_salary') { else if ($links[$key]['type']=='payment_salary') {
print '<a href="'.DOL_URL_ROOT.'/compta/salaries/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPaymentSalary'),'payment').' '; print img_object($langs->trans('ShowPaymentSalary'),'payment').' ';
print $langs->trans("SalaryPayment"); print $langs->trans("SalaryPayment");
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='member') { else if ($links[$key]['type']=='member') {
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowMember'),'user').' '; print img_object($langs->trans('ShowMember'),'user').' ';
print $links[$key]['label']; print $links[$key]['label'];
print '</a>'; print '</a>';

View File

@ -327,7 +327,7 @@ if ($resql)
else if ($links[$key]['type']=='payment_sc') else if ($links[$key]['type']=='payment_sc')
{ {
// We don't show anything because there is 1 payment for 1 social contribution and we already show link to social contribution // We don't show anything because there is 1 payment for 1 social contribution and we already show link to social contribution
/*print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">'; /*print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPayment'),'payment').' '; print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment"); print $langs->trans("SocialContributionPayment");
print '</a>';*/ print '</a>';*/
@ -347,7 +347,7 @@ if ($resql)
print '</a>'; print '</a>';
} }
else if ($links[$key]['type']=='member') { else if ($links[$key]['type']=='member') {
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowMember'),'user').' '; print img_object($langs->trans('ShowMember'),'user').' ';
print $links[$key]['label']; print $links[$key]['label'];
print '</a>'; print '</a>';

View File

@ -349,7 +349,7 @@ else
} }
elseif ($links[$key]['type']=='payment_sc') elseif ($links[$key]['type']=='payment_sc')
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment"); print $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';
@ -398,7 +398,7 @@ else
$newline=0; $newline=0;
} }
elseif ($links[$key]['type']=='member') { elseif ($links[$key]['type']=='member') {
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowMember'),'user').' '; print img_object($langs->trans('ShowMember'),'user').' ';
print $links[$key]['label']; print $links[$key]['label'];
print '</a>'; print '</a>';

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/compta/deplacement/fiche.php * \file htdocs/compta/deplacement/card.php
* \brief Page to show a trip card * \brief Page to show a trip card
*/ */

View File

@ -358,7 +358,7 @@ class Deplacement extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$picto='trip'; $picto='trip';

View File

@ -134,7 +134,7 @@ if ($resql)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Id // Id
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$obj->rowid.'</a></td>'; print '<td><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$obj->rowid.'</a></td>';
// Type // Type
print '<td>'.$langs->trans($obj->type).'</td>'; print '<td>'.$langs->trans($obj->type).'</td>';
// Date // Date

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/compta/dons/fiche.php * \file htdocs/compta/dons/card.php
* \ingroup don * \ingroup don
* \brief Page of donation card * \brief Page of donation card
*/ */
@ -164,7 +164,7 @@ if ($action == 'add')
if ($action == 'delete') if ($action == 'delete')
{ {
$don->delete($id); $don->delete($id);
header("Location: liste.php"); header("Location: list.php");
exit; exit;
} }
if ($action == 'commentaire') if ($action == 'commentaire')
@ -268,7 +268,7 @@ if ($action == 'create')
{ {
print_fiche_titre($langs->trans("AddDonation")); print_fiche_titre($langs->trans("AddDonation"));
print '<form name="add" action="fiche.php" method="post">'; print '<form name="add" action="card.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -352,7 +352,7 @@ if (! empty($id) && $action == 'edit')
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic'); dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
print '<form name="update" action="fiche.php" method="post">'; print '<form name="update" action="card.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -455,11 +455,11 @@ if (! empty($id) && $action != 'edit')
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic'); dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
print "<form action=\"fiche.php\" method=\"post\">"; print "<form action=\"card.php\" method=\"post\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$nbrows=12; $nbrows=12;
if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
@ -529,16 +529,16 @@ if (! empty($id) && $action != 'edit')
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=edit&rowid='.$don->id.'">'.$langs->trans('Modify').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&rowid='.$don->id.'">'.$langs->trans('Modify').'</a></div>';
if ($don->statut == 0) if ($don->statut == 0)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
} }
if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0) if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
} }
// TODO Gerer action emettre paiement // TODO Gerer action emettre paiement
@ -549,12 +549,12 @@ if (! empty($id) && $action != 'edit')
if ($don->statut == 1 && $resteapayer == 0 && $don->paye == 0) if ($don->statut == 1 && $resteapayer == 0 && $don->paye == 0)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
} }
if ($user->rights->don->supprimer) if ($user->rights->don->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>"; print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
} }
else else
{ {

View File

@ -711,7 +711,7 @@ class Don extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/compta/dons/fiche.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/dons/card.php?rowid='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$picto='generic'; $picto='generic';

View File

@ -118,7 +118,7 @@ foreach ($listofstatus as $status)
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="liste.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>'; print '<td><a href="list.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>';
print '<td align="right">'.(! empty($nb[$status])?$nb[$status]:'&nbsp;').'</td>'; print '<td align="right">'.(! empty($nb[$status])?$nb[$status]:'&nbsp;').'</td>';
print '<td align="right">'.(! empty($nb[$status])?price($somme[$status],'MT'):'&nbsp;').'</td>'; print '<td align="right">'.(! empty($nb[$status])?price($somme[$status],'MT'):'&nbsp;').'</td>';
print '<td align="right">'.(! empty($nb[$status])?price(price2num($somme[$status]/$nb[$status],'MT')):'&nbsp;').'</td>'; print '<td align="right">'.(! empty($nb[$status])?price(price2num($somme[$status]/$nb[$status],'MT')):'&nbsp;').'</td>';

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/compta/dons/liste.php * \file htdocs/compta/dons/list.php
* \ingroup don * \ingroup don
* \brief Page de liste des dons * \brief Page de liste des dons
*/ */

View File

@ -191,7 +191,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result = facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
if ($result >= 0) { if ($result >= 0) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
@ -417,7 +417,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} else { } else {
if (count($object->errors)) setEventMessage($object->errors, 'errors'); if (count($object->errors)) setEventMessage($object->errors, 'errors');
@ -495,7 +495,7 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
} }
@ -1305,7 +1305,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['prod_entry_mode']); unset($_POST ['prod_entry_mode']);
@ -1436,7 +1436,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST['qty']); unset($_POST['qty']);
@ -1479,8 +1479,9 @@ else if ($action == 'up' && $user->rights->facture->creer) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']); header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
exit(); exit();
@ -1501,8 +1502,9 @@ else if ($action == 'down' && $user->rights->facture->creer) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']); header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
exit(); exit();
@ -1725,7 +1727,7 @@ else if ($action == 'builddoc') // En get ou en post
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result = facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($db, $result); dol_print_error($db, $result);
@ -2996,7 +2998,7 @@ if ($action == 'create')
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print '<tr ' . $bc [$var] . '><td>'; print '<tr ' . $bc [$var] . '><td>';
print '<a href="' . DOL_URL_ROOT . '/compta/paiement/fiche.php?id=' . $objp->rowid . '">' . img_object($langs->trans('ShowPayment'), 'payment') . ' '; print '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $objp->rowid . '">' . img_object($langs->trans('ShowPayment'), 'payment') . ' ';
print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>'; print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>';
$label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; $label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label;
print '<td>' . $label . ' ' . $objp->num_paiement . '</td>'; print '<td>' . $label . ' ' . $objp->num_paiement . '</td>';
@ -3727,7 +3729,7 @@ if ($action == 'create')
// Build document if it not exists // Build document if it not exists
if (! $file || ! is_readable($file)) { if (! $file || ! is_readable($file)) {
$result = facture_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($db, $result); dol_print_error($db, $result);
exit(); exit();

View File

@ -375,7 +375,7 @@ if ($id > 0 || ! empty($ref))
{ {
$project = New Project($db); $project = New Project($db);
$project->fetch($object->fk_project); $project->fetch($object->fk_project);
print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$object->fk_project.'">'.$project->title.'</a>'; print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'">'.$project->title.'</a>';
} }
else else
{ {

View File

@ -9,7 +9,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* *
@ -34,9 +34,9 @@
*/ */
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT .'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT .'/margin/lib/margins.lib.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
/** /**
@ -3222,16 +3222,51 @@ class Facture extends CommonInvoice
} }
} }
/**
* Create a document onto disk according to template module.
*
* @param string $modele Force template to use ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int <0 if KO, >0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
$langs->load("bills");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->FACTURE_ADDON_PDF))
{
$modele = $conf->global->FACTURE_ADDON_PDF;
}
else
{
$modele = 'crabe';
}
}
$modelpath = "core/modules/facture/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }
/** /**
* \class FactureLigne * Class to manage invoice lines.
* \brief Classe permettant la gestion des lignes de factures * Saved into database table llx_facturedet
* Gere des lignes de la table llx_facturedet
*/ */
class FactureLigne extends CommonInvoiceLine class FactureLigne extends CommonInvoiceLine
{ {
var $db; var $db;
var $error; var $error;

View File

@ -522,9 +522,14 @@ else
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($object->statut == 0 && $user->rights->facture->creer)
{
echo '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
}
if ($object->statut == 0 && $user->rights->facture->supprimer) if ($object->statut == 0 && $user->rights->facture->supprimer)
{ {
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a>'; print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
} }
print '</div>'; print '</div>';
@ -584,23 +589,18 @@ else
print '<td align="right">'.price($objp->total).'</td>'."\n"; print '<td align="right">'.price($objp->total).'</td>'."\n";
if (! $objp->paye) echo '<td align="center">';
if ($user->rights->facture->creer)
{ {
if ($objp->fk_statut == 0) echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
{ echo $langs->trans("CreateBill"),'</a>';
print '<td align="right">'.$langs->trans("Draft").'</td>';
}
else
{
print '<td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?filtre=paye:0,fk_statut:1">'.$langs->trans("Validated").'</a></td>';
}
} }
else else
{ {
print '<td>&nbsp;</td>'; echo "&nbsp;";
} }
echo "</td></tr>\n";
print "</tr>\n";
$i++; $i++;
} }
} }

View File

@ -507,7 +507,7 @@ if ($object->id > 0)
print '<td align="center">'.$langs->trans("OrderWaiting").'</td>'; print '<td align="center">'.$langs->trans("OrderWaiting").'</td>';
print '<td align="center">'.price($obj->amount).'</td>'; print '<td align="center">'.price($obj->amount).'</td>';
print '<td align="center">-</td>'; print '<td align="center">-</td>';
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td>'; print '<td>';
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=delete&amp;did='.$obj->rowid.'">'; print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=delete&amp;did='.$obj->rowid.'">';
@ -563,7 +563,7 @@ if ($object->id > 0)
print $withdrawreceipt->getNomUrl(1); print $withdrawreceipt->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';

View File

@ -127,7 +127,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
if (! empty($conf->don->enabled) && $user->rights->don->lire) if (! empty($conf->don->enabled) && $user->rights->don->lire)
{ {
$langs->load("donations"); $langs->load("donations");
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/liste.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchADonation").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchADonation").'</td></tr>';
@ -639,7 +639,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$i = 0; $i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?status=3&afacturer=1">('.$num.')</a></td>'; print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?status=3&afacturer=1">('.$num.')</a></td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("ToBill").'</td>'; print '<td align="right">'.$langs->trans("ToBill").'</td>';
@ -916,7 +916,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>"; print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>";
print "<td><a href=\"action/fiche.php\">$obj->libelle $obj->label</a></td></tr>"; print "<td><a href=\"action/card.php\">$obj->libelle $obj->label</a></td></tr>";
$i++; $i++;
} }
$db->free($resql); $db->free($resql);

View File

@ -122,8 +122,8 @@ if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
// les variables // les variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER)?$conf->global->COMPTA_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef")); $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)?$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->COMPTA_VAT_BUY_ACCOUNT)?$conf->global->COMPTA_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef")); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)?$conf->global->ACCOUNTING_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
$tabfac = array(); $tabfac = array();
$tabht = array(); $tabht = array();
@ -142,8 +142,8 @@ if ($result)
$compta_prod = $obj->accountancy_code_buy; $compta_prod = $obj->accountancy_code_buy;
if (empty($compta_prod)) if (empty($compta_prod))
{ {
if($obj->product_type == 0) $compta_prod = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT)?$conf->global->COMPTA_PRODUCT_BUY_ACCOUNT:$langs->trans("CodeNotDef")); if($obj->product_type == 0) $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT)?$conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
else $compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT)?$conf->global->COMPTA_SERVICE_BUY_ACCOUNT:$langs->trans("CodeNotDef")); else $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT)?$conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
} }
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva); $compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
$compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef")); $compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef"));
@ -230,7 +230,6 @@ foreach ($tabfac as $key => $val)
if (isset($line['nomtcheck']) || $mt) if (isset($line['nomtcheck']) || $mt)
{ {
print "<tr ".$bc[$var]." >"; print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".dol_print_date($val["date"])."</td>"; print "<td>".dol_print_date($val["date"])."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>"; print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>"; print "<td>".$k."</td><td>".$line['label']."</td>";

View File

@ -141,15 +141,15 @@ if ($result)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
// les variables // les variables
$cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER)?$conf->global->COMPTA_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)?$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef"));
$compta_soc = (! empty($obj->code_compta)?$obj->code_compta:$cptcli); $compta_soc = (! empty($obj->code_compta)?$obj->code_compta:$cptcli);
$compta_prod = $obj->accountancy_code_sell; $compta_prod = $obj->accountancy_code_sell;
if (empty($compta_prod)) if (empty($compta_prod))
{ {
if($obj->product_type == 0) $compta_prod = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT)?$conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT:$langs->trans("CodeNotDef")); if($obj->product_type == 0) $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
else $compta_prod = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT)?$conf->global->COMPTA_SERVICE_SOLD_ACCOUNT:$langs->trans("CodeNotDef")); else $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
} }
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef")); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)?$conf->global->ACCOUNTING_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva); $compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
$account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $obj->thirdparty, $mysoc); $account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $obj->thirdparty, $mysoc);
@ -240,7 +240,6 @@ foreach ($tabfac as $key => $val)
if (isset($line['nomtcheck']) || $mt) if (isset($line['nomtcheck']) || $mt)
{ {
print "<tr ".$bc[$var]." >"; print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".dol_print_date($val["date"])."</td>"; print "<td>".dol_print_date($val["date"])."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>"; print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>"; print "<td>".$k."</td><td>".$line['label']."</td>";

View File

@ -16,7 +16,7 @@
*/ */
/** /**
* \file htdocs/compta/localtax/fiche.php * \file htdocs/compta/localtax/card.php
* \ingroup tax * \ingroup tax
* \brief Page of IRPF payments * \brief Page of IRPF payments
*/ */
@ -149,7 +149,7 @@ if ($id)
if ($_GET["action"] == 'create') if ($_GET["action"] == 'create')
{ {
print "<form name='add' action=\"fiche.php\" method=\"post\">\n"; print "<form name='add' action=\"card.php\" method=\"post\">\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="localTaxType" value="'.$lttype.'">'; print '<input type="hidden" name="localTaxType" value="'.$lttype.'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
@ -208,7 +208,7 @@ if ($id)
if ($mesg) print $mesg; if ($mesg) print $mesg;
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/localtax/fiche.php?id='.$vatpayment->id; $head[$h][0] = DOL_URL_ROOT.'/compta/localtax/card.php?id='.$vatpayment->id;
$head[$h][1] = $langs->trans('Card'); $head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -259,7 +259,7 @@ if ($id)
*/ */
print "<div class=\"tabsAction\">\n"; print "<div class=\"tabsAction\">\n";
if ($vatpayment->rappro == 0) if ($vatpayment->rappro == 0)
print '<a class="butActionDelete" href="fiche.php?id='.$vatpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="card.php?id='.$vatpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
else else
print '<a class="butActionRefused" href="#" title="'.$langs->trans("LinkedToAConcialitedTransaction").'">'.$langs->trans("Delete").'</a>'; print '<a class="butActionRefused" href="#" title="'.$langs->trans("LinkedToAConcialitedTransaction").'">'.$langs->trans("Delete").'</a>';
print "</div>"; print "</div>";

View File

@ -516,7 +516,7 @@ class Localtax extends CommonObject
} }
// Mise a jour liens // Mise a jour liens
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/localtax/fiche.php?id=', "(VATPayment)", "payment_vat"); $result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/localtax/card.php?id=', "(VATPayment)", "payment_vat");
if ($result < 0) if ($result < 0)
{ {
$this->error=$acc->error; $this->error=$acc->error;
@ -586,7 +586,7 @@ class Localtax extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$picto='payment'; $picto='payment';

View File

@ -237,7 +237,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
} }
} }
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture.php?facid='.$invoiceid; if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture.php?facid='.$invoiceid;
else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id; else $loc = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id;
header('Location: '.$loc); header('Location: '.$loc);
exit; exit;
} }
@ -686,13 +686,13 @@ if (! GETPOST('action'))
$i = 0; $i = 0;
$var=True; $var=True;
print_barre_liste($langs->trans('Payments'), $page, 'paiement.php','',$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Type'),'paiement.php','libelle','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Amount'),'paiement.php','fa_amount','','','align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -80,14 +80,14 @@ if ($resql)
$i = 0; $i = 0;
$var=True; $var=True;
print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, "avalider.php","",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),"avalider.php","p.rowid","","",'width="60"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.rowid","","",'width="60"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),"avalider.php","dp","","",'width="80" align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),"avalider.php","c.libelle","","","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),"avalider.php","c.libelle","","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder);
print "<td>&nbsp;</td>"; print "<td>&nbsp;</td>";
print "</tr>\n"; print "</tr>\n";
@ -96,7 +96,7 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n"; print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
print "<td>$objp->paiement_type $objp->num_paiement</td>\n"; print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
@ -104,7 +104,7 @@ if ($resql)
if ($objp->statut == 0) if ($objp->statut == 0)
{ {
print '<a href="fiche.php?id='.$objp->rowid.'&amp;action=valide">'.$langs->trans("PaymentStatusToValidShort").'</a>'; print '<a href="card.php?id='.$objp->rowid.'&amp;action=valide">'.$langs->trans("PaymentStatusToValidShort").'</a>';
} }
else else
{ {

View File

@ -20,10 +20,10 @@
*/ */
/** /**
* \file htdocs/compta/paiement/fiche.php * \file htdocs/compta/paiement/card.php
* \ingroup facture * \ingroup facture
* \brief Page of a customer payment * \brief Page of a customer payment
* \remarks Nearly same file than fournisseur/paiement/fiche.php * \remarks Nearly same file than fournisseur/paiement/card.php
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -79,7 +79,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
if ($result > 0) if ($result > 0)
{ {
$db->commit(); $db->commit();
header("Location: liste.php"); header("Location: list.php");
exit; exit;
} }
else else
@ -112,7 +112,9 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, $fac->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$fac->generateDocument($fac->modelpdf, $outputlangs);
}
} }
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/compta/paiement/cheque/fiche.php * \file htdocs/compta/paiement/cheque/card.php
* \ingroup bank, invoice * \ingroup bank, invoice
* \brief Page for cheque deposits * \brief Page for cheque deposits
*/ */

View File

@ -770,7 +770,7 @@ class RemiseCheque extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin);

View File

@ -77,7 +77,7 @@ if ($resql)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'.$langs->trans("BankChecksToReceipt").'</td>'; print '<td>'.$langs->trans("BankChecksToReceipt").'</td>';
print '<td align="right">'; print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/fiche.php?leftmenu=customers_bills_checks&action=new">'.$num.'</a>'; print '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?leftmenu=customers_bills_checks&action=new">'.$num.'</a>';
print '</td></tr>'; print '</td></tr>';
print "</table>\n"; print "</table>\n";
} }

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/compta/paiement/cheque/liste.php * \file htdocs/compta/paiement/cheque/list.php
* \ingroup compta * \ingroup compta
* \brief Page list of cheque deposits * \brief Page list of cheque deposits
*/ */

Some files were not shown because too many files have changed in this diff Show More