@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | $res=@include '../../main.inc.php'; |
36 | 36 | if ($res == 'ERROR_NOT_LOGGED') |
37 | 37 | { |
38 | - $langs->load("other"); |
|
39 | - $arrayresult['jumptologin']=array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>'<span class="fa fa-sign-in"></span> '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php'); |
|
40 | - print json_encode($arrayresult); |
|
41 | - if (is_object($db)) $db->close(); |
|
42 | - exit; |
|
38 | + $langs->load("other"); |
|
39 | + $arrayresult['jumptologin']=array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>'<span class="fa fa-sign-in"></span> '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php'); |
|
40 | + print json_encode($arrayresult); |
|
41 | + if (is_object($db)) $db->close(); |
|
42 | + exit; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -56,85 +56,85 @@ discard block |
||
56 | 56 | |
57 | 57 | if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) |
58 | 58 | { |
59 | - $arrayresult['searchintomember']=array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
59 | + $arrayresult['searchintomember']=array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) |
63 | 63 | { |
64 | - $arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
64 | + $arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) |
68 | 68 | { |
69 | - $arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
69 | + $arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) |
73 | 73 | && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) |
74 | 74 | { |
75 | - $arrayresult['searchintoproduct']=array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
75 | + $arrayresult['searchintoproduct']=array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) |
79 | 79 | { |
80 | - $arrayresult['searchintoprojects']=array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
80 | + $arrayresult['searchintoprojects']=array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
81 | 81 | } |
82 | 82 | if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) |
83 | 83 | { |
84 | - $arrayresult['searchintotasks']=array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
84 | + $arrayresult['searchintotasks']=array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) |
88 | 88 | { |
89 | - $arrayresult['searchintopropal']=array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
89 | + $arrayresult['searchintopropal']=array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
90 | 90 | } |
91 | 91 | if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) |
92 | 92 | { |
93 | - $arrayresult['searchintoorder']=array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
93 | + $arrayresult['searchintoorder']=array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
94 | 94 | } |
95 | 95 | if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) |
96 | 96 | { |
97 | - $arrayresult['searchintoshipment']=array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
97 | + $arrayresult['searchintoshipment']=array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
98 | 98 | } |
99 | 99 | if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) |
100 | 100 | { |
101 | - $arrayresult['searchintoinvoice']=array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
101 | + $arrayresult['searchintoinvoice']=array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) |
105 | 105 | { |
106 | - $arrayresult['searchintosupplierpropal']=array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
106 | + $arrayresult['searchintosupplierpropal']=array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
107 | 107 | } |
108 | 108 | if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire) |
109 | 109 | { |
110 | - $arrayresult['searchintosupplierorder']=array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
110 | + $arrayresult['searchintosupplierorder']=array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue?'?search_all='.urlencode($search_boxvalue):'')); |
|
111 | 111 | } |
112 | 112 | if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire) |
113 | 113 | { |
114 | - $arrayresult['searchintosupplierinvoice']=array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
114 | + $arrayresult['searchintosupplierinvoice']=array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) |
118 | 118 | { |
119 | - $arrayresult['searchintocontract']=array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
119 | + $arrayresult['searchintocontract']=array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
120 | 120 | } |
121 | 121 | if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) |
122 | 122 | { |
123 | - $arrayresult['searchintointervention']=array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
123 | + $arrayresult['searchintointervention']=array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | // HR |
127 | 127 | if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) |
128 | 128 | { |
129 | - $arrayresult['searchintouser']=array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
129 | + $arrayresult['searchintouser']=array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); |
|
130 | 130 | } |
131 | 131 | if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) |
132 | 132 | { |
133 | - $arrayresult['searchintoexpensereport']=array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue?'&sall='.urlencode($search_boxvalue):'')); |
|
133 | + $arrayresult['searchintoexpensereport']=array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue?'&sall='.urlencode($search_boxvalue):'')); |
|
134 | 134 | } |
135 | 135 | if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) |
136 | 136 | { |
137 | - $arrayresult['searchintoleaves']=array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue?'&sall='.urlencode($search_boxvalue):'')); |
|
137 | + $arrayresult['searchintoleaves']=array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue?'&sall='.urlencode($search_boxvalue):'')); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $reshook=$hookmanager->executeHooks('addSearchEntry',$parameters); |
152 | 152 | if (empty($reshook)) |
153 | 153 | { |
154 | - $arrayresult=array_merge($arrayresult, $hookmanager->resArray); |
|
154 | + $arrayresult=array_merge($arrayresult, $hookmanager->resArray); |
|
155 | 155 | } |
156 | 156 | else $arrayresult=$hookmanager->resArray; |
157 | 157 |
@@ -51,14 +51,14 @@ |
||
51 | 51 | header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size'); |
52 | 52 | |
53 | 53 | switch ($_SERVER['REQUEST_METHOD']) { |
54 | - case 'OPTIONS': |
|
55 | - break; |
|
54 | + case 'OPTIONS': |
|
55 | + break; |
|
56 | 56 | case 'HEAD': |
57 | 57 | case 'GET': |
58 | 58 | $upload_handler->get(); |
59 | 59 | break; |
60 | 60 | case 'POST': |
61 | - if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { |
|
61 | + if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { |
|
62 | 62 | $upload_handler->delete(); |
63 | 63 | } else { |
64 | 64 | $upload_handler->post(); |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') |
51 | 51 | { |
52 | - // Increase date |
|
53 | - $al = new AccountLine($db); |
|
52 | + // Increase date |
|
53 | + $al = new AccountLine($db); |
|
54 | 54 | $al->datev_next(GETPOST('rowid','int')); |
55 | 55 | $al->fetch(GETPOST('rowid','int')); |
56 | 56 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | |
62 | 62 | if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') |
63 | 63 | { |
64 | - // Decrease date |
|
65 | - $al =new AccountLine($db); |
|
64 | + // Decrease date |
|
65 | + $al =new AccountLine($db); |
|
66 | 66 | $al->datev_previous(GETPOST('rowid','int')); |
67 | 67 | $al->fetch(GETPOST('rowid','int')); |
68 | 68 | |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | |
74 | 74 | if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') |
75 | 75 | { |
76 | - // Increase date |
|
77 | - $al = new AccountLine($db); |
|
76 | + // Increase date |
|
77 | + $al = new AccountLine($db); |
|
78 | 78 | $al->dateo_next(GETPOST('rowid','int')); |
79 | 79 | $al->fetch(GETPOST('rowid','int')); |
80 | 80 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | |
86 | 86 | if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') |
87 | 87 | { |
88 | - // Decrease date |
|
89 | - $al =new AccountLine($db); |
|
88 | + // Decrease date |
|
89 | + $al =new AccountLine($db); |
|
90 | 90 | $al->dateo_previous(GETPOST('rowid','int')); |
91 | 91 | $al->fetch(GETPOST('rowid','int')); |
92 | 92 |
@@ -42,25 +42,25 @@ |
||
42 | 42 | // Load original field value |
43 | 43 | if (! empty($output) && isset($amount) && isset($tva_tx)) |
44 | 44 | { |
45 | - $return=array(); |
|
46 | - $price=''; |
|
45 | + $return=array(); |
|
46 | + $price=''; |
|
47 | 47 | |
48 | - if (is_numeric($amount) && $amount != '') |
|
49 | - { |
|
50 | - if ($output == 'price_ttc') { |
|
48 | + if (is_numeric($amount) && $amount != '') |
|
49 | + { |
|
50 | + if ($output == 'price_ttc') { |
|
51 | 51 | |
52 | - $price = price2num($amount * (1 + ($tva_tx/100)), 'MU'); |
|
53 | - $return['price_ht'] = $amount; |
|
54 | - $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : ''); |
|
55 | - } |
|
56 | - else if ($output == 'price_ht') { |
|
52 | + $price = price2num($amount * (1 + ($tva_tx/100)), 'MU'); |
|
53 | + $return['price_ht'] = $amount; |
|
54 | + $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : ''); |
|
55 | + } |
|
56 | + else if ($output == 'price_ht') { |
|
57 | 57 | |
58 | - $price = price2num($amount / (1 + ($tva_tx/100)), 'MU'); |
|
59 | - $return['price_ht'] = (isset($price) && $price != '' ? price($price) : ''); |
|
60 | - $return['price_ttc'] = ($tva_tx == 0 ? $price : $amount); |
|
61 | - } |
|
62 | - } |
|
58 | + $price = price2num($amount / (1 + ($tva_tx/100)), 'MU'); |
|
59 | + $return['price_ht'] = (isset($price) && $price != '' ? price($price) : ''); |
|
60 | + $return['price_ttc'] = ($tva_tx == 0 ? $price : $amount); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | - echo json_encode($return); |
|
64 | + echo json_encode($return); |
|
65 | 65 | } |
66 | 66 |
@@ -43,28 +43,28 @@ |
||
43 | 43 | // Load original field value |
44 | 44 | if (! empty($id) && ! empty($action) && ! empty($htmlname)) |
45 | 45 | { |
46 | - $form = new Form($db); |
|
47 | - $soc = new Societe($db); |
|
46 | + $form = new Form($db); |
|
47 | + $soc = new Societe($db); |
|
48 | 48 | |
49 | - $soc->fetch($id); |
|
49 | + $soc->fetch($id); |
|
50 | 50 | |
51 | - if ($action == 'getSellerVATRates') |
|
52 | - { |
|
53 | - $seller = $mysoc; |
|
54 | - $buyer = $soc; |
|
55 | - } |
|
56 | - else |
|
57 | - { |
|
58 | - $buyer = $mysoc; |
|
59 | - $seller = $soc; |
|
60 | - } |
|
51 | + if ($action == 'getSellerVATRates') |
|
52 | + { |
|
53 | + $seller = $mysoc; |
|
54 | + $buyer = $soc; |
|
55 | + } |
|
56 | + else |
|
57 | + { |
|
58 | + $buyer = $mysoc; |
|
59 | + $seller = $soc; |
|
60 | + } |
|
61 | 61 | |
62 | - $return=array(); |
|
62 | + $return=array(); |
|
63 | 63 | |
64 | - $return['value'] = $form->load_tva('tva_tx',$selected,$seller,$buyer,$productid,0,'',true); |
|
65 | - $return['num'] = $form->num; |
|
66 | - $return['error'] = $form->error; |
|
64 | + $return['value'] = $form->load_tva('tva_tx',$selected,$seller,$buyer,$productid,0,'',true); |
|
65 | + $return['num'] = $form->num; |
|
66 | + $return['error'] = $form->error; |
|
67 | 67 | |
68 | - echo json_encode($return); |
|
68 | + echo json_encode($return); |
|
69 | 69 | } |
70 | 70 |
@@ -43,15 +43,15 @@ |
||
43 | 43 | // Load original field value |
44 | 44 | if (! empty($id) && ! empty($action) && ! empty($htmlname)) |
45 | 45 | { |
46 | - $form = new Form($db); |
|
46 | + $form = new Form($db); |
|
47 | 47 | |
48 | - $return=array(); |
|
49 | - if (empty($showempty)) $showempty=0; |
|
48 | + $return=array(); |
|
49 | + if (empty($showempty)) $showempty=0; |
|
50 | 50 | |
51 | - $return['value'] = $form->selectcontacts($id,'',$htmlname,$showempty,'','',0,'',true); |
|
52 | - $return['num'] = $form->num; |
|
53 | - $return['error'] = $form->error; |
|
51 | + $return['value'] = $form->selectcontacts($id,'',$htmlname,$showempty,'','',0,'',true); |
|
52 | + $return['num'] = $form->num; |
|
53 | + $return['error'] = $form->error; |
|
54 | 54 | |
55 | - echo json_encode($return); |
|
55 | + echo json_encode($return); |
|
56 | 56 | } |
57 | 57 |
@@ -58,175 +58,175 @@ |
||
58 | 58 | // Load original field value |
59 | 59 | if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($fk_element)) |
60 | 60 | { |
61 | - $ext_element = GETPOST('ext_element','alpha',2); |
|
62 | - $field = substr($field, 8); // remove prefix val_ |
|
63 | - $type = GETPOST('type','alpha',2); |
|
64 | - $value = ($type == 'ckeditor' ? GETPOST('value','',2) : GETPOST('value','alpha',2)); |
|
65 | - $loadmethod = GETPOST('loadmethod','alpha',2); |
|
66 | - $savemethod = GETPOST('savemethod','alpha',2); |
|
67 | - $savemethodname = (! empty($savemethod) ? $savemethod : 'setValueFrom'); |
|
68 | - $newelement = $element; |
|
69 | - |
|
70 | - $view=''; |
|
71 | - $format='text'; |
|
72 | - $return=array(); |
|
73 | - $error=0; |
|
74 | - |
|
75 | - if ($element != 'order_supplier' && $element != 'invoice_supplier' && preg_match('/^([^_]+)_([^_]+)/i',$element,$regs)) |
|
76 | - { |
|
77 | - $element = $regs[1]; |
|
78 | - $subelement = $regs[2]; |
|
79 | - } |
|
80 | - |
|
81 | - if ($element == 'propal') $newelement = 'propale'; |
|
82 | - else if ($element == 'fichinter') $newelement = 'ficheinter'; |
|
83 | - else if ($element == 'product') $newelement = 'produit'; |
|
84 | - else if ($element == 'member') $newelement = 'adherent'; |
|
85 | - else if ($element == 'order_supplier') { |
|
86 | - $newelement = 'fournisseur'; |
|
87 | - $subelement = 'commande'; |
|
88 | - } |
|
89 | - else if ($element == 'invoice_supplier') { |
|
90 | - $newelement = 'fournisseur'; |
|
91 | - $subelement = 'facture'; |
|
92 | - } |
|
93 | - else $newelement = $element; |
|
94 | - |
|
95 | - $_POST['action']='update'; // Hack so restrictarea will test permissions on write too |
|
96 | - $feature = $newelement; |
|
97 | - $feature2 = $subelement; |
|
98 | - $object_id = $fk_element; |
|
99 | - if ($feature == 'expedition' || $feature == 'shipping') |
|
100 | - { |
|
101 | - $feature = 'commande'; |
|
102 | - $object_id = 0; |
|
103 | - } |
|
104 | - if ($feature == 'shipping') $feature = 'commande'; |
|
105 | - if ($feature == 'payment') { $feature = 'facture'; } |
|
106 | - if ($feature == 'payment_supplier') { $feature = 'fournisseur'; $feature2 = 'facture'; } |
|
107 | - //var_dump(GETPOST('action','aZ09')); |
|
108 | - //var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id); |
|
109 | - $check_access = restrictedArea($user, $feature, $object_id, '', $feature2); |
|
110 | - //var_dump($user->rights); |
|
111 | - /* |
|
61 | + $ext_element = GETPOST('ext_element','alpha',2); |
|
62 | + $field = substr($field, 8); // remove prefix val_ |
|
63 | + $type = GETPOST('type','alpha',2); |
|
64 | + $value = ($type == 'ckeditor' ? GETPOST('value','',2) : GETPOST('value','alpha',2)); |
|
65 | + $loadmethod = GETPOST('loadmethod','alpha',2); |
|
66 | + $savemethod = GETPOST('savemethod','alpha',2); |
|
67 | + $savemethodname = (! empty($savemethod) ? $savemethod : 'setValueFrom'); |
|
68 | + $newelement = $element; |
|
69 | + |
|
70 | + $view=''; |
|
71 | + $format='text'; |
|
72 | + $return=array(); |
|
73 | + $error=0; |
|
74 | + |
|
75 | + if ($element != 'order_supplier' && $element != 'invoice_supplier' && preg_match('/^([^_]+)_([^_]+)/i',$element,$regs)) |
|
76 | + { |
|
77 | + $element = $regs[1]; |
|
78 | + $subelement = $regs[2]; |
|
79 | + } |
|
80 | + |
|
81 | + if ($element == 'propal') $newelement = 'propale'; |
|
82 | + else if ($element == 'fichinter') $newelement = 'ficheinter'; |
|
83 | + else if ($element == 'product') $newelement = 'produit'; |
|
84 | + else if ($element == 'member') $newelement = 'adherent'; |
|
85 | + else if ($element == 'order_supplier') { |
|
86 | + $newelement = 'fournisseur'; |
|
87 | + $subelement = 'commande'; |
|
88 | + } |
|
89 | + else if ($element == 'invoice_supplier') { |
|
90 | + $newelement = 'fournisseur'; |
|
91 | + $subelement = 'facture'; |
|
92 | + } |
|
93 | + else $newelement = $element; |
|
94 | + |
|
95 | + $_POST['action']='update'; // Hack so restrictarea will test permissions on write too |
|
96 | + $feature = $newelement; |
|
97 | + $feature2 = $subelement; |
|
98 | + $object_id = $fk_element; |
|
99 | + if ($feature == 'expedition' || $feature == 'shipping') |
|
100 | + { |
|
101 | + $feature = 'commande'; |
|
102 | + $object_id = 0; |
|
103 | + } |
|
104 | + if ($feature == 'shipping') $feature = 'commande'; |
|
105 | + if ($feature == 'payment') { $feature = 'facture'; } |
|
106 | + if ($feature == 'payment_supplier') { $feature = 'fournisseur'; $feature2 = 'facture'; } |
|
107 | + //var_dump(GETPOST('action','aZ09')); |
|
108 | + //var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id); |
|
109 | + $check_access = restrictedArea($user, $feature, $object_id, '', $feature2); |
|
110 | + //var_dump($user->rights); |
|
111 | + /* |
|
112 | 112 | if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write) |
113 | 113 | || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) |
114 | 114 | || ($element == 'payment' && $user->rights->facture->paiement) |
115 | 115 | || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) |
116 | 116 | */ |
117 | 117 | |
118 | - if ($check_access) |
|
119 | - { |
|
120 | - // Clean parameters |
|
121 | - $newvalue = trim($value); |
|
122 | - |
|
123 | - if ($type == 'numeric') |
|
124 | - { |
|
125 | - $newvalue = price2num($newvalue); |
|
126 | - |
|
127 | - // Check parameters |
|
128 | - if (! is_numeric($newvalue)) |
|
129 | - { |
|
130 | - $error++; |
|
131 | - $return['error'] = $langs->trans('ErrorBadValue'); |
|
132 | - } |
|
133 | - } |
|
134 | - else if ($type == 'datepicker') |
|
135 | - { |
|
136 | - $timestamp = GETPOST('timestamp','int',2); |
|
137 | - $format = 'date'; |
|
138 | - $newvalue = ($timestamp / 1000); |
|
139 | - } |
|
140 | - else if ($type == 'select') |
|
141 | - { |
|
142 | - $loadmethodname = 'load_cache_'.$loadmethod; |
|
143 | - $loadcachename = 'cache_'.$loadmethod; |
|
144 | - $loadviewname = 'view_'.$loadmethod; |
|
145 | - |
|
146 | - $form = new Form($db); |
|
147 | - if (method_exists($form, $loadmethodname)) |
|
148 | - { |
|
149 | - $ret = $form->$loadmethodname(); |
|
150 | - if ($ret > 0) |
|
151 | - { |
|
152 | - $loadcache = $form->$loadcachename; |
|
153 | - $value = $loadcache[$newvalue]; |
|
154 | - |
|
155 | - if (! empty($form->$loadviewname)) |
|
156 | - { |
|
157 | - $loadview = $form->$loadviewname; |
|
158 | - $view = $loadview[$newvalue]; |
|
159 | - } |
|
160 | - } |
|
161 | - else |
|
162 | - { |
|
163 | - $error++; |
|
164 | - $return['error'] = $form->error; |
|
165 | - } |
|
166 | - } |
|
167 | - else |
|
168 | - { |
|
169 | - $module = $subelement = $ext_element; |
|
170 | - if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs)) |
|
171 | - { |
|
172 | - $module = $regs[1]; |
|
173 | - $subelement = $regs[2]; |
|
174 | - } |
|
175 | - |
|
176 | - dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); |
|
177 | - $classname = 'Actions'.ucfirst($subelement); |
|
178 | - $object = new $classname($db); |
|
179 | - $ret = $object->$loadmethodname(); |
|
180 | - if ($ret > 0) |
|
181 | - { |
|
182 | - $loadcache = $object->$loadcachename; |
|
183 | - $value = $loadcache[$newvalue]; |
|
184 | - |
|
185 | - if (! empty($object->$loadviewname)) |
|
186 | - { |
|
187 | - $loadview = $object->$loadviewname; |
|
188 | - $view = $loadview[$newvalue]; |
|
189 | - } |
|
190 | - } |
|
191 | - else |
|
192 | - { |
|
193 | - $error++; |
|
194 | - $return['error'] = $object->error; |
|
195 | - } |
|
196 | - } |
|
197 | - } |
|
198 | - |
|
199 | - if (! $error) |
|
200 | - { |
|
201 | - if ((isset($object) && ! is_object($object)) || empty($savemethod)) $object = new GenericObject($db); |
|
202 | - |
|
203 | - // Specific for add_object_linked() |
|
204 | - // TODO add a function for variable treatment |
|
205 | - $object->ext_fk_element = $newvalue; |
|
206 | - $object->ext_element = $ext_element; |
|
207 | - $object->fk_element = $fk_element; |
|
208 | - $object->element = $element; |
|
209 | - |
|
210 | - $ret=$object->$savemethodname($field, $newvalue, $table_element, $fk_element, $format); |
|
211 | - if ($ret > 0) |
|
212 | - { |
|
213 | - if ($type == 'numeric') $value = price($newvalue); |
|
214 | - else if ($type == 'textarea') $value = dol_nl2br($newvalue); |
|
215 | - |
|
216 | - $return['value'] = $value; |
|
217 | - $return['view'] = (! empty($view) ? $view : $value); |
|
218 | - } |
|
219 | - else |
|
220 | - { |
|
221 | - $return['error'] = $object->error; |
|
222 | - } |
|
223 | - } |
|
224 | - |
|
225 | - echo json_encode($return); |
|
226 | - } |
|
227 | - else |
|
228 | - { |
|
229 | - echo $langs->trans('NotEnoughPermissions'); |
|
230 | - } |
|
118 | + if ($check_access) |
|
119 | + { |
|
120 | + // Clean parameters |
|
121 | + $newvalue = trim($value); |
|
122 | + |
|
123 | + if ($type == 'numeric') |
|
124 | + { |
|
125 | + $newvalue = price2num($newvalue); |
|
126 | + |
|
127 | + // Check parameters |
|
128 | + if (! is_numeric($newvalue)) |
|
129 | + { |
|
130 | + $error++; |
|
131 | + $return['error'] = $langs->trans('ErrorBadValue'); |
|
132 | + } |
|
133 | + } |
|
134 | + else if ($type == 'datepicker') |
|
135 | + { |
|
136 | + $timestamp = GETPOST('timestamp','int',2); |
|
137 | + $format = 'date'; |
|
138 | + $newvalue = ($timestamp / 1000); |
|
139 | + } |
|
140 | + else if ($type == 'select') |
|
141 | + { |
|
142 | + $loadmethodname = 'load_cache_'.$loadmethod; |
|
143 | + $loadcachename = 'cache_'.$loadmethod; |
|
144 | + $loadviewname = 'view_'.$loadmethod; |
|
145 | + |
|
146 | + $form = new Form($db); |
|
147 | + if (method_exists($form, $loadmethodname)) |
|
148 | + { |
|
149 | + $ret = $form->$loadmethodname(); |
|
150 | + if ($ret > 0) |
|
151 | + { |
|
152 | + $loadcache = $form->$loadcachename; |
|
153 | + $value = $loadcache[$newvalue]; |
|
154 | + |
|
155 | + if (! empty($form->$loadviewname)) |
|
156 | + { |
|
157 | + $loadview = $form->$loadviewname; |
|
158 | + $view = $loadview[$newvalue]; |
|
159 | + } |
|
160 | + } |
|
161 | + else |
|
162 | + { |
|
163 | + $error++; |
|
164 | + $return['error'] = $form->error; |
|
165 | + } |
|
166 | + } |
|
167 | + else |
|
168 | + { |
|
169 | + $module = $subelement = $ext_element; |
|
170 | + if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs)) |
|
171 | + { |
|
172 | + $module = $regs[1]; |
|
173 | + $subelement = $regs[2]; |
|
174 | + } |
|
175 | + |
|
176 | + dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); |
|
177 | + $classname = 'Actions'.ucfirst($subelement); |
|
178 | + $object = new $classname($db); |
|
179 | + $ret = $object->$loadmethodname(); |
|
180 | + if ($ret > 0) |
|
181 | + { |
|
182 | + $loadcache = $object->$loadcachename; |
|
183 | + $value = $loadcache[$newvalue]; |
|
184 | + |
|
185 | + if (! empty($object->$loadviewname)) |
|
186 | + { |
|
187 | + $loadview = $object->$loadviewname; |
|
188 | + $view = $loadview[$newvalue]; |
|
189 | + } |
|
190 | + } |
|
191 | + else |
|
192 | + { |
|
193 | + $error++; |
|
194 | + $return['error'] = $object->error; |
|
195 | + } |
|
196 | + } |
|
197 | + } |
|
198 | + |
|
199 | + if (! $error) |
|
200 | + { |
|
201 | + if ((isset($object) && ! is_object($object)) || empty($savemethod)) $object = new GenericObject($db); |
|
202 | + |
|
203 | + // Specific for add_object_linked() |
|
204 | + // TODO add a function for variable treatment |
|
205 | + $object->ext_fk_element = $newvalue; |
|
206 | + $object->ext_element = $ext_element; |
|
207 | + $object->fk_element = $fk_element; |
|
208 | + $object->element = $element; |
|
209 | + |
|
210 | + $ret=$object->$savemethodname($field, $newvalue, $table_element, $fk_element, $format); |
|
211 | + if ($ret > 0) |
|
212 | + { |
|
213 | + if ($type == 'numeric') $value = price($newvalue); |
|
214 | + else if ($type == 'textarea') $value = dol_nl2br($newvalue); |
|
215 | + |
|
216 | + $return['value'] = $value; |
|
217 | + $return['view'] = (! empty($view) ? $view : $value); |
|
218 | + } |
|
219 | + else |
|
220 | + { |
|
221 | + $return['error'] = $object->error; |
|
222 | + } |
|
223 | + } |
|
224 | + |
|
225 | + echo json_encode($return); |
|
226 | + } |
|
227 | + else |
|
228 | + { |
|
229 | + echo $langs->trans('NotEnoughPermissions'); |
|
230 | + } |
|
231 | 231 | } |
232 | 232 |
@@ -43,35 +43,35 @@ |
||
43 | 43 | |
44 | 44 | if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type)) |
45 | 45 | { |
46 | - $value = GETPOST('value','alpha'); |
|
47 | - $params=array(); |
|
46 | + $value = GETPOST('value','alpha'); |
|
47 | + $params=array(); |
|
48 | 48 | |
49 | - dol_syslog("AjaxSetExtraParameters id=".$id." element=".$element." htmlelement=".$htmlelement." type=".$type." value=".$value, LOG_DEBUG); |
|
49 | + dol_syslog("AjaxSetExtraParameters id=".$id." element=".$element." htmlelement=".$htmlelement." type=".$type." value=".$value, LOG_DEBUG); |
|
50 | 50 | |
51 | - $classpath = $subelement = $element; |
|
51 | + $classpath = $subelement = $element; |
|
52 | 52 | |
53 | - // For compatibility |
|
54 | - if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; } |
|
55 | - else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } |
|
56 | - else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } |
|
57 | - else if ($element == 'contract') { $classpath = $subelement = 'contrat'; } |
|
58 | - else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; } |
|
59 | - else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } |
|
60 | - else if ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } |
|
61 | - else if ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } |
|
53 | + // For compatibility |
|
54 | + if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; } |
|
55 | + else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } |
|
56 | + else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } |
|
57 | + else if ($element == 'contract') { $classpath = $subelement = 'contrat'; } |
|
58 | + else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; } |
|
59 | + else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } |
|
60 | + else if ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } |
|
61 | + else if ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } |
|
62 | 62 | |
63 | - dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php'); |
|
63 | + dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php'); |
|
64 | 64 | |
65 | - if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } |
|
66 | - else if ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } |
|
67 | - else $classname = ucfirst($subelement); |
|
65 | + if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } |
|
66 | + else if ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } |
|
67 | + else $classname = ucfirst($subelement); |
|
68 | 68 | |
69 | - $object = new $classname($db); |
|
70 | - $object->fetch($id); |
|
69 | + $object = new $classname($db); |
|
70 | + $object->fetch($id); |
|
71 | 71 | |
72 | - $params[$htmlelement] = array($type => $value); |
|
73 | - $object->extraparams = array_merge($object->extraparams, $params); |
|
72 | + $params[$htmlelement] = array($type => $value); |
|
73 | + $object->extraparams = array_merge($object->extraparams, $params); |
|
74 | 74 | |
75 | - $result=$object->setExtraParameters(); |
|
75 | + $result=$object->setExtraParameters(); |
|
76 | 76 | } |
77 | 77 |
@@ -53,28 +53,28 @@ |
||
53 | 53 | // Add a box |
54 | 54 | if ($boxid > 0 && $zone !='' && $userid > 0) |
55 | 55 | { |
56 | - $tmp=explode('-',$boxorder); |
|
57 | - $nbboxonleft=substr_count($tmp[0],','); |
|
58 | - $nbboxonright=substr_count($tmp[1],','); |
|
59 | - print $nbboxonleft.'-'.$nbboxonright; |
|
60 | - if ($nbboxonleft > $nbboxonright) $boxorder=preg_replace('/B:/','B:'.$boxid.',',$boxorder); // Insert id of new box into list |
|
56 | + $tmp=explode('-',$boxorder); |
|
57 | + $nbboxonleft=substr_count($tmp[0],','); |
|
58 | + $nbboxonright=substr_count($tmp[1],','); |
|
59 | + print $nbboxonleft.'-'.$nbboxonright; |
|
60 | + if ($nbboxonleft > $nbboxonright) $boxorder=preg_replace('/B:/','B:'.$boxid.',',$boxorder); // Insert id of new box into list |
|
61 | 61 | else $boxorder=preg_replace('/^A:/','A:'.$boxid.',',$boxorder); // Insert id of new box into list |
62 | 62 | } |
63 | 63 | |
64 | 64 | // Registering the location of boxes after a move |
65 | 65 | if ($boxorder && $zone != '' && $userid > 0) |
66 | 66 | { |
67 | - // boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B" |
|
68 | - dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG); |
|
67 | + // boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B" |
|
68 | + dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG); |
|
69 | 69 | |
70 | - $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); |
|
71 | - if ($result > 0) |
|
72 | - { |
|
73 | - $langs->load("boxes"); |
|
74 | - if (! GETPOST('closing')) |
|
75 | - { |
|
76 | - setEventMessages($langs->trans("BoxAdded"), null); |
|
77 | - } |
|
78 | - } |
|
70 | + $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); |
|
71 | + if ($result > 0) |
|
72 | + { |
|
73 | + $langs->load("boxes"); |
|
74 | + if (! GETPOST('closing')) |
|
75 | + { |
|
76 | + setEventMessages($langs->trans("BoxAdded"), null); |
|
77 | + } |
|
78 | + } |
|
79 | 79 | } |
80 | 80 |