@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // Security check |
| 83 | 83 | $id = GETPOSTINT("id"); |
| 84 | 84 | $securekeyreceived = GETPOST("securekey"); |
| 85 | -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); |
|
| 85 | +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5'); |
|
| 86 | 86 | |
| 87 | 87 | if ($securekeyreceived != $securekeytocompare) { |
| 88 | 88 | print $langs->trans('MissingOrBadSecureKey'); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) { |
| 144 | 144 | print '<div class="backimagepubliceventorganizationsubscription">'; |
| 145 | - print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">'; |
|
| 145 | + print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">'; |
|
| 146 | 146 | print '</div>'; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $head = ''; |
| 176 | 176 | if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { |
| 177 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 177 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $conf->dol_hide_topmenu = 1; |
@@ -18,444 +18,444 @@ |
||
| 18 | 18 | // |
| 19 | 19 | |
| 20 | 20 | class FPDF_TPL extends FPDF { |
| 21 | - /** |
|
| 22 | - * Array of Tpl-Data |
|
| 23 | - * @var array |
|
| 24 | - */ |
|
| 25 | - var $tpls = array(); |
|
| 21 | + /** |
|
| 22 | + * Array of Tpl-Data |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | + var $tpls = array(); |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Current Template-ID |
|
| 29 | - * @var int |
|
| 30 | - */ |
|
| 31 | - var $tpl = 0; |
|
| 27 | + /** |
|
| 28 | + * Current Template-ID |
|
| 29 | + * @var int |
|
| 30 | + */ |
|
| 31 | + var $tpl = 0; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * "In Template"-Flag |
|
| 35 | - * @var boolean |
|
| 36 | - */ |
|
| 37 | - var $_intpl = false; |
|
| 33 | + /** |
|
| 34 | + * "In Template"-Flag |
|
| 35 | + * @var boolean |
|
| 36 | + */ |
|
| 37 | + var $_intpl = false; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Nameprefix of Templates used in Resources-Dictonary |
|
| 41 | - * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an / |
|
| 42 | - */ |
|
| 43 | - var $tplprefix = "/TPL"; |
|
| 39 | + /** |
|
| 40 | + * Nameprefix of Templates used in Resources-Dictonary |
|
| 41 | + * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an / |
|
| 42 | + */ |
|
| 43 | + var $tplprefix = "/TPL"; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Resources used By Templates and Pages |
|
| 47 | - * @var array |
|
| 48 | - */ |
|
| 49 | - var $_res = array(); |
|
| 45 | + /** |
|
| 46 | + * Resources used By Templates and Pages |
|
| 47 | + * @var array |
|
| 48 | + */ |
|
| 49 | + var $_res = array(); |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Last used Template data |
|
| 53 | - * |
|
| 54 | - * @var array |
|
| 55 | - */ |
|
| 56 | - var $lastUsedTemplateData = array(); |
|
| 51 | + /** |
|
| 52 | + * Last used Template data |
|
| 53 | + * |
|
| 54 | + * @var array |
|
| 55 | + */ |
|
| 56 | + var $lastUsedTemplateData = array(); |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Start a Template |
|
| 60 | - * |
|
| 61 | - * This method starts a template. You can give own coordinates to build an own sized |
|
| 62 | - * Template. Pay attention, that the margins are adapted to the new templatesize. |
|
| 63 | - * If you want to write outside the template, for example to build a clipped Template, |
|
| 64 | - * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call. |
|
| 65 | - * |
|
| 66 | - * If no parameter is given, the template uses the current page-size. |
|
| 67 | - * The Method returns an ID of the current Template. This ID is used later for using this template. |
|
| 68 | - * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation! |
|
| 69 | - * |
|
| 70 | - * @param int $x The x-coordinate given in user-unit |
|
| 71 | - * @param int $y The y-coordinate given in user-unit |
|
| 72 | - * @param int $w The width given in user-unit |
|
| 73 | - * @param int $h The height given in user-unit |
|
| 74 | - * @return int The ID of new created Template |
|
| 75 | - */ |
|
| 76 | - function beginTemplate($x = null, $y = null, $w = null, $h = null) { |
|
| 77 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 78 | - $this->Error('This method is only usable with FPDF. Use TCPDF methods startTemplate() instead.'); |
|
| 79 | - return; |
|
| 80 | - } |
|
| 58 | + /** |
|
| 59 | + * Start a Template |
|
| 60 | + * |
|
| 61 | + * This method starts a template. You can give own coordinates to build an own sized |
|
| 62 | + * Template. Pay attention, that the margins are adapted to the new templatesize. |
|
| 63 | + * If you want to write outside the template, for example to build a clipped Template, |
|
| 64 | + * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call. |
|
| 65 | + * |
|
| 66 | + * If no parameter is given, the template uses the current page-size. |
|
| 67 | + * The Method returns an ID of the current Template. This ID is used later for using this template. |
|
| 68 | + * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation! |
|
| 69 | + * |
|
| 70 | + * @param int $x The x-coordinate given in user-unit |
|
| 71 | + * @param int $y The y-coordinate given in user-unit |
|
| 72 | + * @param int $w The width given in user-unit |
|
| 73 | + * @param int $h The height given in user-unit |
|
| 74 | + * @return int The ID of new created Template |
|
| 75 | + */ |
|
| 76 | + function beginTemplate($x = null, $y = null, $w = null, $h = null) { |
|
| 77 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 78 | + $this->Error('This method is only usable with FPDF. Use TCPDF methods startTemplate() instead.'); |
|
| 79 | + return; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - if ($this->page <= 0) |
|
| 83 | - $this->error("You have to add a page to fpdf first!"); |
|
| 82 | + if ($this->page <= 0) |
|
| 83 | + $this->error("You have to add a page to fpdf first!"); |
|
| 84 | 84 | |
| 85 | - if ($x == null) |
|
| 86 | - $x = 0; |
|
| 87 | - if ($y == null) |
|
| 88 | - $y = 0; |
|
| 89 | - if ($w == null) |
|
| 90 | - $w = $this->w; |
|
| 91 | - if ($h == null) |
|
| 92 | - $h = $this->h; |
|
| 85 | + if ($x == null) |
|
| 86 | + $x = 0; |
|
| 87 | + if ($y == null) |
|
| 88 | + $y = 0; |
|
| 89 | + if ($w == null) |
|
| 90 | + $w = $this->w; |
|
| 91 | + if ($h == null) |
|
| 92 | + $h = $this->h; |
|
| 93 | 93 | |
| 94 | - // Save settings |
|
| 95 | - $this->tpl++; |
|
| 96 | - $tpl =& $this->tpls[$this->tpl]; |
|
| 97 | - $tpl = array( |
|
| 98 | - 'o_x' => $this->x, |
|
| 99 | - 'o_y' => $this->y, |
|
| 100 | - 'o_AutoPageBreak' => $this->AutoPageBreak, |
|
| 101 | - 'o_bMargin' => $this->bMargin, |
|
| 102 | - 'o_tMargin' => $this->tMargin, |
|
| 103 | - 'o_lMargin' => $this->lMargin, |
|
| 104 | - 'o_rMargin' => $this->rMargin, |
|
| 105 | - 'o_h' => $this->h, |
|
| 106 | - 'o_w' => $this->w, |
|
| 107 | - 'o_FontFamily' => $this->FontFamily, |
|
| 108 | - 'o_FontStyle' => $this->FontStyle, |
|
| 109 | - 'o_FontSizePt' => $this->FontSizePt, |
|
| 110 | - 'o_FontSize' => $this->FontSize, |
|
| 111 | - 'buffer' => '', |
|
| 112 | - 'x' => $x, |
|
| 113 | - 'y' => $y, |
|
| 114 | - 'w' => $w, |
|
| 115 | - 'h' => $h |
|
| 116 | - ); |
|
| 94 | + // Save settings |
|
| 95 | + $this->tpl++; |
|
| 96 | + $tpl =& $this->tpls[$this->tpl]; |
|
| 97 | + $tpl = array( |
|
| 98 | + 'o_x' => $this->x, |
|
| 99 | + 'o_y' => $this->y, |
|
| 100 | + 'o_AutoPageBreak' => $this->AutoPageBreak, |
|
| 101 | + 'o_bMargin' => $this->bMargin, |
|
| 102 | + 'o_tMargin' => $this->tMargin, |
|
| 103 | + 'o_lMargin' => $this->lMargin, |
|
| 104 | + 'o_rMargin' => $this->rMargin, |
|
| 105 | + 'o_h' => $this->h, |
|
| 106 | + 'o_w' => $this->w, |
|
| 107 | + 'o_FontFamily' => $this->FontFamily, |
|
| 108 | + 'o_FontStyle' => $this->FontStyle, |
|
| 109 | + 'o_FontSizePt' => $this->FontSizePt, |
|
| 110 | + 'o_FontSize' => $this->FontSize, |
|
| 111 | + 'buffer' => '', |
|
| 112 | + 'x' => $x, |
|
| 113 | + 'y' => $y, |
|
| 114 | + 'w' => $w, |
|
| 115 | + 'h' => $h |
|
| 116 | + ); |
|
| 117 | 117 | |
| 118 | - $this->SetAutoPageBreak(false); |
|
| 118 | + $this->SetAutoPageBreak(false); |
|
| 119 | 119 | |
| 120 | - // Define own high and width to calculate possitions correct |
|
| 121 | - $this->h = $h; |
|
| 122 | - $this->w = $w; |
|
| 120 | + // Define own high and width to calculate possitions correct |
|
| 121 | + $this->h = $h; |
|
| 122 | + $this->w = $w; |
|
| 123 | 123 | |
| 124 | - $this->_intpl = true; |
|
| 125 | - $this->SetXY($x + $this->lMargin, $y + $this->tMargin); |
|
| 126 | - $this->SetRightMargin($this->w - $w + $this->rMargin); |
|
| 124 | + $this->_intpl = true; |
|
| 125 | + $this->SetXY($x + $this->lMargin, $y + $this->tMargin); |
|
| 126 | + $this->SetRightMargin($this->w - $w + $this->rMargin); |
|
| 127 | 127 | |
| 128 | - if ($this->CurrentFont) { |
|
| 129 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 130 | - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 128 | + if ($this->CurrentFont) { |
|
| 129 | + $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 130 | + $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 131 | 131 | |
| 132 | - $this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); |
|
| 133 | - } |
|
| 132 | + $this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | - return $this->tpl; |
|
| 136 | - } |
|
| 135 | + return $this->tpl; |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - /** |
|
| 139 | - * End Template |
|
| 140 | - * |
|
| 141 | - * This method ends a template and reset initiated variables on beginTemplate. |
|
| 142 | - * |
|
| 143 | - * @return mixed If a template is opened, the ID is returned. If not a false is returned. |
|
| 144 | - */ |
|
| 145 | - function endTemplate() { |
|
| 146 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 147 | - $args = func_get_args(); |
|
| 138 | + /** |
|
| 139 | + * End Template |
|
| 140 | + * |
|
| 141 | + * This method ends a template and reset initiated variables on beginTemplate. |
|
| 142 | + * |
|
| 143 | + * @return mixed If a template is opened, the ID is returned. If not a false is returned. |
|
| 144 | + */ |
|
| 145 | + function endTemplate() { |
|
| 146 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 147 | + $args = func_get_args(); |
|
| 148 | 148 | return parent::endTemplate(...$args); |
| 149 | - } |
|
| 149 | + } |
|
| 150 | 150 | |
| 151 | - if ($this->_intpl) { |
|
| 152 | - $this->_intpl = false; |
|
| 153 | - $tpl =& $this->tpls[$this->tpl]; |
|
| 154 | - $this->SetXY($tpl['o_x'], $tpl['o_y']); |
|
| 155 | - $this->tMargin = $tpl['o_tMargin']; |
|
| 156 | - $this->lMargin = $tpl['o_lMargin']; |
|
| 157 | - $this->rMargin = $tpl['o_rMargin']; |
|
| 158 | - $this->h = $tpl['o_h']; |
|
| 159 | - $this->w = $tpl['o_w']; |
|
| 160 | - $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']); |
|
| 151 | + if ($this->_intpl) { |
|
| 152 | + $this->_intpl = false; |
|
| 153 | + $tpl =& $this->tpls[$this->tpl]; |
|
| 154 | + $this->SetXY($tpl['o_x'], $tpl['o_y']); |
|
| 155 | + $this->tMargin = $tpl['o_tMargin']; |
|
| 156 | + $this->lMargin = $tpl['o_lMargin']; |
|
| 157 | + $this->rMargin = $tpl['o_rMargin']; |
|
| 158 | + $this->h = $tpl['o_h']; |
|
| 159 | + $this->w = $tpl['o_w']; |
|
| 160 | + $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']); |
|
| 161 | 161 | |
| 162 | - $this->FontFamily = $tpl['o_FontFamily']; |
|
| 163 | - $this->FontStyle = $tpl['o_FontStyle']; |
|
| 164 | - $this->FontSizePt = $tpl['o_FontSizePt']; |
|
| 165 | - $this->FontSize = $tpl['o_FontSize']; |
|
| 162 | + $this->FontFamily = $tpl['o_FontFamily']; |
|
| 163 | + $this->FontStyle = $tpl['o_FontStyle']; |
|
| 164 | + $this->FontSizePt = $tpl['o_FontSizePt']; |
|
| 165 | + $this->FontSize = $tpl['o_FontSize']; |
|
| 166 | 166 | |
| 167 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 168 | - if ($fontkey) |
|
| 169 | - $this->CurrentFont =& $this->fonts[$fontkey]; |
|
| 167 | + $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 168 | + if ($fontkey) |
|
| 169 | + $this->CurrentFont =& $this->fonts[$fontkey]; |
|
| 170 | 170 | |
| 171 | - return $this->tpl; |
|
| 172 | - } else { |
|
| 173 | - return false; |
|
| 174 | - } |
|
| 175 | - } |
|
| 171 | + return $this->tpl; |
|
| 172 | + } else { |
|
| 173 | + return false; |
|
| 174 | + } |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | - /** |
|
| 178 | - * Use a Template in current Page or other Template |
|
| 179 | - * |
|
| 180 | - * You can use a template in a page or in another template. |
|
| 181 | - * You can give the used template a new size like you use the Image()-method. |
|
| 182 | - * All parameters are optional. The width or height is calculated automaticaly |
|
| 183 | - * if one is given. If no parameter is given the origin size as defined in |
|
| 184 | - * beginTemplate() is used. |
|
| 185 | - * The calculated or used width and height are returned as an array. |
|
| 186 | - * |
|
| 187 | - * @param int $tplidx A valid template-Id |
|
| 188 | - * @param int $_x The x-position |
|
| 189 | - * @param int $_y The y-position |
|
| 190 | - * @param int $_w The new width of the template |
|
| 191 | - * @param int $_h The new height of the template |
|
| 192 | - * @retrun array The height and width of the template |
|
| 193 | - */ |
|
| 194 | - function useTemplate($tplidx, $_x = null, $_y = null, $_w = 0, $_h = 0) { |
|
| 195 | - if ($this->page <= 0) |
|
| 196 | - $this->error('You have to add a page first!'); |
|
| 177 | + /** |
|
| 178 | + * Use a Template in current Page or other Template |
|
| 179 | + * |
|
| 180 | + * You can use a template in a page or in another template. |
|
| 181 | + * You can give the used template a new size like you use the Image()-method. |
|
| 182 | + * All parameters are optional. The width or height is calculated automaticaly |
|
| 183 | + * if one is given. If no parameter is given the origin size as defined in |
|
| 184 | + * beginTemplate() is used. |
|
| 185 | + * The calculated or used width and height are returned as an array. |
|
| 186 | + * |
|
| 187 | + * @param int $tplidx A valid template-Id |
|
| 188 | + * @param int $_x The x-position |
|
| 189 | + * @param int $_y The y-position |
|
| 190 | + * @param int $_w The new width of the template |
|
| 191 | + * @param int $_h The new height of the template |
|
| 192 | + * @retrun array The height and width of the template |
|
| 193 | + */ |
|
| 194 | + function useTemplate($tplidx, $_x = null, $_y = null, $_w = 0, $_h = 0) { |
|
| 195 | + if ($this->page <= 0) |
|
| 196 | + $this->error('You have to add a page first!'); |
|
| 197 | 197 | |
| 198 | - if (!isset($this->tpls[$tplidx])) |
|
| 199 | - $this->error('Template does not exist!'); |
|
| 198 | + if (!isset($this->tpls[$tplidx])) |
|
| 199 | + $this->error('Template does not exist!'); |
|
| 200 | 200 | |
| 201 | - if ($this->_intpl) { |
|
| 202 | - $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; |
|
| 203 | - } |
|
| 201 | + if ($this->_intpl) { |
|
| 202 | + $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; |
|
| 203 | + } |
|
| 204 | 204 | |
| 205 | - $tpl =& $this->tpls[$tplidx]; |
|
| 206 | - $w = $tpl['w']; |
|
| 207 | - $h = $tpl['h']; |
|
| 205 | + $tpl =& $this->tpls[$tplidx]; |
|
| 206 | + $w = $tpl['w']; |
|
| 207 | + $h = $tpl['h']; |
|
| 208 | 208 | |
| 209 | - if ($_x == null) |
|
| 210 | - $_x = 0; |
|
| 211 | - if ($_y == null) |
|
| 212 | - $_y = 0; |
|
| 209 | + if ($_x == null) |
|
| 210 | + $_x = 0; |
|
| 211 | + if ($_y == null) |
|
| 212 | + $_y = 0; |
|
| 213 | 213 | |
| 214 | - $_x += $tpl['x']; |
|
| 215 | - $_y += $tpl['y']; |
|
| 214 | + $_x += $tpl['x']; |
|
| 215 | + $_y += $tpl['y']; |
|
| 216 | 216 | |
| 217 | - $wh = $this->getTemplateSize($tplidx, $_w, $_h); |
|
| 218 | - $_w = $wh['w']; |
|
| 219 | - $_h = $wh['h']; |
|
| 217 | + $wh = $this->getTemplateSize($tplidx, $_w, $_h); |
|
| 218 | + $_w = $wh['w']; |
|
| 219 | + $_h = $wh['h']; |
|
| 220 | 220 | |
| 221 | - $tData = array( |
|
| 222 | - 'x' => $this->x, |
|
| 223 | - 'y' => $this->y, |
|
| 224 | - 'w' => $_w, |
|
| 225 | - 'h' => $_h, |
|
| 226 | - 'scaleX' => ($_w / $w), |
|
| 227 | - 'scaleY' => ($_h / $h), |
|
| 228 | - 'tx' => $_x, |
|
| 229 | - 'ty' => ($this->h - $_y - $_h), |
|
| 230 | - 'lty' => ($this->h - $_y - $_h) - ($this->h - $h) * ($_h / $h) |
|
| 231 | - ); |
|
| 221 | + $tData = array( |
|
| 222 | + 'x' => $this->x, |
|
| 223 | + 'y' => $this->y, |
|
| 224 | + 'w' => $_w, |
|
| 225 | + 'h' => $_h, |
|
| 226 | + 'scaleX' => ($_w / $w), |
|
| 227 | + 'scaleY' => ($_h / $h), |
|
| 228 | + 'tx' => $_x, |
|
| 229 | + 'ty' => ($this->h - $_y - $_h), |
|
| 230 | + 'lty' => ($this->h - $_y - $_h) - ($this->h - $h) * ($_h / $h) |
|
| 231 | + ); |
|
| 232 | 232 | |
| 233 | - $this->_out(sprintf('q %.4F 0 0 %.4F %.4F %.4F cm', $tData['scaleX'], $tData['scaleY'], $tData['tx'] * $this->k, $tData['ty'] * $this->k)); // Translate |
|
| 234 | - $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx)); |
|
| 233 | + $this->_out(sprintf('q %.4F 0 0 %.4F %.4F %.4F cm', $tData['scaleX'], $tData['scaleY'], $tData['tx'] * $this->k, $tData['ty'] * $this->k)); // Translate |
|
| 234 | + $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx)); |
|
| 235 | 235 | |
| 236 | - $this->lastUsedTemplateData = $tData; |
|
| 236 | + $this->lastUsedTemplateData = $tData; |
|
| 237 | 237 | |
| 238 | - return array('w' => $_w, 'h' => $_h); |
|
| 239 | - } |
|
| 238 | + return array('w' => $_w, 'h' => $_h); |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | - /** |
|
| 242 | - * Get The calculated Size of a Template |
|
| 243 | - * |
|
| 244 | - * If one size is given, this method calculates the other one. |
|
| 245 | - * |
|
| 246 | - * @param int $tplidx A valid template-Id |
|
| 247 | - * @param int $_w The width of the template |
|
| 248 | - * @param int $_h The height of the template |
|
| 249 | - * @return array The height and width of the template |
|
| 250 | - */ |
|
| 251 | - function getTemplateSize($tplidx, $_w = 0, $_h = 0) { |
|
| 252 | - if (!isset($this->tpls[$tplidx])) |
|
| 253 | - return false; |
|
| 241 | + /** |
|
| 242 | + * Get The calculated Size of a Template |
|
| 243 | + * |
|
| 244 | + * If one size is given, this method calculates the other one. |
|
| 245 | + * |
|
| 246 | + * @param int $tplidx A valid template-Id |
|
| 247 | + * @param int $_w The width of the template |
|
| 248 | + * @param int $_h The height of the template |
|
| 249 | + * @return array The height and width of the template |
|
| 250 | + */ |
|
| 251 | + function getTemplateSize($tplidx, $_w = 0, $_h = 0) { |
|
| 252 | + if (!isset($this->tpls[$tplidx])) |
|
| 253 | + return false; |
|
| 254 | 254 | |
| 255 | - $tpl =& $this->tpls[$tplidx]; |
|
| 256 | - $w = $tpl['w']; |
|
| 257 | - $h = $tpl['h']; |
|
| 255 | + $tpl =& $this->tpls[$tplidx]; |
|
| 256 | + $w = $tpl['w']; |
|
| 257 | + $h = $tpl['h']; |
|
| 258 | 258 | |
| 259 | - if ($_w == 0 and $_h == 0) { |
|
| 260 | - $_w = $w; |
|
| 261 | - $_h = $h; |
|
| 262 | - } |
|
| 259 | + if ($_w == 0 and $_h == 0) { |
|
| 260 | + $_w = $w; |
|
| 261 | + $_h = $h; |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - if($_w == 0) |
|
| 265 | - $_w = $_h * $w / $h; |
|
| 266 | - if($_h == 0) |
|
| 267 | - $_h = $_w * $h / $w; |
|
| 264 | + if($_w == 0) |
|
| 265 | + $_w = $_h * $w / $h; |
|
| 266 | + if($_h == 0) |
|
| 267 | + $_h = $_w * $h / $w; |
|
| 268 | 268 | |
| 269 | - return array("w" => $_w, "h" => $_h); |
|
| 270 | - } |
|
| 269 | + return array("w" => $_w, "h" => $_h); |
|
| 270 | + } |
|
| 271 | 271 | |
| 272 | - /** |
|
| 273 | - * See FPDF/TCPDF-Documentation ;-) |
|
| 274 | - */ |
|
| 275 | - public function SetFont($family, $style = '', $size = 0, $fontfile='', $subset='default', $out=true) { |
|
| 276 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 277 | - $args = func_get_args(); |
|
| 272 | + /** |
|
| 273 | + * See FPDF/TCPDF-Documentation ;-) |
|
| 274 | + */ |
|
| 275 | + public function SetFont($family, $style = '', $size = 0, $fontfile='', $subset='default', $out=true) { |
|
| 276 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 277 | + $args = func_get_args(); |
|
| 278 | 278 | return parent::SetFont(...$args); |
| 279 | - } |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | - parent::SetFont($family, $style, $size); |
|
| 281 | + parent::SetFont($family, $style, $size); |
|
| 282 | 282 | |
| 283 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 283 | + $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 284 | 284 | |
| 285 | - if ($this->_intpl) { |
|
| 286 | - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 287 | - } else { |
|
| 288 | - $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 289 | - } |
|
| 290 | - } |
|
| 285 | + if ($this->_intpl) { |
|
| 286 | + $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 287 | + } else { |
|
| 288 | + $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 289 | + } |
|
| 290 | + } |
|
| 291 | 291 | |
| 292 | - /** |
|
| 293 | - * See FPDF/TCPDF-Documentation ;-) |
|
| 294 | - */ |
|
| 295 | - function Image( |
|
| 296 | - $file, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = '', $resize = false, |
|
| 297 | - $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, |
|
| 298 | - $hidden = false, $fitonpage = false, $alt = false, $altimgs = array() |
|
| 299 | - ) { |
|
| 300 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 301 | - $args = func_get_args(); |
|
| 292 | + /** |
|
| 293 | + * See FPDF/TCPDF-Documentation ;-) |
|
| 294 | + */ |
|
| 295 | + function Image( |
|
| 296 | + $file, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = '', $resize = false, |
|
| 297 | + $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, |
|
| 298 | + $hidden = false, $fitonpage = false, $alt = false, $altimgs = array() |
|
| 299 | + ) { |
|
| 300 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 301 | + $args = func_get_args(); |
|
| 302 | 302 | return parent::Image(...$args); |
| 303 | - } |
|
| 303 | + } |
|
| 304 | 304 | |
| 305 | - $ret = parent::Image($file, $x, $y, $w, $h, $type, $link); |
|
| 306 | - if ($this->_intpl) { |
|
| 307 | - $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; |
|
| 308 | - } else { |
|
| 309 | - $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; |
|
| 310 | - } |
|
| 305 | + $ret = parent::Image($file, $x, $y, $w, $h, $type, $link); |
|
| 306 | + if ($this->_intpl) { |
|
| 307 | + $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; |
|
| 308 | + } else { |
|
| 309 | + $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | - return $ret; |
|
| 313 | - } |
|
| 312 | + return $ret; |
|
| 313 | + } |
|
| 314 | 314 | |
| 315 | - /** |
|
| 316 | - * See FPDF-Documentation ;-) |
|
| 317 | - * |
|
| 318 | - * AddPage is not available when you're "in" a template. |
|
| 319 | - */ |
|
| 320 | - function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false) { |
|
| 321 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 322 | - $args = func_get_args(); |
|
| 315 | + /** |
|
| 316 | + * See FPDF-Documentation ;-) |
|
| 317 | + * |
|
| 318 | + * AddPage is not available when you're "in" a template. |
|
| 319 | + */ |
|
| 320 | + function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false) { |
|
| 321 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 322 | + $args = func_get_args(); |
|
| 323 | 323 | return parent::AddPage(...$args); |
| 324 | - } |
|
| 324 | + } |
|
| 325 | 325 | |
| 326 | - if ($this->_intpl) |
|
| 327 | - $this->Error('Adding pages in templates isn\'t possible!'); |
|
| 326 | + if ($this->_intpl) |
|
| 327 | + $this->Error('Adding pages in templates isn\'t possible!'); |
|
| 328 | 328 | |
| 329 | - parent::AddPage($orientation, $format); |
|
| 330 | - } |
|
| 329 | + parent::AddPage($orientation, $format); |
|
| 330 | + } |
|
| 331 | 331 | |
| 332 | - /** |
|
| 333 | - * Preserve adding Links in Templates ...won't work |
|
| 334 | - */ |
|
| 335 | - function Link($x, $y, $w, $h, $link, $spaces = 0) { |
|
| 336 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 337 | - $args = func_get_args(); |
|
| 332 | + /** |
|
| 333 | + * Preserve adding Links in Templates ...won't work |
|
| 334 | + */ |
|
| 335 | + function Link($x, $y, $w, $h, $link, $spaces = 0) { |
|
| 336 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 337 | + $args = func_get_args(); |
|
| 338 | 338 | return parent::Link(...$args); |
| 339 | - } |
|
| 339 | + } |
|
| 340 | 340 | |
| 341 | - if ($this->_intpl) |
|
| 342 | - $this->Error('Using links in templates aren\'t possible!'); |
|
| 341 | + if ($this->_intpl) |
|
| 342 | + $this->Error('Using links in templates aren\'t possible!'); |
|
| 343 | 343 | |
| 344 | - parent::Link($x, $y, $w, $h, $link); |
|
| 345 | - } |
|
| 344 | + parent::Link($x, $y, $w, $h, $link); |
|
| 345 | + } |
|
| 346 | 346 | |
| 347 | - function AddLink() { |
|
| 348 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 349 | - $args = func_get_args(); |
|
| 347 | + function AddLink() { |
|
| 348 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 349 | + $args = func_get_args(); |
|
| 350 | 350 | return parent::AddLink(...$args); |
| 351 | 351 | |
| 352 | - } |
|
| 352 | + } |
|
| 353 | 353 | |
| 354 | - if ($this->_intpl) |
|
| 355 | - $this->Error('Adding links in templates aren\'t possible!'); |
|
| 356 | - return parent::AddLink(); |
|
| 357 | - } |
|
| 354 | + if ($this->_intpl) |
|
| 355 | + $this->Error('Adding links in templates aren\'t possible!'); |
|
| 356 | + return parent::AddLink(); |
|
| 357 | + } |
|
| 358 | 358 | |
| 359 | - function SetLink($link, $y = 0, $page = -1) { |
|
| 360 | - if (is_subclass_of($this, 'TCPDF')) { |
|
| 361 | - $args = func_get_args(); |
|
| 359 | + function SetLink($link, $y = 0, $page = -1) { |
|
| 360 | + if (is_subclass_of($this, 'TCPDF')) { |
|
| 361 | + $args = func_get_args(); |
|
| 362 | 362 | return parent::SetLink(...$args); |
| 363 | - } |
|
| 363 | + } |
|
| 364 | 364 | |
| 365 | - if ($this->_intpl) |
|
| 366 | - $this->Error('Setting links in templates aren\'t possible!'); |
|
| 367 | - parent::SetLink($link, $y, $page); |
|
| 368 | - } |
|
| 365 | + if ($this->_intpl) |
|
| 366 | + $this->Error('Setting links in templates aren\'t possible!'); |
|
| 367 | + parent::SetLink($link, $y, $page); |
|
| 368 | + } |
|
| 369 | 369 | |
| 370 | - /** |
|
| 371 | - * Private Method that writes the form xobjects |
|
| 372 | - */ |
|
| 373 | - function _putformxobjects() { |
|
| 374 | - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; |
|
| 375 | - reset($this->tpls); |
|
| 376 | - foreach($this->tpls AS $tplidx => $tpl) { |
|
| 370 | + /** |
|
| 371 | + * Private Method that writes the form xobjects |
|
| 372 | + */ |
|
| 373 | + function _putformxobjects() { |
|
| 374 | + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; |
|
| 375 | + reset($this->tpls); |
|
| 376 | + foreach($this->tpls AS $tplidx => $tpl) { |
|
| 377 | 377 | |
| 378 | - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; |
|
| 379 | - $this->_newobj(); |
|
| 380 | - $this->tpls[$tplidx]['n'] = $this->n; |
|
| 381 | - $this->_out('<<'.$filter.'/Type /XObject'); |
|
| 382 | - $this->_out('/Subtype /Form'); |
|
| 383 | - $this->_out('/FormType 1'); |
|
| 384 | - $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', |
|
| 385 | - // llx |
|
| 386 | - $tpl['x'] * $this->k, |
|
| 387 | - // lly |
|
| 388 | - -$tpl['y'] * $this->k, |
|
| 389 | - // urx |
|
| 390 | - ($tpl['w'] + $tpl['x']) * $this->k, |
|
| 391 | - // ury |
|
| 392 | - ($tpl['h'] - $tpl['y']) * $this->k |
|
| 393 | - )); |
|
| 378 | + $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; |
|
| 379 | + $this->_newobj(); |
|
| 380 | + $this->tpls[$tplidx]['n'] = $this->n; |
|
| 381 | + $this->_out('<<'.$filter.'/Type /XObject'); |
|
| 382 | + $this->_out('/Subtype /Form'); |
|
| 383 | + $this->_out('/FormType 1'); |
|
| 384 | + $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', |
|
| 385 | + // llx |
|
| 386 | + $tpl['x'] * $this->k, |
|
| 387 | + // lly |
|
| 388 | + -$tpl['y'] * $this->k, |
|
| 389 | + // urx |
|
| 390 | + ($tpl['w'] + $tpl['x']) * $this->k, |
|
| 391 | + // ury |
|
| 392 | + ($tpl['h'] - $tpl['y']) * $this->k |
|
| 393 | + )); |
|
| 394 | 394 | |
| 395 | - if ($tpl['x'] != 0 || $tpl['y'] != 0) { |
|
| 396 | - $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]', |
|
| 397 | - -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2 |
|
| 398 | - )); |
|
| 399 | - } |
|
| 395 | + if ($tpl['x'] != 0 || $tpl['y'] != 0) { |
|
| 396 | + $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]', |
|
| 397 | + -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2 |
|
| 398 | + )); |
|
| 399 | + } |
|
| 400 | 400 | |
| 401 | - $this->_out('/Resources '); |
|
| 401 | + $this->_out('/Resources '); |
|
| 402 | 402 | |
| 403 | - $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
|
| 404 | - if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { |
|
| 405 | - $this->_out('/Font <<'); |
|
| 406 | - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) |
|
| 407 | - $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
| 408 | - $this->_out('>>'); |
|
| 409 | - } |
|
| 410 | - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || |
|
| 411 | - isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) |
|
| 412 | - { |
|
| 413 | - $this->_out('/XObject <<'); |
|
| 414 | - if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { |
|
| 415 | - foreach($this->_res['tpl'][$tplidx]['images'] as $image) |
|
| 416 | - $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
| 417 | - } |
|
| 418 | - if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { |
|
| 419 | - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) |
|
| 420 | - $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R'); |
|
| 421 | - } |
|
| 422 | - $this->_out('>>'); |
|
| 423 | - } |
|
| 424 | - $this->_out('>>'); |
|
| 403 | + $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
|
| 404 | + if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { |
|
| 405 | + $this->_out('/Font <<'); |
|
| 406 | + foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) |
|
| 407 | + $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
| 408 | + $this->_out('>>'); |
|
| 409 | + } |
|
| 410 | + if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || |
|
| 411 | + isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) |
|
| 412 | + { |
|
| 413 | + $this->_out('/XObject <<'); |
|
| 414 | + if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { |
|
| 415 | + foreach($this->_res['tpl'][$tplidx]['images'] as $image) |
|
| 416 | + $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
| 417 | + } |
|
| 418 | + if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { |
|
| 419 | + foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) |
|
| 420 | + $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R'); |
|
| 421 | + } |
|
| 422 | + $this->_out('>>'); |
|
| 423 | + } |
|
| 424 | + $this->_out('>>'); |
|
| 425 | 425 | |
| 426 | - $this->_out('/Length ' . strlen($p) . ' >>'); |
|
| 427 | - $this->_putstream($p); |
|
| 428 | - $this->_out('endobj'); |
|
| 429 | - } |
|
| 430 | - } |
|
| 426 | + $this->_out('/Length ' . strlen($p) . ' >>'); |
|
| 427 | + $this->_putstream($p); |
|
| 428 | + $this->_out('endobj'); |
|
| 429 | + } |
|
| 430 | + } |
|
| 431 | 431 | |
| 432 | - /** |
|
| 433 | - * Overwritten to add _putformxobjects() after _putimages() |
|
| 434 | - * |
|
| 435 | - */ |
|
| 436 | - function _putimages() { |
|
| 437 | - parent::_putimages(); |
|
| 438 | - $this->_putformxobjects(); |
|
| 439 | - } |
|
| 432 | + /** |
|
| 433 | + * Overwritten to add _putformxobjects() after _putimages() |
|
| 434 | + * |
|
| 435 | + */ |
|
| 436 | + function _putimages() { |
|
| 437 | + parent::_putimages(); |
|
| 438 | + $this->_putformxobjects(); |
|
| 439 | + } |
|
| 440 | 440 | |
| 441 | - function _putxobjectdict() { |
|
| 442 | - parent::_putxobjectdict(); |
|
| 441 | + function _putxobjectdict() { |
|
| 442 | + parent::_putxobjectdict(); |
|
| 443 | 443 | |
| 444 | - if (count($this->tpls)) { |
|
| 445 | - foreach($this->tpls as $tplidx => $tpl) { |
|
| 446 | - $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); |
|
| 447 | - } |
|
| 448 | - } |
|
| 449 | - } |
|
| 444 | + if (count($this->tpls)) { |
|
| 445 | + foreach($this->tpls as $tplidx => $tpl) { |
|
| 446 | + $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); |
|
| 447 | + } |
|
| 448 | + } |
|
| 449 | + } |
|
| 450 | 450 | |
| 451 | - /** |
|
| 452 | - * Private Method |
|
| 453 | - */ |
|
| 454 | - function _out($s) { |
|
| 455 | - if ($this->state == 2 && $this->_intpl) { |
|
| 456 | - $this->tpls[$this->tpl]['buffer'] .= $s . "\n"; |
|
| 457 | - } else { |
|
| 458 | - parent::_out($s); |
|
| 459 | - } |
|
| 460 | - } |
|
| 451 | + /** |
|
| 452 | + * Private Method |
|
| 453 | + */ |
|
| 454 | + function _out($s) { |
|
| 455 | + if ($this->state == 2 && $this->_intpl) { |
|
| 456 | + $this->tpls[$this->tpl]['buffer'] .= $s . "\n"; |
|
| 457 | + } else { |
|
| 458 | + parent::_out($s); |
|
| 459 | + } |
|
| 460 | + } |
|
| 461 | 461 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // Save settings |
| 95 | 95 | $this->tpl++; |
| 96 | - $tpl =& $this->tpls[$this->tpl]; |
|
| 96 | + $tpl = & $this->tpls[$this->tpl]; |
|
| 97 | 97 | $tpl = array( |
| 98 | 98 | 'o_x' => $this->x, |
| 99 | 99 | 'o_y' => $this->y, |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | $this->SetRightMargin($this->w - $w + $this->rMargin); |
| 127 | 127 | |
| 128 | 128 | if ($this->CurrentFont) { |
| 129 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 130 | - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 129 | + $fontkey = $this->FontFamily.$this->FontStyle; |
|
| 130 | + $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] = & $this->fonts[$fontkey]; |
|
| 131 | 131 | |
| 132 | 132 | $this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); |
| 133 | 133 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | if ($this->_intpl) { |
| 152 | 152 | $this->_intpl = false; |
| 153 | - $tpl =& $this->tpls[$this->tpl]; |
|
| 153 | + $tpl = & $this->tpls[$this->tpl]; |
|
| 154 | 154 | $this->SetXY($tpl['o_x'], $tpl['o_y']); |
| 155 | 155 | $this->tMargin = $tpl['o_tMargin']; |
| 156 | 156 | $this->lMargin = $tpl['o_lMargin']; |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | $this->FontSizePt = $tpl['o_FontSizePt']; |
| 165 | 165 | $this->FontSize = $tpl['o_FontSize']; |
| 166 | 166 | |
| 167 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 167 | + $fontkey = $this->FontFamily.$this->FontStyle; |
|
| 168 | 168 | if ($fontkey) |
| 169 | - $this->CurrentFont =& $this->fonts[$fontkey]; |
|
| 169 | + $this->CurrentFont = & $this->fonts[$fontkey]; |
|
| 170 | 170 | |
| 171 | 171 | return $this->tpl; |
| 172 | 172 | } else { |
@@ -199,10 +199,10 @@ discard block |
||
| 199 | 199 | $this->error('Template does not exist!'); |
| 200 | 200 | |
| 201 | 201 | if ($this->_intpl) { |
| 202 | - $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; |
|
| 202 | + $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] = & $this->tpls[$tplidx]; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $tpl =& $this->tpls[$tplidx]; |
|
| 205 | + $tpl = & $this->tpls[$tplidx]; |
|
| 206 | 206 | $w = $tpl['w']; |
| 207 | 207 | $h = $tpl['h']; |
| 208 | 208 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | if (!isset($this->tpls[$tplidx])) |
| 253 | 253 | return false; |
| 254 | 254 | |
| 255 | - $tpl =& $this->tpls[$tplidx]; |
|
| 255 | + $tpl = & $this->tpls[$tplidx]; |
|
| 256 | 256 | $w = $tpl['w']; |
| 257 | 257 | $h = $tpl['h']; |
| 258 | 258 | |
@@ -261,9 +261,9 @@ discard block |
||
| 261 | 261 | $_h = $h; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - if($_w == 0) |
|
| 264 | + if ($_w == 0) |
|
| 265 | 265 | $_w = $_h * $w / $h; |
| 266 | - if($_h == 0) |
|
| 266 | + if ($_h == 0) |
|
| 267 | 267 | $_h = $_w * $h / $w; |
| 268 | 268 | |
| 269 | 269 | return array("w" => $_w, "h" => $_h); |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | /** |
| 273 | 273 | * See FPDF/TCPDF-Documentation ;-) |
| 274 | 274 | */ |
| 275 | - public function SetFont($family, $style = '', $size = 0, $fontfile='', $subset='default', $out=true) { |
|
| 275 | + public function SetFont($family, $style = '', $size = 0, $fontfile = '', $subset = 'default', $out = true) { |
|
| 276 | 276 | if (is_subclass_of($this, 'TCPDF')) { |
| 277 | 277 | $args = func_get_args(); |
| 278 | 278 | return parent::SetFont(...$args); |
@@ -280,12 +280,12 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | parent::SetFont($family, $style, $size); |
| 282 | 282 | |
| 283 | - $fontkey = $this->FontFamily . $this->FontStyle; |
|
| 283 | + $fontkey = $this->FontFamily.$this->FontStyle; |
|
| 284 | 284 | |
| 285 | 285 | if ($this->_intpl) { |
| 286 | - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 286 | + $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] = & $this->fonts[$fontkey]; |
|
| 287 | 287 | } else { |
| 288 | - $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; |
|
| 288 | + $this->_res['page'][$this->page]['fonts'][$fontkey] = & $this->fonts[$fontkey]; |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $ret = parent::Image($file, $x, $y, $w, $h, $type, $link); |
| 306 | 306 | if ($this->_intpl) { |
| 307 | - $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; |
|
| 307 | + $this->_res['tpl'][$this->tpl]['images'][$file] = & $this->images[$file]; |
|
| 308 | 308 | } else { |
| 309 | - $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; |
|
| 309 | + $this->_res['page'][$this->page]['images'][$file] = & $this->images[$file]; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | return $ret; |
@@ -371,11 +371,11 @@ discard block |
||
| 371 | 371 | * Private Method that writes the form xobjects |
| 372 | 372 | */ |
| 373 | 373 | function _putformxobjects() { |
| 374 | - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; |
|
| 374 | + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; |
|
| 375 | 375 | reset($this->tpls); |
| 376 | - foreach($this->tpls AS $tplidx => $tpl) { |
|
| 376 | + foreach ($this->tpls AS $tplidx => $tpl) { |
|
| 377 | 377 | |
| 378 | - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; |
|
| 378 | + $p = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; |
|
| 379 | 379 | $this->_newobj(); |
| 380 | 380 | $this->tpls[$tplidx]['n'] = $this->n; |
| 381 | 381 | $this->_out('<<'.$filter.'/Type /XObject'); |
@@ -403,27 +403,27 @@ discard block |
||
| 403 | 403 | $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
| 404 | 404 | if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { |
| 405 | 405 | $this->_out('/Font <<'); |
| 406 | - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) |
|
| 407 | - $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
| 406 | + foreach ($this->_res['tpl'][$tplidx]['fonts'] as $font) |
|
| 407 | + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); |
|
| 408 | 408 | $this->_out('>>'); |
| 409 | 409 | } |
| 410 | - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || |
|
| 410 | + if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || |
|
| 411 | 411 | isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) |
| 412 | 412 | { |
| 413 | 413 | $this->_out('/XObject <<'); |
| 414 | 414 | if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { |
| 415 | - foreach($this->_res['tpl'][$tplidx]['images'] as $image) |
|
| 416 | - $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
| 415 | + foreach ($this->_res['tpl'][$tplidx]['images'] as $image) |
|
| 416 | + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); |
|
| 417 | 417 | } |
| 418 | 418 | if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { |
| 419 | - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) |
|
| 420 | - $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R'); |
|
| 419 | + foreach ($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) |
|
| 420 | + $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); |
|
| 421 | 421 | } |
| 422 | 422 | $this->_out('>>'); |
| 423 | 423 | } |
| 424 | 424 | $this->_out('>>'); |
| 425 | 425 | |
| 426 | - $this->_out('/Length ' . strlen($p) . ' >>'); |
|
| 426 | + $this->_out('/Length '.strlen($p).' >>'); |
|
| 427 | 427 | $this->_putstream($p); |
| 428 | 428 | $this->_out('endobj'); |
| 429 | 429 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | parent::_putxobjectdict(); |
| 443 | 443 | |
| 444 | 444 | if (count($this->tpls)) { |
| 445 | - foreach($this->tpls as $tplidx => $tpl) { |
|
| 445 | + foreach ($this->tpls as $tplidx => $tpl) { |
|
| 446 | 446 | $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); |
| 447 | 447 | } |
| 448 | 448 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | function _out($s) { |
| 455 | 455 | if ($this->state == 2 && $this->_intpl) { |
| 456 | - $this->tpls[$this->tpl]['buffer'] .= $s . "\n"; |
|
| 456 | + $this->tpls[$this->tpl]['buffer'] .= $s."\n"; |
|
| 457 | 457 | } else { |
| 458 | 458 | parent::_out($s); |
| 459 | 459 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | throw new RestException(500, 'Error generating document'); |
| 217 | 217 | } |
| 218 | 218 | } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') { |
| 219 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 219 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 220 | 220 | $tmpobject = new FactureFournisseur($this->db); |
| 221 | 221 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
| 222 | 222 | if (!$result) { |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | throw new RestException(500, 'Error generating document'); |
| 254 | 254 | } |
| 255 | 255 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
| 256 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
| 256 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
| 257 | 257 | |
| 258 | 258 | $tmpobject = new Contrat($this->db); |
| 259 | 259 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | throw new RestException(500, 'Error generating document missing doctemplate parameter'); |
| 270 | 270 | } |
| 271 | 271 | } elseif ($modulepart == 'expedition' || $modulepart == 'shipment') { |
| 272 | - require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; |
|
| 272 | + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
|
| 273 | 273 | |
| 274 | 274 | $tmpobject = new Expedition($this->db); |
| 275 | 275 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | throw new RestException(500, 'Error generating document missing doctemplate parameter'); |
| 286 | 286 | } |
| 287 | 287 | } elseif ($modulepart == 'mrp') { |
| 288 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
| 288 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
| 289 | 289 | |
| 290 | 290 | $tmpobject = new Mo($this->db); |
| 291 | 291 | $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | throw new RestException(404, 'User not found'); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - $upload_dir = getMultidirOutput($object) . '/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id; |
|
| 392 | + $upload_dir = getMultidirOutput($object).'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id; |
|
| 393 | 393 | } elseif ($modulepart == 'adherent' || $modulepart == 'member') { |
| 394 | 394 | require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
| 395 | 395 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | throw new RestException(404, 'Member not found'); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - $upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'member'); |
|
| 406 | + $upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'member'); |
|
| 407 | 407 | } elseif ($modulepart == 'propal' || $modulepart == 'proposal') { |
| 408 | 408 | require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; |
| 409 | 409 | |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | throw new RestException(404, 'Order not found'); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - $upload_dir = getMultidirOutput($object). "/".get_exdir(0, 0, 0, 1, $object, 'commande'); |
|
| 448 | + $upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'commande'); |
|
| 449 | 449 | } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') { |
| 450 | 450 | $modulepart = 'supplier_order'; |
| 451 | 451 | |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | throw new RestException(404, 'Purchase order not found'); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | - $upload_dir = getMultidirOutput($object) . "/commande/".dol_sanitizeFileName($object->ref); |
|
| 464 | + $upload_dir = getMultidirOutput($object)."/commande/".dol_sanitizeFileName($object->ref); |
|
| 465 | 465 | } elseif ($modulepart == 'shipment' || $modulepart == 'expedition') { |
| 466 | 466 | require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
| 467 | 467 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | throw new RestException(404, 'Shipment not found'); |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | - $upload_dir = getMultidirOutput($object) . "/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment'); |
|
| 478 | + $upload_dir = getMultidirOutput($object)."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment'); |
|
| 479 | 479 | } elseif ($modulepart == 'facture' || $modulepart == 'invoice') { |
| 480 | 480 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
| 481 | 481 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | throw new RestException(404, 'Invoice not found'); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | - $upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'invoice'); |
|
| 492 | + $upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); |
|
| 493 | 493 | } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { |
| 494 | 494 | $modulepart = 'supplier_invoice'; |
| 495 | 495 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | throw new RestException(404, 'Invoice not found'); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | - $upload_dir = getMultidirOutput($object) . "/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref); |
|
| 508 | + $upload_dir = getMultidirOutput($object)."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref); |
|
| 509 | 509 | } elseif ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service') { |
| 510 | 510 | require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
| 511 | 511 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | throw new RestException(404, 'Event not found'); |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | - $upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref); |
|
| 538 | + $upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref); |
|
| 539 | 539 | } elseif ($modulepart == 'expensereport') { |
| 540 | 540 | require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; |
| 541 | 541 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | throw new RestException(404, 'Expense report not found'); |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | - $upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref); |
|
| 552 | + $upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref); |
|
| 553 | 553 | } elseif ($modulepart == 'ticket') { |
| 554 | 554 | require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
| 555 | 555 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | throw new RestException(404, 'KM article not found'); |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | - $upload_dir = getMultidirOutput($object) . '/knowledgerecord/'.dol_sanitizeFileName($object->ref); |
|
| 580 | + $upload_dir = getMultidirOutput($object).'/knowledgerecord/'.dol_sanitizeFileName($object->ref); |
|
| 581 | 581 | } elseif ($modulepart == 'categorie' || $modulepart == 'category') { |
| 582 | 582 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 583 | 583 | |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | // $recursive = 0; |
| 611 | 611 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
| 612 | 612 | $modulepart = 'contrat'; |
| 613 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
| 613 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
| 614 | 614 | |
| 615 | 615 | $object = new Contrat($this->db); |
| 616 | 616 | $result = $object->fetch($id, $ref); |
@@ -618,10 +618,10 @@ discard block |
||
| 618 | 618 | throw new RestException(404, 'Contract not found'); |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | - $upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); |
|
| 621 | + $upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'contract'); |
|
| 622 | 622 | } elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') { |
| 623 | 623 | $modulepart = 'ficheinter'; |
| 624 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
| 624 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
| 625 | 625 | |
| 626 | 626 | $object = new Fichinter($this->db); |
| 627 | 627 | $result = $object->fetch($id, $ref); |
@@ -629,20 +629,20 @@ discard block |
||
| 629 | 629 | throw new RestException(404, 'Interventional not found'); |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - $upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter'); |
|
| 632 | + $upload_dir = $conf->ficheinter->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'ficheinter'); |
|
| 633 | 633 | } elseif ($modulepart == 'projet' || $modulepart == 'project') { |
| 634 | 634 | $modulepart = 'project'; |
| 635 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 635 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 636 | 636 | |
| 637 | 637 | $object = new Project($this->db); |
| 638 | 638 | $result = $object->fetch($id, $ref); |
| 639 | 639 | if (!$result) { |
| 640 | 640 | throw new RestException(404, 'Project not found'); |
| 641 | 641 | } |
| 642 | - $upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project'); |
|
| 642 | + $upload_dir = $conf->project->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'project'); |
|
| 643 | 643 | } elseif ($modulepart == 'task' || $modulepart == 'project_task') { |
| 644 | 644 | $modulepart = 'project_task'; |
| 645 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
| 645 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
| 646 | 646 | |
| 647 | 647 | if (!DolibarrApiAccess::$user->hasRight('projet', 'lire')) { |
| 648 | 648 | throw new RestException(403); |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | throw new RestException(500, 'Error while fetching project for task'); |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | - $upload_dir = $conf->project->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . "/" . dol_sanitizeFileName($object->ref); |
|
| 663 | + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref)."/".dol_sanitizeFileName($object->ref); |
|
| 664 | 664 | } elseif ($modulepart == 'mrp') { |
| 665 | 665 | $modulepart = 'mrp'; |
| 666 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
| 666 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
| 667 | 667 | |
| 668 | 668 | $object = new Mo($this->db); |
| 669 | 669 | $result = $object->fetch($id, $ref); |
@@ -671,23 +671,23 @@ discard block |
||
| 671 | 671 | throw new RestException(404, 'MO not found'); |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | - $upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp'); |
|
| 674 | + $upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'mrp'); |
|
| 675 | 675 | } elseif ($modulepart == 'contact' || $modulepart == 'socpeople') { |
| 676 | 676 | $modulepart = 'contact'; |
| 677 | 677 | require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
| 678 | 678 | |
| 679 | 679 | $object = new Contact($this->db); |
| 680 | - $result = $object->fetch($id?$id:$ref); |
|
| 680 | + $result = $object->fetch($id ? $id : $ref); |
|
| 681 | 681 | if (!$result) { |
| 682 | 682 | throw new RestException(404, 'Contact not found'); |
| 683 | 683 | } |
| 684 | - $upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact'); |
|
| 684 | + $upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/contact/".get_exdir(0, 0, 0, 1, $object, 'contact'); |
|
| 685 | 685 | } else { |
| 686 | 686 | throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | $objectType = $modulepart; |
| 690 | - if (! empty($object->id) && ! empty($object->table_element)) { |
|
| 690 | + if (!empty($object->id) && !empty($object->table_element)) { |
|
| 691 | 691 | $objectType = $object->table_element; |
| 692 | 692 | } |
| 693 | 693 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror()); |
| 706 | 706 | } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { |
| 707 | 707 | $count = count($filearray); |
| 708 | - for ($i = 0 ; $i < $count ; $i++) { |
|
| 708 | + for ($i = 0; $i < $count; $i++) { |
|
| 709 | 709 | foreach ($ecmfile->lines as $line) { |
| 710 | 710 | unset($line->db); |
| 711 | 711 | if ($filearray[$i]['name'] == $line->filename) { |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | $object = new Propal($this->db); |
| 886 | 886 | } elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') { |
| 887 | 887 | $modulepart = 'agenda'; |
| 888 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
| 888 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
| 889 | 889 | $object = new ActionComm($this->db); |
| 890 | 890 | } elseif ($modulepart == 'contact' || $modulepart == 'socpeople') { |
| 891 | 891 | $modulepart = 'contact'; |
@@ -894,11 +894,11 @@ discard block |
||
| 894 | 894 | $fetchbyid = true; |
| 895 | 895 | } elseif ($modulepart == 'contrat' || $modulepart == 'contract') { |
| 896 | 896 | $modulepart = 'contrat'; |
| 897 | - require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
| 897 | + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
| 898 | 898 | $object = new Contrat($this->db); |
| 899 | 899 | } elseif ($modulepart == 'mrp') { |
| 900 | 900 | $modulepart = 'mrp'; |
| 901 | - require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; |
|
| 901 | + require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; |
|
| 902 | 902 | $object = new Mo($this->db); |
| 903 | 903 | } elseif ($modulepart == 'ecm') { |
| 904 | 904 | throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | $action = GETPOST('action', 'aZ09'); |
| 48 | 48 | $value = GETPOST('value', 'alpha'); |
| 49 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 49 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 50 | 50 | |
| 51 | 51 | $label = GETPOST('label', 'alpha'); |
| 52 | 52 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -286,7 +286,7 @@ |
||
| 286 | 286 | } elseif (preg_match('/MAIL_FROM$/i', $const)) { |
| 287 | 287 | print img_picto('', 'email', 'class="pictofixedwidth"').'<input type="text" class="flat minwidth300" name="constvalue_'.$const.'" value="'.dol_escape_htmltag($obj->value).'">'; |
| 288 | 288 | } else { // type = 'string' ou 'chaine' |
| 289 | - print '<input type="text" class="flat minwidth300" name="constvalue_'.$const .'" value="'.dol_escape_htmltag($obj->value).'">'; |
|
| 289 | + print '<input type="text" class="flat minwidth300" name="constvalue_'.$const.'" value="'.dol_escape_htmltag($obj->value).'">'; |
|
| 290 | 290 | } |
| 291 | 291 | print '</td>'; |
| 292 | 292 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0); |
| 145 | 145 | $result = $object->cancel($user, 0, (bool) $also_cancel_consumed_and_produced_lines); |
| 146 | 146 | if ($result > 0) { |
| 147 | - header("Location: " . DOL_URL_ROOT.'/mrp/mo_card.php?id=' . $object->id); |
|
| 147 | + header("Location: ".DOL_URL_ROOT.'/mrp/mo_card.php?id='.$object->id); |
|
| 148 | 148 | exit; |
| 149 | 149 | } else { |
| 150 | 150 | $action = ''; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0); |
| 155 | 155 | $result = $object->delete($user, 0, (bool) $also_cancel_consumed_and_produced_lines); |
| 156 | 156 | if ($result > 0) { |
| 157 | - header("Location: " . $backurlforlist); |
|
| 157 | + header("Location: ".$backurlforlist); |
|
| 158 | 158 | exit; |
| 159 | 159 | } else { |
| 160 | 160 | $action = ''; |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | 'value' => !getDolGlobalString('MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1 |
| 640 | 640 | ), |
| 641 | 641 | ); |
| 642 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1); |
|
| 642 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1); |
|
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | // Call Hook formConfirm |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | |
| 1004 | 1004 | // Lines to consume |
| 1005 | 1005 | |
| 1006 | - $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" |
|
| 1006 | + $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" |
|
| 1007 | 1007 | |
| 1008 | 1008 | if (!empty($object->lines)) { |
| 1009 | 1009 | $nblinetoconsume = 0; |
@@ -1050,15 +1050,15 @@ discard block |
||
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | 1052 | if ($qtyhourservice && $qtyhourforline) { |
| 1053 | - $linecost = price2num(($qtyhourforline / $qtyhourservice * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1054 | - $bomcostupdated += price2num(($qtyhourforline / $qtyhourservice * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1053 | + $linecost = price2num(($qtyhourforline / $qtyhourservice * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1054 | + $bomcostupdated += price2num(($qtyhourforline / $qtyhourservice * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1055 | 1055 | } else { |
| 1056 | - $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1057 | - $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1056 | + $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1057 | + $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1058 | 1058 | } |
| 1059 | 1059 | } else { |
| 1060 | - $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1061 | - $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1060 | + $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 1061 | + $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | |
@@ -1079,23 +1079,23 @@ discard block |
||
| 1079 | 1079 | $alreadyconsumed += $line2['qty']; |
| 1080 | 1080 | } |
| 1081 | 1081 | } |
| 1082 | - $suffix = '_' . $line->id; |
|
| 1083 | - print '<!-- Line to dispatch ' . $suffix . ' (line edited) -->' . "\n"; |
|
| 1082 | + $suffix = '_'.$line->id; |
|
| 1083 | + print '<!-- Line to dispatch '.$suffix.' (line edited) -->'."\n"; |
|
| 1084 | 1084 | // hidden fields for js function |
| 1085 | - print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">'; |
|
| 1085 | + print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">'; |
|
| 1086 | 1086 | // Duration - Time spent |
| 1087 | - print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">'; |
|
| 1087 | + print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">'; |
|
| 1088 | 1088 | print '<tr>'; |
| 1089 | - print '<input name="lineid" type="hidden" value="' . $line->id . '">'; |
|
| 1089 | + print '<input name="lineid" type="hidden" value="'.$line->id.'">'; |
|
| 1090 | 1090 | |
| 1091 | 1091 | // Product |
| 1092 | - print '<td>' . $tmpproduct->getNomUrl(1); |
|
| 1093 | - print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</span>'; |
|
| 1092 | + print '<td>'.$tmpproduct->getNomUrl(1); |
|
| 1093 | + print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</span>'; |
|
| 1094 | 1094 | print '</td>'; |
| 1095 | 1095 | |
| 1096 | 1096 | // Qty |
| 1097 | 1097 | print '<td class="right nowraponall">'; |
| 1098 | - print '<input class="width40 right" name="qty_lineProduce" value="'. $line->qty.'">'; |
|
| 1098 | + print '<input class="width40 right" name="qty_lineProduce" value="'.$line->qty.'">'; |
|
| 1099 | 1099 | print '</td>'; |
| 1100 | 1100 | |
| 1101 | 1101 | // Unit |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | |
| 1114 | 1114 | // Qty consumed |
| 1115 | 1115 | print '<td class="right">'; |
| 1116 | - print ' ' . price2num($alreadyconsumed, 'MS'); |
|
| 1116 | + print ' '.price2num($alreadyconsumed, 'MS'); |
|
| 1117 | 1117 | print '</td>'; |
| 1118 | 1118 | |
| 1119 | 1119 | // Warehouse / Workstation |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { |
| 1133 | 1133 | print img_warning($langs->trans('StockTooLow')).' '; |
| 1134 | 1134 | } |
| 1135 | - print '<span class="left">'. $tmpproduct->stock_reel .' </span>'; |
|
| 1135 | + print '<span class="left">'.$tmpproduct->stock_reel.' </span>'; |
|
| 1136 | 1136 | } |
| 1137 | 1137 | print '</td>'; |
| 1138 | 1138 | } |
@@ -1143,8 +1143,8 @@ discard block |
||
| 1143 | 1143 | } |
| 1144 | 1144 | // Split + SplitAll + Edit line + Delete |
| 1145 | 1145 | print '<td colspan="'.(3 + ($object->status == Mo::STATUS_DRAFT ? 1 : 0) + ($permissiontodelete ? 1 : 0)).'">'; |
| 1146 | - print '<input type="submit" class="button buttongen button-add small nominwidth" name="save" value="' . $langs->trans("Save") . '">'; |
|
| 1147 | - print '<input type="submit" class="button buttongen button-cancel small nominwidth" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1146 | + print '<input type="submit" class="button buttongen button-add small nominwidth" name="save" value="'.$langs->trans("Save").'">'; |
|
| 1147 | + print '<input type="submit" class="button buttongen button-cancel small nominwidth" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1148 | 1148 | print '</td>'; |
| 1149 | 1149 | |
| 1150 | 1150 | print '</tr>'; |
@@ -1161,29 +1161,29 @@ discard block |
||
| 1161 | 1161 | } |
| 1162 | 1162 | } |
| 1163 | 1163 | } else { |
| 1164 | - $suffix = '_' . $line->id; |
|
| 1165 | - print '<!-- Line to dispatch ' . $suffix . ' -->' . "\n"; |
|
| 1164 | + $suffix = '_'.$line->id; |
|
| 1165 | + print '<!-- Line to dispatch '.$suffix.' -->'."\n"; |
|
| 1166 | 1166 | // hidden fields for js function |
| 1167 | - print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">'; |
|
| 1168 | - print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">'; |
|
| 1167 | + print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">'; |
|
| 1168 | + print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">'; |
|
| 1169 | 1169 | |
| 1170 | - print '<tr data-line-id="' . $line->id . '">'; |
|
| 1170 | + print '<tr data-line-id="'.$line->id.'">'; |
|
| 1171 | 1171 | |
| 1172 | 1172 | // Product |
| 1173 | - print '<td>' . $tmpproduct->getNomUrl(1); |
|
| 1174 | - print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</div>'; |
|
| 1173 | + print '<td>'.$tmpproduct->getNomUrl(1); |
|
| 1174 | + print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</div>'; |
|
| 1175 | 1175 | print '</td>'; |
| 1176 | 1176 | |
| 1177 | 1177 | // Qty |
| 1178 | 1178 | print '<td class="right nowraponall">'; |
| 1179 | 1179 | $help = ''; |
| 1180 | 1180 | if ($line->qty_frozen) { |
| 1181 | - $help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("QuantityFrozen") . '</strong>: ' . yn(1) . ' (' . $langs->trans("QuantityConsumedInvariable") . ')'; |
|
| 1182 | - print $form->textwithpicto('', $help, -1, 'lock') . ' '; |
|
| 1181 | + $help = ($help ? '<br>' : '').'<strong>'.$langs->trans("QuantityFrozen").'</strong>: '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; |
|
| 1182 | + print $form->textwithpicto('', $help, -1, 'lock').' '; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | if ($line->disable_stock_change) { |
| 1185 | - $help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("DisableStockChange") . '</strong>: ' . yn(1) . ' (' . (($tmpproduct->type == Product::TYPE_SERVICE && !getDolGlobalString('STOCK_SUPPORTS_SERVICES')) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")) . ')'; |
|
| 1186 | - print $form->textwithpicto('', $help, -1, 'help') . ' '; |
|
| 1185 | + $help = ($help ? '<br>' : '').'<strong>'.$langs->trans("DisableStockChange").'</strong>: '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && !getDolGlobalString('STOCK_SUPPORTS_SERVICES')) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; |
|
| 1186 | + print $form->textwithpicto('', $help, -1, 'help').' '; |
|
| 1187 | 1187 | } |
| 1188 | 1188 | print price2num($line->qty, 'MS'); |
| 1189 | 1189 | print '</td>'; |
@@ -1208,9 +1208,9 @@ discard block |
||
| 1208 | 1208 | if ($alreadyconsumed) { |
| 1209 | 1209 | print '<script>'; |
| 1210 | 1210 | print 'jQuery(document).ready(function() { |
| 1211 | - jQuery("#expandtoproduce' . $line->id . '").click(function() { |
|
| 1212 | - console.log("Expand mrp_production line ' . $line->id . '"); |
|
| 1213 | - jQuery(".expanddetail' . $line->id . '").toggle();'; |
|
| 1211 | + jQuery("#expandtoproduce' . $line->id.'").click(function() { |
|
| 1212 | + console.log("Expand mrp_production line ' . $line->id.'"); |
|
| 1213 | + jQuery(".expanddetail' . $line->id.'").toggle();'; |
|
| 1214 | 1214 | if ($nblinetoconsume == $nblinetoconsumecursor) { // If it is the last line |
| 1215 | 1215 | print 'if (jQuery("#tablelines").hasClass("nobottom")) { jQuery("#tablelines").removeClass("nobottom"); } else { jQuery("#tablelines").addClass("nobottom"); }'; |
| 1216 | 1216 | } |
@@ -1219,9 +1219,9 @@ discard block |
||
| 1219 | 1219 | });'; |
| 1220 | 1220 | print '</script>'; |
| 1221 | 1221 | if (empty($conf->use_javascript_ajax)) { |
| 1222 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?collapse=' . $collapse . ',' . $line->id . '">'; |
|
| 1222 | + print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">'; |
|
| 1223 | 1223 | } |
| 1224 | - print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce' . $line->id . '"'); |
|
| 1224 | + print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"'); |
|
| 1225 | 1225 | if (empty($conf->use_javascript_ajax)) { |
| 1226 | 1226 | print '</a>'; |
| 1227 | 1227 | } |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | print '<script>jQuery("#tablelines").removeClass("nobottom");</script>'; |
| 1231 | 1231 | } |
| 1232 | 1232 | } |
| 1233 | - print ' ' . price2num($alreadyconsumed, 'MS'); |
|
| 1233 | + print ' '.price2num($alreadyconsumed, 'MS'); |
|
| 1234 | 1234 | print '</td>'; |
| 1235 | 1235 | |
| 1236 | 1236 | // Warehouse and/or workstation |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | if ($tmpproduct->isStockManaged()) { |
| 1239 | 1239 | // When STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE is set, we always use the warehouse of the MO, the same than production. |
| 1240 | 1240 | if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) { |
| 1241 | - print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label; |
|
| 1241 | + print img_picto('', $tmpwarehouse->picto)." ".$tmpwarehouse->label; |
|
| 1242 | 1242 | } else { |
| 1243 | 1243 | if ($line->fk_warehouse > 0) { |
| 1244 | 1244 | $warehouseline = new Entrepot($db); |
@@ -1259,7 +1259,7 @@ discard block |
||
| 1259 | 1259 | print '<td class="nowraponall right">'; |
| 1260 | 1260 | if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') && $tmpproduct->type != Product::TYPE_SERVICE) { |
| 1261 | 1261 | if (!$line->disable_stock_change && $tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { |
| 1262 | - print img_warning($langs->trans('StockTooLow')) . ' '; |
|
| 1262 | + print img_warning($langs->trans('StockTooLow')).' '; |
|
| 1263 | 1263 | } |
| 1264 | 1264 | if (!getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') || empty($tmpwarehouse->id)) { |
| 1265 | 1265 | print price2num($tmpproduct->stock_reel, 'MS'); // Available |
@@ -1290,9 +1290,9 @@ discard block |
||
| 1290 | 1290 | |
| 1291 | 1291 | // Action Edit line |
| 1292 | 1292 | if ($object->status == Mo::STATUS_DRAFT) { |
| 1293 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id); |
|
| 1293 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line->id); |
|
| 1294 | 1294 | print '<td class="center">'; |
| 1295 | - print '<a class="reposition editfielda" href="' . $href . '">'; |
|
| 1295 | + print '<a class="reposition editfielda" href="'.$href.'">'; |
|
| 1296 | 1296 | print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); |
| 1297 | 1297 | print '</a>'; |
| 1298 | 1298 | print '</td>'; |
@@ -1300,9 +1300,9 @@ discard block |
||
| 1300 | 1300 | |
| 1301 | 1301 | // Action delete line |
| 1302 | 1302 | if ($permissiontodelete) { |
| 1303 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=deleteline&token=' . newToken() . '&lineid=' . ((int) $line->id); |
|
| 1303 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id); |
|
| 1304 | 1304 | print '<td class="center">'; |
| 1305 | - print '<a class="reposition" href="' . $href . '">'; |
|
| 1305 | + print '<a class="reposition" href="'.$href.'">'; |
|
| 1306 | 1306 | print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); |
| 1307 | 1307 | print '</a>'; |
| 1308 | 1308 | print '</td>'; |
@@ -1381,9 +1381,9 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | // Action Edit line |
| 1383 | 1383 | if ($object->status == Mo::STATUS_DRAFT) { |
| 1384 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line2['rowid']); |
|
| 1384 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line2['rowid']); |
|
| 1385 | 1385 | print '<td class="center">'; |
| 1386 | - print '<a class="reposition" href="' . $href . '">'; |
|
| 1386 | + print '<a class="reposition" href="'.$href.'">'; |
|
| 1387 | 1387 | print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); |
| 1388 | 1388 | print '</a>'; |
| 1389 | 1389 | print '</td>'; |
@@ -1425,10 +1425,10 @@ discard block |
||
| 1425 | 1425 | // Qty |
| 1426 | 1426 | print '<td class="right">'; |
| 1427 | 1427 | if ((int) $tmpproduct->stockable_product > 0) { |
| 1428 | - print '<input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '>'; |
|
| 1428 | + print '<input type="text" class="width50 right" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.'>'; |
|
| 1429 | 1429 | } else { |
| 1430 | - print '<input type="hidden" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="0">'; |
|
| 1431 | - print '<span class="opacitymedium">' . $langs->trans("StockDisabled") . '</span>'; |
|
| 1430 | + print '<input type="hidden" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="0">'; |
|
| 1431 | + print '<span class="opacitymedium">'.$langs->trans("StockDisabled").'</span>'; |
|
| 1432 | 1432 | } |
| 1433 | 1433 | print '</td>'; |
| 1434 | 1434 | |
@@ -1455,9 +1455,9 @@ discard block |
||
| 1455 | 1455 | } |
| 1456 | 1456 | } else { |
| 1457 | 1457 | if ((int) $tmpproduct->stockable_product > 0) { |
| 1458 | - print '<span class="opacitymedium">' . $langs->trans("StockDisabled") . '</span>'; |
|
| 1458 | + print '<span class="opacitymedium">'.$langs->trans("StockDisabled").'</span>'; |
|
| 1459 | 1459 | } else { |
| 1460 | - print '<span class="opacitymedium">' . $langs->trans("NoStockChangeOnServices") . '</span>'; |
|
| 1460 | + print '<span class="opacitymedium">'.$langs->trans("NoStockChangeOnServices").'</span>'; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | } |
| 1463 | 1463 | print '</td>'; |
@@ -1940,8 +1940,8 @@ discard block |
||
| 1940 | 1940 | // sell by mandatory |
| 1941 | 1941 | if ($tmpproduct->sell_or_eat_by_mandatory == $tmpproduct::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY || $tmpproduct->sell_or_eat_by_mandatory == $tmpproduct::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) { |
| 1942 | 1942 | print '<td align="right">'; |
| 1943 | - $preselectedSellBy = (GETPOSTISSET('sellby-' . $line->id . '-' . $i) ? GETPOSTDATE('sellby-' . $line->id . '-' . $i) : ''); |
|
| 1944 | - print $form->selectDate($preselectedSellBy, 'sellby-' . $line->id . '-' . $i, 0, 0, 1, '', 1, 0); |
|
| 1943 | + $preselectedSellBy = (GETPOSTISSET('sellby-'.$line->id.'-'.$i) ? GETPOSTDATE('sellby-'.$line->id.'-'.$i) : ''); |
|
| 1944 | + print $form->selectDate($preselectedSellBy, 'sellby-'.$line->id.'-'.$i, 0, 0, 1, '', 1, 0); |
|
| 1945 | 1945 | print '</td>'; |
| 1946 | 1946 | } else { |
| 1947 | 1947 | if ($atLeastOneSellBy) { |
@@ -1952,8 +1952,8 @@ discard block |
||
| 1952 | 1952 | // eat by mandatory |
| 1953 | 1953 | if ($tmpproduct->sell_or_eat_by_mandatory == $tmpproduct::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY || $tmpproduct->sell_or_eat_by_mandatory == $tmpproduct::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT) { |
| 1954 | 1954 | print '<td align="right">'; |
| 1955 | - $preselectedEatBy = (GETPOSTISSET('eatby-' . $line->id . '-' . $i) ? GETPOSTDATE('eatby-' . $line->id . '-' . $i) : ''); |
|
| 1956 | - print $form->selectDate($preselectedEatBy, 'eatby-' . $line->id . '-' . $i, 0, 0, 1, '', 1, 0); |
|
| 1955 | + $preselectedEatBy = (GETPOSTISSET('eatby-'.$line->id.'-'.$i) ? GETPOSTDATE('eatby-'.$line->id.'-'.$i) : ''); |
|
| 1956 | + print $form->selectDate($preselectedEatBy, 'eatby-'.$line->id.'-'.$i, 0, 0, 1, '', 1, 0); |
|
| 1957 | 1957 | print '</td>'; |
| 1958 | 1958 | } else { |
| 1959 | 1959 | if ($atLeastOneEatBy) { |
@@ -2004,7 +2004,7 @@ discard block |
||
| 2004 | 2004 | |
| 2005 | 2005 | $.ajax({ |
| 2006 | 2006 | type: "POST", |
| 2007 | - url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>", |
|
| 2007 | + url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>", |
|
| 2008 | 2008 | data: { |
| 2009 | 2009 | action: "updateselectbatchbywarehouse", |
| 2010 | 2010 | permissiontoproduce: <?php echo $permissiontoproduce ?>, |
@@ -2065,7 +2065,7 @@ discard block |
||
| 2065 | 2065 | |
| 2066 | 2066 | $.ajax({ |
| 2067 | 2067 | type: "POST", |
| 2068 | - url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>", |
|
| 2068 | + url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>", |
|
| 2069 | 2069 | data: { |
| 2070 | 2070 | action: "updateselectwarehousebybatch", |
| 2071 | 2071 | permissiontoproduce: <?php echo $permissiontoproduce ?>, |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $number[$i] = GETPOST($i.'_num_chq', 'alpha'); |
| 100 | 100 | |
| 101 | 101 | $tabnum[$i] = 0; |
| 102 | - if (!empty($label[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) { |
|
| 102 | + if (!empty($label[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) { |
|
| 103 | 103 | $tabnum[$i] = 1; |
| 104 | 104 | $maxtab = $i; |
| 105 | 105 | } |
@@ -113,28 +113,28 @@ discard block |
||
| 113 | 113 | if ($tabnum[$n] === 1) { |
| 114 | 114 | if ($accountfrom[$n] < 0) { |
| 115 | 115 | $error++; |
| 116 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferFrom")), null, 'errors'); |
|
| 116 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("TransferFrom")), null, 'errors'); |
|
| 117 | 117 | } |
| 118 | 118 | if ($accountto[$n] < 0) { |
| 119 | 119 | $error++; |
| 120 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferTo")), null, 'errors'); |
|
| 120 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("TransferTo")), null, 'errors'); |
|
| 121 | 121 | } |
| 122 | 122 | if (!$type[$n]) { |
| 123 | 123 | $error++; |
| 124 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Type")), null, 'errors'); |
|
| 124 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Type")), null, 'errors'); |
|
| 125 | 125 | } |
| 126 | 126 | if (!$dateo[$n]) { |
| 127 | 127 | $error++; |
| 128 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Date")), null, 'errors'); |
|
| 128 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Date")), null, 'errors'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (!($label[$n])) { |
| 132 | 132 | $error++; |
| 133 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' . $langs->transnoentities("Description")), null, 'errors'); |
|
| 133 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Description")), null, 'errors'); |
|
| 134 | 134 | } |
| 135 | 135 | if (!($amount[$n])) { |
| 136 | 136 | $error++; |
| 137 | - setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Amount")), null, 'errors'); |
|
| 137 | + setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Amount")), null, 'errors'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $tmpaccountfrom = new Account($db); |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | print '<td class="hideobject multicurrency right">'.$langs->trans("AmountToOthercurrency").'</td>'; |
| 313 | 313 | print '</tr>'; |
| 314 | 314 | |
| 315 | -for ($i = 1 ; $i < $MAXLINESFORTRANSFERT; $i++) { |
|
| 315 | +for ($i = 1; $i < $MAXLINESFORTRANSFERT; $i++) { |
|
| 316 | 316 | $label = ''; |
| 317 | 317 | $amount = ''; |
| 318 | 318 | $amountto = ''; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 534 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 534 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 535 | 535 | $selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : ''); |
| 536 | 536 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 537 | 537 | |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | print '<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).'">'; |
| 813 | 813 | if ($obj->lastresult != '') { |
| 814 | 814 | if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) { |
| 815 | - print $obj->lastresult; // Print '0' |
|
| 815 | + print $obj->lastresult; // Print '0' |
|
| 816 | 816 | } else { |
| 817 | 817 | print '<span class="error">'.dol_escape_htmltag(dol_trunc($obj->lastresult)).'</div>'; |
| 818 | 818 | } |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | if ($user->hasRight('cron', 'execute')) { |
| 883 | 883 | if (!empty($obj->status)) { |
| 884 | 884 | print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=execute&token='.newToken(); |
| 885 | - print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey=' . getDolGlobalString('CRON_KEY')); |
|
| 885 | + print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey='.getDolGlobalString('CRON_KEY')); |
|
| 886 | 886 | print($sortfield ? '&sortfield='.$sortfield : ''); |
| 887 | 887 | print($sortorder ? '&sortorder='.$sortorder : ''); |
| 888 | 888 | print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', 0, 0, 0, '', 'marginleftonly').'</a>'; |
@@ -44,24 +44,24 @@ discard block |
||
| 44 | 44 | // Load Dolibarr environment |
| 45 | 45 | require '../../main.inc.php'; |
| 46 | 46 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 47 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 48 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 49 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php'; |
|
| 50 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; |
|
| 51 | -require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; |
|
| 52 | -require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
| 53 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php'; |
|
| 54 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php'; |
|
| 55 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
| 56 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
| 57 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 47 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 48 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 49 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; |
|
| 50 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; |
|
| 51 | +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; |
|
| 52 | +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
| 53 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; |
|
| 54 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; |
|
| 55 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 56 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
| 57 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 58 | 58 | if (isModEnabled('project')) { |
| 59 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 60 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 59 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 60 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (isModEnabled('variants')) { |
| 64 | - require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php'; |
|
| 64 | + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $cancel = GETPOST('cancel', 'alpha'); |
| 94 | 94 | $origin = GETPOST('origin', 'alpha'); |
| 95 | 95 | $originid = GETPOSTINT('originid'); |
| 96 | -$renewal = GETPOST('renewal'); // for contract renewal |
|
| 96 | +$renewal = GETPOST('renewal'); // for contract renewal |
|
| 97 | 97 | $confirm = GETPOST('confirm', 'alpha'); |
| 98 | 98 | $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page |
| 99 | 99 | $lineid = GETPOSTINT('lineid'); |
@@ -178,34 +178,34 @@ discard block |
||
| 178 | 178 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 179 | 179 | } |
| 180 | 180 | if (empty($reshook)) { |
| 181 | - $backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php'; |
|
| 181 | + $backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php'; |
|
| 182 | 182 | |
| 183 | 183 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 184 | 184 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 185 | 185 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 186 | 186 | $backtopage = $backurlforlist; |
| 187 | 187 | } else { |
| 188 | - $backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 188 | + $backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | if ($cancel) { |
| 194 | 194 | if (!empty($backtopageforcancel)) { |
| 195 | - header("Location: " . $backtopageforcancel); |
|
| 195 | + header("Location: ".$backtopageforcancel); |
|
| 196 | 196 | exit; |
| 197 | 197 | } elseif (!empty($backtopage)) { |
| 198 | - header("Location: " . $backtopage); |
|
| 198 | + header("Location: ".$backtopage); |
|
| 199 | 199 | exit; |
| 200 | 200 | } |
| 201 | 201 | $action = ''; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once |
|
| 204 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once |
|
| 205 | 205 | |
| 206 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 206 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 207 | 207 | |
| 208 | - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 208 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 209 | 209 | // Action clone object |
| 210 | 210 | if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { |
| 211 | 211 | if (!($socid > 0)) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $object->delivery_date = $date_delivery; |
| 240 | 240 | foreach ($object->lines as $line) { |
| 241 | 241 | if (isset($line->date_start)) { |
| 242 | - $line->date_start += $difference; |
|
| 242 | + $line->date_start += $difference; |
|
| 243 | 243 | } |
| 244 | 244 | if (isset($line->date_end)) { |
| 245 | 245 | $line->date_end += $difference; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | setEventMessages('', $warningMsgLineList, 'warnings'); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result); |
|
| 270 | + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); |
|
| 271 | 271 | exit(); |
| 272 | 272 | } else { |
| 273 | 273 | if (count($object->errors) > 0) { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | // Cancel proposal |
| 282 | 282 | $result = $object->setCancel($user); |
| 283 | 283 | if ($result > 0) { |
| 284 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 284 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 285 | 285 | exit(); |
| 286 | 286 | } else { |
| 287 | 287 | $langs->load("errors"); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | // Delete proposal |
| 292 | 292 | $result = $object->delete($user); |
| 293 | 293 | if ($result > 0) { |
| 294 | - header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1'); |
|
| 294 | + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'); |
|
| 295 | 295 | exit(); |
| 296 | 296 | } else { |
| 297 | 297 | $langs->load("errors"); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 326 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 327 | 327 | exit(); |
| 328 | 328 | } elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) { |
| 329 | 329 | // Delete line |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | $result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 354 | 354 | } |
| 355 | 355 | if ($result >= 0) { |
| 356 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); |
|
| 356 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); |
|
| 357 | 357 | exit(); |
| 358 | 358 | } |
| 359 | 359 | } else { |
@@ -625,14 +625,14 @@ discard block |
||
| 625 | 625 | |
| 626 | 626 | $id = $object->create($user); |
| 627 | 627 | if ($id > 0) { |
| 628 | - dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); |
|
| 628 | + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); |
|
| 629 | 629 | |
| 630 | 630 | $classname = ucfirst($subelement); |
| 631 | 631 | $srcobject = new $classname($db); |
| 632 | - '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 632 | + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 633 | 633 | /** @var Commande|Propal|Contrat|Fichinter|Expedition $srcobject */ |
| 634 | 634 | |
| 635 | - dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines"); |
|
| 635 | + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
|
| 636 | 636 | $result = $srcobject->fetch($object->origin_id); |
| 637 | 637 | |
| 638 | 638 | if ($result > 0) { |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | |
| 698 | 698 | $tva_tx = $lines[$i]->tva_tx; |
| 699 | 699 | if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) { |
| 700 | - $tva_tx .= ' (' . $lines[$i]->vat_src_code . ')'; |
|
| 700 | + $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; |
|
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit); |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); |
|
| 790 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); |
|
| 791 | 791 | exit(); |
| 792 | 792 | } else { |
| 793 | 793 | $db->rollback(); |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | $error++; |
| 836 | 836 | } else { |
| 837 | 837 | // Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded) |
| 838 | - $locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id; |
|
| 838 | + $locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; |
|
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | $deposit = null; |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on' |
| 847 | 847 | && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
| 848 | 848 | ) { |
| 849 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 849 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 850 | 850 | |
| 851 | 851 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
| 852 | 852 | $forceFields = array(); |
@@ -859,10 +859,10 @@ discard block |
||
| 859 | 859 | |
| 860 | 860 | if ($deposit) { |
| 861 | 861 | setEventMessage('DepositGenerated'); |
| 862 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
| 862 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
| 863 | 863 | } else { |
| 864 | 864 | $error++; |
| 865 | - setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors'); |
|
| 865 | + setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors'); |
|
| 866 | 866 | } |
| 867 | 867 | } |
| 868 | 868 | |
@@ -887,12 +887,12 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | if ($locationTarget) { |
| 890 | - header('Location: ' . $locationTarget); |
|
| 890 | + header('Location: '.$locationTarget); |
|
| 891 | 891 | exit; |
| 892 | 892 | } |
| 893 | 893 | } else { |
| 894 | 894 | $object->status = $oldstatus; |
| 895 | - $object->statut = $oldstatus; // deprecated |
|
| 895 | + $object->statut = $oldstatus; // deprecated |
|
| 896 | 896 | |
| 897 | 897 | $db->rollback(); |
| 898 | 898 | $action = ''; |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | setEventMessages($object->error, $object->errors, 'errors'); |
| 912 | 912 | $error++; |
| 913 | 913 | } else { |
| 914 | - $object->statut = $newstatus; // deprecated |
|
| 914 | + $object->statut = $newstatus; // deprecated |
|
| 915 | 915 | $object->status = $newstatus; |
| 916 | 916 | } |
| 917 | 917 | |
@@ -929,13 +929,13 @@ discard block |
||
| 929 | 929 | |
| 930 | 930 | if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) { |
| 931 | 931 | if ($fromElement == 'commande') { |
| 932 | - dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php'); |
|
| 932 | + dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); |
|
| 933 | 933 | $lineClassName = 'OrderLine'; |
| 934 | 934 | } elseif ($fromElement == 'propal') { |
| 935 | - dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php'); |
|
| 935 | + dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); |
|
| 936 | 936 | $lineClassName = 'PropaleLigne'; |
| 937 | 937 | } elseif ($fromElement == 'facture') { |
| 938 | - dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php'); |
|
| 938 | + dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php'); |
|
| 939 | 939 | $lineClassName = 'FactureLigne'; |
| 940 | 940 | } else { |
| 941 | 941 | $lineClassName = null; |
@@ -1002,14 +1002,14 @@ discard block |
||
| 1002 | 1002 | $object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount); |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
| 1005 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
| 1006 | 1006 | |
| 1007 | 1007 | // Actions to send emails |
| 1008 | 1008 | $actiontypecode = 'AC_OTH_AUTO'; |
| 1009 | 1009 | $triggersendname = 'PROPAL_SENTBYMAIL'; |
| 1010 | 1010 | $autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO'; |
| 1011 | - $trackid = 'pro' . $object->id; |
|
| 1012 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 1011 | + $trackid = 'pro'.$object->id; |
|
| 1012 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 1013 | 1013 | |
| 1014 | 1014 | |
| 1015 | 1015 | // Go back to draft |
@@ -1078,7 +1078,7 @@ discard block |
||
| 1078 | 1078 | } |
| 1079 | 1079 | $tvatx = $line->tva_tx; |
| 1080 | 1080 | if (!empty($line->vat_src_code)) { |
| 1081 | - $tvatx .= ' (' . $line->vat_src_code . ')'; |
|
| 1081 | + $tvatx .= ' ('.$line->vat_src_code.')'; |
|
| 1082 | 1082 | } |
| 1083 | 1083 | $result = $object->updateline($line->id, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); |
| 1084 | 1084 | $object->lines[$key] = $object->line; |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | if ($prod->price_min > $subprice) { |
| 1097 | 1097 | $price_subprice = price($subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1098 | 1098 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1099 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 1099 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 1100 | 1100 | } |
| 1101 | 1101 | // Manage $line->subprice and $line->multicurrency_subprice |
| 1102 | 1102 | if ($line->subprice <> 0) { |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | } else { |
| 1167 | 1167 | setEventMessages($object->error, $object->errors, 'errors'); |
| 1168 | 1168 | } |
| 1169 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); |
|
| 1169 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); |
|
| 1170 | 1170 | exit(); |
| 1171 | 1171 | } elseif ($action == 'confirm_addsubtotalline' && $usercancreate) { |
| 1172 | 1172 | // Handling adding a new subtotal line for subtotals module |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | } else { |
| 1219 | 1219 | setEventMessages($object->error, $object->errors, 'errors'); |
| 1220 | 1220 | } |
| 1221 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); |
|
| 1221 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); |
|
| 1222 | 1222 | exit(); |
| 1223 | 1223 | } elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') && $usercancreate) { |
| 1224 | 1224 | // Add line |
@@ -1260,8 +1260,8 @@ discard block |
||
| 1260 | 1260 | |
| 1261 | 1261 | $tva_tx = GETPOST('tva_tx', 'alpha'); |
| 1262 | 1262 | |
| 1263 | - $qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); |
|
| 1264 | - $remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0); |
|
| 1263 | + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); |
|
| 1264 | + $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0); |
|
| 1265 | 1265 | if (empty($remise_percent)) { |
| 1266 | 1266 | $remise_percent = 0; |
| 1267 | 1267 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | if (is_array($extralabelsline)) { |
| 1274 | 1274 | // Get extra fields |
| 1275 | 1275 | foreach ($extralabelsline as $key => $value) { |
| 1276 | - unset($_POST["options_" . $key]); |
|
| 1276 | + unset($_POST["options_".$key]); |
|
| 1277 | 1277 | } |
| 1278 | 1278 | } |
| 1279 | 1279 | |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | |
| 1346 | 1346 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
| 1347 | 1347 | // If price per customer |
| 1348 | - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; |
|
| 1348 | + require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; |
|
| 1349 | 1349 | $prodcustprice = new ProductCustomerPrice($db); |
| 1350 | 1350 | $filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id); |
| 1351 | 1351 | |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | } |
| 1410 | 1410 | } elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { |
| 1411 | 1411 | // If price per customer |
| 1412 | - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; |
|
| 1412 | + require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; |
|
| 1413 | 1413 | |
| 1414 | 1414 | $prodcustprice = new ProductCustomerPrice($db); |
| 1415 | 1415 | |
@@ -1556,23 +1556,23 @@ discard block |
||
| 1556 | 1556 | $outputlangs->load('products'); |
| 1557 | 1557 | } |
| 1558 | 1558 | if (!empty($prod->customcode)) { |
| 1559 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
| 1559 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
| 1560 | 1560 | } |
| 1561 | 1561 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 1562 | 1562 | $tmptxt .= ' - '; |
| 1563 | 1563 | } |
| 1564 | 1564 | if (!empty($prod->country_code)) { |
| 1565 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
| 1565 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
| 1566 | 1566 | } |
| 1567 | 1567 | } else { |
| 1568 | 1568 | if (!empty($prod->customcode)) { |
| 1569 | - $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
| 1569 | + $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
| 1570 | 1570 | } |
| 1571 | 1571 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 1572 | 1572 | $tmptxt .= ' - '; |
| 1573 | 1573 | } |
| 1574 | 1574 | if (!empty($prod->country_code)) { |
| 1575 | - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0); |
|
| 1575 | + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0); |
|
| 1576 | 1576 | } |
| 1577 | 1577 | } |
| 1578 | 1578 | $tmptxt .= ')'; |
@@ -1611,11 +1611,11 @@ discard block |
||
| 1611 | 1611 | $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr); |
| 1612 | 1612 | |
| 1613 | 1613 | // Margin |
| 1614 | - $fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 1615 | - $buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value |
|
| 1614 | + $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 1615 | + $buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value |
|
| 1616 | 1616 | |
| 1617 | - $date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year')); |
|
| 1618 | - $date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year')); |
|
| 1617 | + $date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year')); |
|
| 1618 | + $date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year')); |
|
| 1619 | 1619 | |
| 1620 | 1620 | // Prepare a price equivalent for minimum price check |
| 1621 | 1621 | $pu_equivalent = $pu_ht; |
@@ -1746,7 +1746,7 @@ discard block |
||
| 1746 | 1746 | if ($prod->price_min > $line->subprice) { |
| 1747 | 1747 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1748 | 1748 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1749 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 1749 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 1750 | 1750 | } else { |
| 1751 | 1751 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 1752 | 1752 | } |
@@ -1884,7 +1884,7 @@ discard block |
||
| 1884 | 1884 | $pu_ttc = price2num(GETPOST('price_ttc'), '', 2); |
| 1885 | 1885 | |
| 1886 | 1886 | // Add buying price |
| 1887 | - $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 1887 | + $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 1888 | 1888 | $buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value |
| 1889 | 1889 | |
| 1890 | 1890 | $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | if (is_array($extralabelsline)) { |
| 1932 | 1932 | // Get extra fields |
| 1933 | 1933 | foreach ($extralabelsline as $key => $value) { |
| 1934 | - unset($_POST["options_" . $key]); |
|
| 1934 | + unset($_POST["options_".$key]); |
|
| 1935 | 1935 | } |
| 1936 | 1936 | } |
| 1937 | 1937 | |
@@ -2063,7 +2063,7 @@ discard block |
||
| 2063 | 2063 | } |
| 2064 | 2064 | } |
| 2065 | 2065 | } elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) { |
| 2066 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To re-display card in edit mode |
|
| 2066 | + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To re-display card in edit mode |
|
| 2067 | 2067 | exit(); |
| 2068 | 2068 | } elseif ($action == 'classin' && $usercancreate) { |
| 2069 | 2069 | // Set project |
@@ -2077,8 +2077,8 @@ discard block |
||
| 2077 | 2077 | } elseif ($action == 'setconditions' && $usercancreate) { |
| 2078 | 2078 | // Terms of payment |
| 2079 | 2079 | $sql = "SELECT code "; |
| 2080 | - $sql .= "FROM " . $db->prefix() . "c_payment_term"; |
|
| 2081 | - $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); |
|
| 2080 | + $sql .= "FROM ".$db->prefix()."c_payment_term"; |
|
| 2081 | + $sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int')); |
|
| 2082 | 2082 | $result = $db->query($sql); |
| 2083 | 2083 | if ($result) { |
| 2084 | 2084 | $obj = $db->fetch_object($result); |
@@ -2143,7 +2143,7 @@ discard block |
||
| 2143 | 2143 | } |
| 2144 | 2144 | |
| 2145 | 2145 | if ($result >= 0) { |
| 2146 | - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); |
|
| 2146 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); |
|
| 2147 | 2147 | exit(); |
| 2148 | 2148 | } else { |
| 2149 | 2149 | if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { |
@@ -2166,7 +2166,7 @@ discard block |
||
| 2166 | 2166 | $result = $object->delete_contact($lineid); |
| 2167 | 2167 | |
| 2168 | 2168 | if ($result >= 0) { |
| 2169 | - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); |
|
| 2169 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); |
|
| 2170 | 2170 | exit(); |
| 2171 | 2171 | } else { |
| 2172 | 2172 | dol_print_error($db); |
@@ -2177,7 +2177,7 @@ discard block |
||
| 2177 | 2177 | // Actions to build doc |
| 2178 | 2178 | $upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output; |
| 2179 | 2179 | $permissiontoadd = $usercancreate; |
| 2180 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 2180 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 2181 | 2181 | } |
| 2182 | 2182 | |
| 2183 | 2183 | |
@@ -2194,7 +2194,7 @@ discard block |
||
| 2194 | 2194 | $formproject = new FormProjets($db); |
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | -$title = $object->ref . " - " . $langs->trans('Card'); |
|
| 2197 | +$title = $object->ref." - ".$langs->trans('Card'); |
|
| 2198 | 2198 | if ($action == 'create') { |
| 2199 | 2199 | $title = $langs->trans("NewPropal"); |
| 2200 | 2200 | } |
@@ -2260,11 +2260,11 @@ discard block |
||
| 2260 | 2260 | $element = $subelement = 'expedition'; |
| 2261 | 2261 | } |
| 2262 | 2262 | |
| 2263 | - dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); |
|
| 2263 | + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); |
|
| 2264 | 2264 | |
| 2265 | 2265 | $classname = ucfirst($subelement); |
| 2266 | 2266 | $objectsrc = new $classname($db); |
| 2267 | - '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 2267 | + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 2268 | 2268 | /** @var Commande|Propal|Contrat|Expedition $objectsrc */ |
| 2269 | 2269 | $objectsrc->fetch($originid); |
| 2270 | 2270 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
@@ -2340,19 +2340,19 @@ discard block |
||
| 2340 | 2340 | } |
| 2341 | 2341 | } |
| 2342 | 2342 | |
| 2343 | - print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
| 2344 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 2343 | + print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 2344 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 2345 | 2345 | print '<input type="hidden" name="action" value="add">'; |
| 2346 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2347 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 2346 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2347 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 2348 | 2348 | if ($origin != 'project' && $originid) { |
| 2349 | - print '<input type="hidden" name="origin" value="' . $origin . '">'; |
|
| 2350 | - print '<input type="hidden" name="originid" value="' . $originid . '">'; |
|
| 2349 | + print '<input type="hidden" name="origin" value="'.$origin.'">'; |
|
| 2350 | + print '<input type="hidden" name="originid" value="'.$originid.'">'; |
|
| 2351 | 2351 | if ($origin == 'contrat' && !empty($renewal)) { |
| 2352 | - print '<input type="hidden" name="renewal" value="' . $renewal . '">'; |
|
| 2352 | + print '<input type="hidden" name="renewal" value="'.$renewal.'">'; |
|
| 2353 | 2353 | } |
| 2354 | 2354 | } elseif ($origin == 'project' && !empty($projectid)) { |
| 2355 | - print '<input type="hidden" name="projectid" value="' . $projectid . '">'; |
|
| 2355 | + print '<input type="hidden" name="projectid" value="'.$projectid.'">'; |
|
| 2356 | 2356 | } |
| 2357 | 2357 | |
| 2358 | 2358 | print dol_get_fiche_head(); |
@@ -2365,22 +2365,22 @@ discard block |
||
| 2365 | 2365 | print '<table class="border centpercent">'; |
| 2366 | 2366 | |
| 2367 | 2367 | // Reference |
| 2368 | - print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>'; |
|
| 2368 | + print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>'; |
|
| 2369 | 2369 | |
| 2370 | 2370 | // Ref customer |
| 2371 | - print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">'; |
|
| 2372 | - print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>'; |
|
| 2371 | + print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">'; |
|
| 2372 | + print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>'; |
|
| 2373 | 2373 | print '</tr>'; |
| 2374 | 2374 | |
| 2375 | 2375 | // Third party |
| 2376 | 2376 | print '<tr class="field_socid">'; |
| 2377 | - print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>'; |
|
| 2377 | + print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>'; |
|
| 2378 | 2378 | $shipping_method_id = 0; |
| 2379 | 2379 | $warehouse_id = 0; |
| 2380 | 2380 | if ($socid > 0) { |
| 2381 | 2381 | print '<td class="valuefieldcreate">'; |
| 2382 | 2382 | print $soc->getNomUrl(1, 'customer'); |
| 2383 | - print '<input type="hidden" name="socid" value="' . $soc->id . '">'; |
|
| 2383 | + print '<input type="hidden" name="socid" value="'.$soc->id.'">'; |
|
| 2384 | 2384 | print '</td>'; |
| 2385 | 2385 | if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) { |
| 2386 | 2386 | $shipping_method_id = $soc->shipping_method_id; |
@@ -2389,7 +2389,7 @@ discard block |
||
| 2389 | 2389 | } else { |
| 2390 | 2390 | print '<td class="valuefieldcreate">'; |
| 2391 | 2391 | $filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; |
| 2392 | - print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); |
|
| 2392 | + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); |
|
| 2393 | 2393 | // reload page to retrieve customer information |
| 2394 | 2394 | if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { |
| 2395 | 2395 | print '<script> |
@@ -2405,63 +2405,63 @@ discard block |
||
| 2405 | 2405 | }); |
| 2406 | 2406 | </script>'; |
| 2407 | 2407 | } |
| 2408 | - print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
|
| 2408 | + print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>'; |
|
| 2409 | 2409 | print '</td>'; |
| 2410 | 2410 | } |
| 2411 | - print '</tr>' . "\n"; |
|
| 2411 | + print '</tr>'."\n"; |
|
| 2412 | 2412 | |
| 2413 | 2413 | if ($socid > 0) { |
| 2414 | 2414 | // Contacts (ask contact only if thirdparty already defined). |
| 2415 | - print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">'; |
|
| 2415 | + print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">'; |
|
| 2416 | 2416 | print img_picto('', 'contact', 'class="pictofixedwidth"'); |
| 2417 | 2417 | //print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx'); |
| 2418 | 2418 | print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true); |
| 2419 | 2419 | print '</td></tr>'; |
| 2420 | 2420 | |
| 2421 | 2421 | // Third party discounts info line |
| 2422 | - print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">'; |
|
| 2422 | + print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">'; |
|
| 2423 | 2423 | |
| 2424 | 2424 | $absolute_discount = $soc->getAvailableDiscounts(); |
| 2425 | 2425 | |
| 2426 | 2426 | $thirdparty = $soc; |
| 2427 | 2427 | $discount_type = 0; |
| 2428 | - $backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid'))); |
|
| 2429 | - include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php'; |
|
| 2428 | + $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); |
|
| 2429 | + include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; |
|
| 2430 | 2430 | print '</td></tr>'; |
| 2431 | 2431 | } |
| 2432 | 2432 | |
| 2433 | 2433 | $newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); |
| 2434 | 2434 | // Date |
| 2435 | - print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">'; |
|
| 2435 | + print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">'; |
|
| 2436 | 2436 | print img_picto('', 'action', 'class="pictofixedwidth"'); |
| 2437 | 2437 | print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1); |
| 2438 | 2438 | print '</td></tr>'; |
| 2439 | 2439 | |
| 2440 | 2440 | // Validaty duration |
| 2441 | - print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td class="valuefieldcreate">' . img_picto('', 'clock', 'class="pictofixedwidth"') . '<input name="duree_validite" class="width50" value="' . (GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')) . '"> ' . $langs->trans("days") . '</td></tr>'; |
|
| 2441 | + print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">'.$langs->trans("ValidityDuration").'</td><td class="valuefieldcreate">'.img_picto('', 'clock', 'class="pictofixedwidth"').'<input name="duree_validite" class="width50" value="'.(GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')).'"> '.$langs->trans("days").'</td></tr>'; |
|
| 2442 | 2442 | |
| 2443 | 2443 | // Terms of payment |
| 2444 | - print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>'; |
|
| 2444 | + print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>'; |
|
| 2445 | 2445 | print img_picto('', 'payment', 'class="pictofixedwidth"'); |
| 2446 | 2446 | // at last resort we take the payment term id which may be filled by default values set (if not getpostisset) |
| 2447 | 2447 | print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent); |
| 2448 | 2448 | print '</td></tr>'; |
| 2449 | 2449 | |
| 2450 | 2450 | // Mode of payment |
| 2451 | - print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">'; |
|
| 2451 | + print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">'; |
|
| 2452 | 2452 | print img_picto('', 'bank', 'class="pictofixedwidth"'); |
| 2453 | 2453 | print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); |
| 2454 | 2454 | print '</td></tr>'; |
| 2455 | 2455 | |
| 2456 | 2456 | // Bank Account |
| 2457 | 2457 | if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { |
| 2458 | - print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">'; |
|
| 2459 | - print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); |
|
| 2458 | + print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">'; |
|
| 2459 | + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); |
|
| 2460 | 2460 | print '</td></tr>'; |
| 2461 | 2461 | } |
| 2462 | 2462 | |
| 2463 | 2463 | // Source / Channel - What trigger creation |
| 2464 | - print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">'; |
|
| 2464 | + print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">'; |
|
| 2465 | 2465 | print img_picto('', 'question', 'class="pictofixedwidth"'); |
| 2466 | 2466 | $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx'); |
| 2467 | 2467 | print '</td></tr>'; |
@@ -2471,7 +2471,7 @@ discard block |
||
| 2471 | 2471 | if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) { |
| 2472 | 2472 | $shipping_method_id = $soc->shipping_method_id; |
| 2473 | 2473 | } |
| 2474 | - print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">'; |
|
| 2474 | + print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">'; |
|
| 2475 | 2475 | print img_picto('', 'dolly', 'class="pictofixedwidth"'); |
| 2476 | 2476 | $form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); |
| 2477 | 2477 | print '</td></tr>'; |
@@ -2480,17 +2480,17 @@ discard block |
||
| 2480 | 2480 | $formproduct = null; |
| 2481 | 2481 | // Warehouse |
| 2482 | 2482 | if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) { |
| 2483 | - require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; |
|
| 2483 | + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
|
| 2484 | 2484 | $formproduct = new FormProduct($db); |
| 2485 | - print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">'; |
|
| 2486 | - print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); |
|
| 2485 | + print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">'; |
|
| 2486 | + print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); |
|
| 2487 | 2487 | print '</td></tr>'; |
| 2488 | 2488 | } |
| 2489 | 2489 | |
| 2490 | 2490 | // Delivery delay |
| 2491 | - print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod'); |
|
| 2491 | + print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod'); |
|
| 2492 | 2492 | if (isModEnabled('order')) { |
| 2493 | - print ' (' . $langs->trans('AfterOrder') . ')'; |
|
| 2493 | + print ' ('.$langs->trans('AfterOrder').')'; |
|
| 2494 | 2494 | } |
| 2495 | 2495 | print '</td><td class="valuefieldcreate">'; |
| 2496 | 2496 | print img_picto('', 'clock', 'class="pictofixedwidth"'); |
@@ -2498,7 +2498,7 @@ discard block |
||
| 2498 | 2498 | print '</td></tr>'; |
| 2499 | 2499 | |
| 2500 | 2500 | // Delivery date (or manufacturing) |
| 2501 | - print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>'; |
|
| 2501 | + print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>'; |
|
| 2502 | 2502 | print '<td class="valuefieldcreate">'; |
| 2503 | 2503 | print img_picto('', 'action', 'class="pictofixedwidth"'); |
| 2504 | 2504 | if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) { // If value set to 0 or a num, not empty |
@@ -2506,7 +2506,7 @@ discard block |
||
| 2506 | 2506 | $syear = date("Y", $tmpdte); |
| 2507 | 2507 | $smonth = date("m", $tmpdte); |
| 2508 | 2508 | $sday = date("d", $tmpdte); |
| 2509 | - print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop"); |
|
| 2509 | + print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop"); |
|
| 2510 | 2510 | } else { |
| 2511 | 2511 | $tmp_date_delivery = GETPOST('date_delivery') ?: -1; |
| 2512 | 2512 | print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1); |
@@ -2517,9 +2517,9 @@ discard block |
||
| 2517 | 2517 | if (isModEnabled('project') && is_object($formproject)) { |
| 2518 | 2518 | $langs->load("projects"); |
| 2519 | 2519 | print '<tr class="field_projectid">'; |
| 2520 | - print '<td class="titlefieldcreate">' . $langs->trans("Project") . '</td><td class="valuefieldcreate">'; |
|
| 2521 | - print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); |
|
| 2522 | - print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddProject") . '"></span></a>'; |
|
| 2520 | + print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">'; |
|
| 2521 | + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); |
|
| 2522 | + print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>'; |
|
| 2523 | 2523 | print '</td>'; |
| 2524 | 2524 | print '</tr>'; |
| 2525 | 2525 | } |
@@ -2527,7 +2527,7 @@ discard block |
||
| 2527 | 2527 | // Incoterms |
| 2528 | 2528 | if (isModEnabled('incoterm')) { |
| 2529 | 2529 | print '<tr class="field_incoterm_id">'; |
| 2530 | - print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>'; |
|
| 2530 | + print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>'; |
|
| 2531 | 2531 | print '<td class="valuefieldcreate maxwidthonsmartphone">'; |
| 2532 | 2532 | print img_picto('', 'incoterm', 'class="pictofixedwidth"'); |
| 2533 | 2533 | print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : '')); |
@@ -2541,7 +2541,7 @@ discard block |
||
| 2541 | 2541 | } |
| 2542 | 2542 | // Template to use by default |
| 2543 | 2543 | print '<tr class="field_model">'; |
| 2544 | - print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>'; |
|
| 2544 | + print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>'; |
|
| 2545 | 2545 | print '<td class="valuefieldcreate">'; |
| 2546 | 2546 | print img_picto('', 'pdf', 'class="pictofixedwidth"'); |
| 2547 | 2547 | $liste = ModelePDFPropales::liste_modeles($db); |
@@ -2552,15 +2552,15 @@ discard block |
||
| 2552 | 2552 | // Multicurrency |
| 2553 | 2553 | if (isModEnabled("multicurrency")) { |
| 2554 | 2554 | print '<tr class="field_currency">'; |
| 2555 | - print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>'; |
|
| 2555 | + print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>'; |
|
| 2556 | 2556 | print '<td class="valuefieldcreate maxwidthonsmartphone">'; |
| 2557 | - print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); |
|
| 2557 | + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); |
|
| 2558 | 2558 | print '</td></tr>'; |
| 2559 | 2559 | } |
| 2560 | 2560 | |
| 2561 | 2561 | // Public note |
| 2562 | 2562 | print '<tr class="field_note_public">'; |
| 2563 | - print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>'; |
|
| 2563 | + print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>'; |
|
| 2564 | 2564 | print '<td class="valuefieldcreate">'; |
| 2565 | 2565 | $note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT') ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml'); |
| 2566 | 2566 | $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%'); |
@@ -2569,7 +2569,7 @@ discard block |
||
| 2569 | 2569 | // Private note |
| 2570 | 2570 | if (empty($user->socid)) { |
| 2571 | 2571 | print '<tr class="field_note_private">'; |
| 2572 | - print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>'; |
|
| 2572 | + print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>'; |
|
| 2573 | 2573 | print '<td class="valuefieldcreate">'; |
| 2574 | 2574 | $note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null)); |
| 2575 | 2575 | $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%'); |
@@ -2579,7 +2579,7 @@ discard block |
||
| 2579 | 2579 | } |
| 2580 | 2580 | |
| 2581 | 2581 | // Other attributes |
| 2582 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
| 2582 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
| 2583 | 2583 | |
| 2584 | 2584 | // Lines from source |
| 2585 | 2585 | if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { |
@@ -2591,13 +2591,13 @@ discard block |
||
| 2591 | 2591 | $objectsrc->update_price(1, 'auto', 1); |
| 2592 | 2592 | } |
| 2593 | 2593 | |
| 2594 | - print "\n<!-- " . $classname . " info -->"; |
|
| 2594 | + print "\n<!-- ".$classname." info -->"; |
|
| 2595 | 2595 | print "\n"; |
| 2596 | - print '<input type="hidden" name="amount" value="' . $objectsrc->total_ht . '">' . "\n"; |
|
| 2597 | - print '<input type="hidden" name="total" value="' . $objectsrc->total_ttc . '">' . "\n"; |
|
| 2598 | - print '<input type="hidden" name="tva" value="' . $objectsrc->total_tva . '">' . "\n"; |
|
| 2599 | - print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">'; |
|
| 2600 | - print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">'; |
|
| 2596 | + print '<input type="hidden" name="amount" value="'.$objectsrc->total_ht.'">'."\n"; |
|
| 2597 | + print '<input type="hidden" name="total" value="'.$objectsrc->total_ttc.'">'."\n"; |
|
| 2598 | + print '<input type="hidden" name="tva" value="'.$objectsrc->total_tva.'">'."\n"; |
|
| 2599 | + print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">'; |
|
| 2600 | + print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; |
|
| 2601 | 2601 | |
| 2602 | 2602 | $newclassname = $classname; |
| 2603 | 2603 | if ($newclassname == 'Propal') { |
@@ -2610,22 +2610,22 @@ discard block |
||
| 2610 | 2610 | $newclassname = 'Intervention'; |
| 2611 | 2611 | } |
| 2612 | 2612 | |
| 2613 | - print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>'; |
|
| 2614 | - print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
| 2615 | - print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>"; |
|
| 2613 | + print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>'; |
|
| 2614 | + print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>'; |
|
| 2615 | + print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>"; |
|
| 2616 | 2616 | if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { // Localtax1 |
| 2617 | - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>"; |
|
| 2617 | + print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>"; |
|
| 2618 | 2618 | } |
| 2619 | 2619 | |
| 2620 | 2620 | if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { // Localtax2 |
| 2621 | - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>"; |
|
| 2621 | + print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>"; |
|
| 2622 | 2622 | } |
| 2623 | - print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>"; |
|
| 2623 | + print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>"; |
|
| 2624 | 2624 | |
| 2625 | 2625 | if (isModEnabled("multicurrency")) { |
| 2626 | - print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>'; |
|
| 2627 | - print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>"; |
|
| 2628 | - print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>"; |
|
| 2626 | + print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>'; |
|
| 2627 | + print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>"; |
|
| 2628 | + print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>"; |
|
| 2629 | 2629 | } |
| 2630 | 2630 | } |
| 2631 | 2631 | |
@@ -2646,16 +2646,16 @@ discard block |
||
| 2646 | 2646 | // For backward compatibility |
| 2647 | 2647 | print '<tr>'; |
| 2648 | 2648 | print '<td><input type="radio" name="createmode" value="copy"></td>'; |
| 2649 | - print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>'; |
|
| 2649 | + print '<td>'.$langs->trans("CopyPropalFrom").' </td>'; |
|
| 2650 | 2650 | print '<td>'; |
| 2651 | 2651 | $liste_propal = array(); |
| 2652 | 2652 | $liste_propal[0] = ''; |
| 2653 | 2653 | |
| 2654 | 2654 | $sql = "SELECT p.rowid as id, p.ref, s.nom"; |
| 2655 | - $sql .= " FROM " . MAIN_DB_PREFIX . "propal p"; |
|
| 2656 | - $sql .= ", " . MAIN_DB_PREFIX . "societe s"; |
|
| 2655 | + $sql .= " FROM ".MAIN_DB_PREFIX."propal p"; |
|
| 2656 | + $sql .= ", ".MAIN_DB_PREFIX."societe s"; |
|
| 2657 | 2657 | $sql .= " WHERE s.rowid = p.fk_soc"; |
| 2658 | - $sql .= " AND p.entity IN (" . getEntity('propal') . ")"; |
|
| 2658 | + $sql .= " AND p.entity IN (".getEntity('propal').")"; |
|
| 2659 | 2659 | $sql .= " AND p.fk_statut <> 0"; |
| 2660 | 2660 | $sql .= " ORDER BY Id"; |
| 2661 | 2661 | |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | $i = 0; |
| 2666 | 2666 | while ($i < $num) { |
| 2667 | 2667 | $row = $db->fetch_row($resql); |
| 2668 | - $propalRefAndSocName = $row[1] . " - " . $row[2]; |
|
| 2668 | + $propalRefAndSocName = $row[1]." - ".$row[2]; |
|
| 2669 | 2669 | $liste_propal[$row[0]] = $propalRefAndSocName; |
| 2670 | 2670 | $i++; |
| 2671 | 2671 | } |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | print '</td></tr>'; |
| 2677 | 2677 | |
| 2678 | 2678 | print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>'; |
| 2679 | - print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>'; |
|
| 2679 | + print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>'; |
|
| 2680 | 2680 | print '</table>'; |
| 2681 | 2681 | } |
| 2682 | 2682 | } |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date); |
| 2737 | 2737 | } |
| 2738 | 2738 | // Incomplete payment. We ask if reason = discount or other |
| 2739 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600); |
|
| 2739 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600); |
|
| 2740 | 2740 | } |
| 2741 | 2741 | |
| 2742 | 2742 | // Subtotal line form |
@@ -2756,9 +2756,9 @@ discard block |
||
| 2756 | 2756 | //Form to close proposal (signed or not) |
| 2757 | 2757 | $formquestion = array(); |
| 2758 | 2758 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2759 | - $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">' . $langs->trans("CloseAs") . '</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); |
|
| 2759 | + $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); |
|
| 2760 | 2760 | } |
| 2761 | - $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2761 | + $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2762 | 2762 | |
| 2763 | 2763 | if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
| 2764 | 2764 | // This is a hidden option: |
@@ -2768,7 +2768,7 @@ discard block |
||
| 2768 | 2768 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
| 2769 | 2769 | |
| 2770 | 2770 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
| 2771 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 2771 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 2772 | 2772 | |
| 2773 | 2773 | $object->fetchObjectLinked(); |
| 2774 | 2774 | |
@@ -2854,7 +2854,7 @@ discard block |
||
| 2854 | 2854 | 'type' => 'onecolumn', |
| 2855 | 2855 | 'value' => ' |
| 2856 | 2856 | <script> |
| 2857 | - let signedValue = ' . $object::STATUS_SIGNED . '; |
|
| 2857 | + let signedValue = ' . $object::STATUS_SIGNED.'; |
|
| 2858 | 2858 | |
| 2859 | 2859 | $(document).ready(function() { |
| 2860 | 2860 | $("[name=generate_deposit]").change(function () { |
@@ -2894,7 +2894,7 @@ discard block |
||
| 2894 | 2894 | } |
| 2895 | 2895 | |
| 2896 | 2896 | if (isModEnabled('notification')) { |
| 2897 | - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; |
|
| 2897 | + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; |
|
| 2898 | 2898 | $notify = new Notify($db); |
| 2899 | 2899 | $formquestion = array_merge($formquestion, array( |
| 2900 | 2900 | array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)), |
@@ -2902,22 +2902,22 @@ discard block |
||
| 2902 | 2902 | } |
| 2903 | 2903 | |
| 2904 | 2904 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2905 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2905 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2906 | 2906 | } else { |
| 2907 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2907 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2908 | 2908 | } |
| 2909 | 2909 | } elseif ($action == 'cancel') { |
| 2910 | 2910 | // Confirm cancel |
| 2911 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1); |
|
| 2911 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1); |
|
| 2912 | 2912 | } elseif ($action == 'delete') { |
| 2913 | 2913 | // Confirm delete |
| 2914 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); |
|
| 2914 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); |
|
| 2915 | 2915 | } elseif ($action == 'reopen') { |
| 2916 | 2916 | // Confirm reopen |
| 2917 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1); |
|
| 2917 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1); |
|
| 2918 | 2918 | } elseif ($action == 'ask_deleteline') { |
| 2919 | 2919 | // Confirmation delete product/service line |
| 2920 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); |
|
| 2920 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); |
|
| 2921 | 2921 | } elseif ($action == 'ask_subtotal_deleteline') { |
| 2922 | 2922 | // Confirmation de la suppression d'une ligne subtotal |
| 2923 | 2923 | $langs->load("subtotals"); |
@@ -2928,7 +2928,7 @@ discard block |
||
| 2928 | 2928 | $title = "DeleteTitleLine"; |
| 2929 | 2929 | $question = "ConfirmDeleteTitleLine"; |
| 2930 | 2930 | } |
| 2931 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1); |
|
| 2931 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1); |
|
| 2932 | 2932 | } elseif ($action == 'validate') { |
| 2933 | 2933 | // Confirm validate proposal |
| 2934 | 2934 | $error = 0; |
@@ -2947,7 +2947,7 @@ discard block |
||
| 2947 | 2947 | |
| 2948 | 2948 | $text = $langs->trans('ConfirmValidateProp', $numref); |
| 2949 | 2949 | if (isModEnabled('notification')) { |
| 2950 | - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; |
|
| 2950 | + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; |
|
| 2951 | 2951 | $notify = new Notify($db); |
| 2952 | 2952 | $text .= '<br>'; |
| 2953 | 2953 | $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object); |
@@ -2957,7 +2957,7 @@ discard block |
||
| 2957 | 2957 | $nbMandated = 0; |
| 2958 | 2958 | foreach ($object->lines as $line) { |
| 2959 | 2959 | $res = $line->fetch_product(); |
| 2960 | - if ($res > 0) { |
|
| 2960 | + if ($res > 0) { |
|
| 2961 | 2961 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 2962 | 2962 | $nbMandated++; |
| 2963 | 2963 | break; |
@@ -2969,12 +2969,12 @@ discard block |
||
| 2969 | 2969 | setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors'); |
| 2970 | 2970 | $error++; |
| 2971 | 2971 | } else { |
| 2972 | - $text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>'; |
|
| 2972 | + $text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
| 2973 | 2973 | } |
| 2974 | 2974 | } |
| 2975 | 2975 | |
| 2976 | 2976 | if (!$error) { |
| 2977 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240); |
|
| 2977 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240); |
|
| 2978 | 2978 | } |
| 2979 | 2979 | } |
| 2980 | 2980 | |
@@ -2993,16 +2993,16 @@ discard block |
||
| 2993 | 2993 | |
| 2994 | 2994 | // Proposal card |
| 2995 | 2995 | |
| 2996 | - $linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 2996 | + $linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 2997 | 2997 | |
| 2998 | 2998 | $morehtmlref = '<div class="refidno">'; |
| 2999 | 2999 | // Ref customer |
| 3000 | 3000 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
| 3001 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 3001 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 3002 | 3002 | // Thirdparty |
| 3003 | - $morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer'); |
|
| 3003 | + $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
|
| 3004 | 3004 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) { |
| 3005 | - $morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)'; |
|
| 3005 | + $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)'; |
|
| 3006 | 3006 | } |
| 3007 | 3007 | // Project |
| 3008 | 3008 | if (isModEnabled('project')) { |
@@ -3011,16 +3011,16 @@ discard block |
||
| 3011 | 3011 | if ($usercancreate) { |
| 3012 | 3012 | $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); |
| 3013 | 3013 | if ($action != 'classify') { |
| 3014 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
| 3014 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; |
|
| 3015 | 3015 | } |
| 3016 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 3016 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 3017 | 3017 | } else { |
| 3018 | 3018 | if (!empty($object->fk_project)) { |
| 3019 | 3019 | $proj = new Project($db); |
| 3020 | 3020 | $proj->fetch($object->fk_project); |
| 3021 | 3021 | $morehtmlref .= $proj->getNomUrl(1); |
| 3022 | 3022 | if ($proj->title) { |
| 3023 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; |
|
| 3023 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; |
|
| 3024 | 3024 | } |
| 3025 | 3025 | } |
| 3026 | 3026 | } |
@@ -3050,7 +3050,7 @@ discard block |
||
| 3050 | 3050 | $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; |
| 3051 | 3051 | } |
| 3052 | 3052 | |
| 3053 | - print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>'; |
|
| 3053 | + print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>'; |
|
| 3054 | 3054 | |
| 3055 | 3055 | $absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount); |
| 3056 | 3056 | $absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote); |
@@ -3061,8 +3061,8 @@ discard block |
||
| 3061 | 3061 | |
| 3062 | 3062 | $thirdparty = $soc; |
| 3063 | 3063 | $discount_type = 0; |
| 3064 | - $backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id; |
|
| 3065 | - include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php'; |
|
| 3064 | + $backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id; |
|
| 3065 | + include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; |
|
| 3066 | 3066 | |
| 3067 | 3067 | print '</td></tr>'; |
| 3068 | 3068 | |
@@ -3081,12 +3081,12 @@ discard block |
||
| 3081 | 3081 | print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable); |
| 3082 | 3082 | print '</td><td class="valuefield">'; |
| 3083 | 3083 | if ($action == 'editdate' && $usercancreate && $caneditfield) { |
| 3084 | - print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; |
|
| 3085 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 3084 | + print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; |
|
| 3085 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 3086 | 3086 | print '<input type="hidden" name="action" value="setdate">'; |
| 3087 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 3087 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 3088 | 3088 | print $form->selectDate($object->date, 're', 0, 0, 0, "editdate"); |
| 3089 | - print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">'; |
|
| 3089 | + print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">'; |
|
| 3090 | 3090 | print '</form>'; |
| 3091 | 3091 | } else { |
| 3092 | 3092 | if ($object->date) { |
@@ -3104,17 +3104,17 @@ discard block |
||
| 3104 | 3104 | print $langs->trans('DateEndPropal'); |
| 3105 | 3105 | print '</td>'; |
| 3106 | 3106 | if ($action != 'editecheance' && $usercancreate && $caneditfield) { |
| 3107 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; |
|
| 3107 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; |
|
| 3108 | 3108 | } |
| 3109 | 3109 | print '</tr></table>'; |
| 3110 | 3110 | print '</td><td class="valuefield">'; |
| 3111 | 3111 | if ($action == 'editecheance' && $usercancreate && $caneditfield) { |
| 3112 | - print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; |
|
| 3113 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 3112 | + print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; |
|
| 3113 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 3114 | 3114 | print '<input type="hidden" name="action" value="setecheance">'; |
| 3115 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 3115 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 3116 | 3116 | print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance"); |
| 3117 | - print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">'; |
|
| 3117 | + print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">'; |
|
| 3118 | 3118 | print '</form>'; |
| 3119 | 3119 | } else { |
| 3120 | 3120 | if (!empty($object->fin_validite)) { |
@@ -3135,14 +3135,14 @@ discard block |
||
| 3135 | 3135 | print $langs->trans('PaymentConditionsShort'); |
| 3136 | 3136 | print '</td>'; |
| 3137 | 3137 | if ($action != 'editconditions' && $usercancreate && $caneditfield) { |
| 3138 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>'; |
|
| 3138 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>'; |
|
| 3139 | 3139 | } |
| 3140 | 3140 | print '</tr></table>'; |
| 3141 | 3141 | print '</td><td class="valuefield">'; |
| 3142 | 3142 | if ($action == 'editconditions' && $usercancreate && $caneditfield) { |
| 3143 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent); |
|
| 3143 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent); |
|
| 3144 | 3144 | } else { |
| 3145 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent); |
|
| 3145 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent); |
|
| 3146 | 3146 | } |
| 3147 | 3147 | print '</td>'; |
| 3148 | 3148 | print '</tr>'; |
@@ -3154,14 +3154,14 @@ discard block |
||
| 3154 | 3154 | print $langs->trans('PaymentMode'); |
| 3155 | 3155 | print '</td>'; |
| 3156 | 3156 | if ($action != 'editmode' && $usercancreate && $caneditfield) { |
| 3157 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>'; |
|
| 3157 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>'; |
|
| 3158 | 3158 | } |
| 3159 | 3159 | print '</tr></table>'; |
| 3160 | 3160 | print '</td><td class="valuefieldcreate">'; |
| 3161 | 3161 | if ($action == 'editmode' && $usercancreate && $caneditfield) { |
| 3162 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 3162 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 3163 | 3163 | } else { |
| 3164 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none'); |
|
| 3164 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none'); |
|
| 3165 | 3165 | } |
| 3166 | 3166 | print '</td></tr>'; |
| 3167 | 3167 | |
@@ -3177,20 +3177,20 @@ discard block |
||
| 3177 | 3177 | print '<tr class="fielddeliverydelay"><td>'; |
| 3178 | 3178 | print '<table class="nobordernopadding centpercent"><tr><td>'; |
| 3179 | 3179 | if (isModEnabled('order')) { |
| 3180 | - print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')'); |
|
| 3180 | + print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); |
|
| 3181 | 3181 | } else { |
| 3182 | 3182 | print $langs->trans('AvailabilityPeriod'); |
| 3183 | 3183 | } |
| 3184 | 3184 | print '</td>'; |
| 3185 | 3185 | if ($action != 'editavailability' && $usercancreate && $caneditfield) { |
| 3186 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>'; |
|
| 3186 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>'; |
|
| 3187 | 3187 | } |
| 3188 | 3188 | print '</tr></table>'; |
| 3189 | 3189 | print '</td><td class="valuefield">'; |
| 3190 | 3190 | if ($action == 'editavailability' && $usercancreate && $caneditfield) { |
| 3191 | - $form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1); |
|
| 3191 | + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1); |
|
| 3192 | 3192 | } else { |
| 3193 | - $form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1); |
|
| 3193 | + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1); |
|
| 3194 | 3194 | } |
| 3195 | 3195 | |
| 3196 | 3196 | print '</td>'; |
@@ -3203,14 +3203,14 @@ discard block |
||
| 3203 | 3203 | print $langs->trans('SendingMethod'); |
| 3204 | 3204 | print '</td>'; |
| 3205 | 3205 | if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) { |
| 3206 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>'; |
|
| 3206 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>'; |
|
| 3207 | 3207 | } |
| 3208 | 3208 | print '</tr></table>'; |
| 3209 | 3209 | print '</td><td class="valuefield">'; |
| 3210 | 3210 | if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) { |
| 3211 | - $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1); |
|
| 3211 | + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1); |
|
| 3212 | 3212 | } else { |
| 3213 | - $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none'); |
|
| 3213 | + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none'); |
|
| 3214 | 3214 | } |
| 3215 | 3215 | print '</td>'; |
| 3216 | 3216 | print '</tr>'; |
@@ -3219,16 +3219,16 @@ discard block |
||
| 3219 | 3219 | // Warehouse |
| 3220 | 3220 | if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) { |
| 3221 | 3221 | $langs->load('stocks'); |
| 3222 | - require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; |
|
| 3222 | + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
|
| 3223 | 3223 | $formproduct = new FormProduct($db); |
| 3224 | 3224 | print '<tr class="field_warehouse_id"><td>'; |
| 3225 | 3225 | $editenable = $usercancreate; |
| 3226 | 3226 | print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable); |
| 3227 | 3227 | print '</td><td class="valuefieldcreate">'; |
| 3228 | 3228 | if ($action == 'editwarehouse') { |
| 3229 | - $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1); |
|
| 3229 | + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1); |
|
| 3230 | 3230 | } else { |
| 3231 | - $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none'); |
|
| 3231 | + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none'); |
|
| 3232 | 3232 | } |
| 3233 | 3233 | print '</td>'; |
| 3234 | 3234 | print '</tr>'; |
@@ -3240,14 +3240,14 @@ discard block |
||
| 3240 | 3240 | print $langs->trans('Source'); |
| 3241 | 3241 | print '</td>'; |
| 3242 | 3242 | if ($action != 'editdemandreason' && $usercancreate) { |
| 3243 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>'; |
|
| 3243 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>'; |
|
| 3244 | 3244 | } |
| 3245 | 3245 | print '</tr></table>'; |
| 3246 | 3246 | print '</td><td class="valuefield">'; |
| 3247 | 3247 | if ($action == 'editdemandreason' && $usercancreate) { |
| 3248 | - $form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1); |
|
| 3248 | + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1); |
|
| 3249 | 3249 | } else { |
| 3250 | - $form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none'); |
|
| 3250 | + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none'); |
|
| 3251 | 3251 | } |
| 3252 | 3252 | print '</td>'; |
| 3253 | 3253 | print '</tr>'; |
@@ -3259,7 +3259,7 @@ discard block |
||
| 3259 | 3259 | print '</td><td class="valuefield">'; |
| 3260 | 3260 | $arrayoutstandingbills = $soc->getOutstandingBills(); |
| 3261 | 3261 | print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : ''); |
| 3262 | - print price($arrayoutstandingbills['opened']) . ' / '; |
|
| 3262 | + print price($arrayoutstandingbills['opened']).' / '; |
|
| 3263 | 3263 | print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency); |
| 3264 | 3264 | print '</td>'; |
| 3265 | 3265 | print '</tr>'; |
@@ -3272,14 +3272,14 @@ discard block |
||
| 3272 | 3272 | print $langs->trans('BankAccount'); |
| 3273 | 3273 | print '</td>'; |
| 3274 | 3274 | if ($action != 'editbankaccount' && $usercancreate) { |
| 3275 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>'; |
|
| 3275 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
| 3276 | 3276 | } |
| 3277 | 3277 | print '</tr></table>'; |
| 3278 | 3278 | print '</td><td class="valuefield">'; |
| 3279 | 3279 | if ($action == 'editbankaccount') { |
| 3280 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1); |
|
| 3280 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1); |
|
| 3281 | 3281 | } else { |
| 3282 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none'); |
|
| 3282 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); |
|
| 3283 | 3283 | } |
| 3284 | 3284 | print '</td>'; |
| 3285 | 3285 | print '</tr>'; |
@@ -3290,13 +3290,13 @@ discard block |
||
| 3290 | 3290 | $totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0; |
| 3291 | 3291 | $totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0; |
| 3292 | 3292 | if ($totalWeight) { |
| 3293 | - print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>'; |
|
| 3293 | + print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>'; |
|
| 3294 | 3294 | print '<td class="valuefield">'; |
| 3295 | 3295 | print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1); |
| 3296 | 3296 | print '</td></tr>'; |
| 3297 | 3297 | } |
| 3298 | 3298 | if ($totalVolume) { |
| 3299 | - print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>'; |
|
| 3299 | + print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>'; |
|
| 3300 | 3300 | print '<td class="valuefield">'; |
| 3301 | 3301 | print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1); |
| 3302 | 3302 | print '</td></tr>'; |
@@ -3310,7 +3310,7 @@ discard block |
||
| 3310 | 3310 | print $langs->trans('IncotermLabel'); |
| 3311 | 3311 | print '<td><td class="right">'; |
| 3312 | 3312 | if ($action != 'editincoterm' && $usercancreate && $caneditfield) { |
| 3313 | - print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>'; |
|
| 3313 | + print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>'; |
|
| 3314 | 3314 | } else { |
| 3315 | 3315 | print ' '; |
| 3316 | 3316 | } |
@@ -3318,7 +3318,7 @@ discard block |
||
| 3318 | 3318 | print '</td>'; |
| 3319 | 3319 | print '<td class="valuefield">'; |
| 3320 | 3320 | if ($action == 'editincoterm' && $usercancreate && $caneditfield) { |
| 3321 | - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
| 3321 | + print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); |
|
| 3322 | 3322 | } else { |
| 3323 | 3323 | print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); |
| 3324 | 3324 | } |
@@ -3353,7 +3353,7 @@ discard block |
||
| 3353 | 3353 | } |
| 3354 | 3354 | |
| 3355 | 3355 | // Other attributes |
| 3356 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 3356 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 3357 | 3357 | |
| 3358 | 3358 | print '</table>'; |
| 3359 | 3359 | |
@@ -3363,53 +3363,53 @@ discard block |
||
| 3363 | 3363 | |
| 3364 | 3364 | print '<table class="border tableforfield centpercent">'; |
| 3365 | 3365 | |
| 3366 | - include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php'; |
|
| 3366 | + include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
|
| 3367 | 3367 | |
| 3368 | 3368 | print '<tr>'; |
| 3369 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 3370 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3369 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 3370 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3371 | 3371 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3372 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3372 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3373 | 3373 | } |
| 3374 | 3374 | print '</tr>'; |
| 3375 | 3375 | |
| 3376 | 3376 | print '<tr>'; |
| 3377 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 3378 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3377 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 3378 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3379 | 3379 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3380 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3380 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3381 | 3381 | } |
| 3382 | 3382 | print '</tr>'; |
| 3383 | 3383 | |
| 3384 | 3384 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
| 3385 | 3385 | print '<tr>'; |
| 3386 | - print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 3387 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3386 | + print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 3387 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3388 | 3388 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3389 | 3389 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 3390 | 3390 | |
| 3391 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3391 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3392 | 3392 | } |
| 3393 | 3393 | print '</tr>'; |
| 3394 | 3394 | } |
| 3395 | 3395 | |
| 3396 | 3396 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
| 3397 | 3397 | print '<tr>'; |
| 3398 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 3399 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3398 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 3399 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3400 | 3400 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3401 | 3401 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 3402 | 3402 | |
| 3403 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3403 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3404 | 3404 | } |
| 3405 | 3405 | print '</tr>'; |
| 3406 | 3406 | } |
| 3407 | 3407 | |
| 3408 | 3408 | print '<tr>'; |
| 3409 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 3410 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3409 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 3410 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3411 | 3411 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3412 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3412 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3413 | 3413 | } |
| 3414 | 3414 | print '</tr>'; |
| 3415 | 3415 | |
@@ -3428,13 +3428,13 @@ discard block |
||
| 3428 | 3428 | if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { |
| 3429 | 3429 | $blocname = 'contacts'; |
| 3430 | 3430 | $title = $langs->trans('ContactsAddresses'); |
| 3431 | - include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php'; |
|
| 3431 | + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; |
|
| 3432 | 3432 | } |
| 3433 | 3433 | |
| 3434 | 3434 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 3435 | 3435 | $blocname = 'notes'; |
| 3436 | 3436 | $title = $langs->trans('Notes'); |
| 3437 | - include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php'; |
|
| 3437 | + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; |
|
| 3438 | 3438 | } |
| 3439 | 3439 | |
| 3440 | 3440 | /* |
@@ -3449,20 +3449,20 @@ discard block |
||
| 3449 | 3449 | global $inputalsopricewithtax; |
| 3450 | 3450 | $inputalsopricewithtax = 1; |
| 3451 | 3451 | |
| 3452 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST"> |
|
| 3453 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
| 3454 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
| 3452 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST"> |
|
| 3453 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
| 3454 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
| 3455 | 3455 | <input type="hidden" name="mode" value=""> |
| 3456 | 3456 | <input type="hidden" name="page_y" value=""> |
| 3457 | - <input type="hidden" name="backtopage" value="' . $backtopage . '"> |
|
| 3458 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
| 3457 | + <input type="hidden" name="backtopage" value="' . $backtopage.'"> |
|
| 3458 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
| 3459 | 3459 | '; |
| 3460 | 3460 | |
| 3461 | 3461 | if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) { |
| 3462 | 3462 | if (isModEnabled('subtotals')) { |
| 3463 | - include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php'; |
|
| 3463 | + include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php'; |
|
| 3464 | 3464 | } else { |
| 3465 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 3465 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 3466 | 3466 | } |
| 3467 | 3467 | } |
| 3468 | 3468 | |
@@ -3517,7 +3517,7 @@ discard block |
||
| 3517 | 3517 | if (empty($reshook)) { |
| 3518 | 3518 | if ($action != 'editline') { |
| 3519 | 3519 | // Subtotal |
| 3520 | - if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) { |
|
| 3520 | + if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) { |
|
| 3521 | 3521 | $langs->load('subtotals'); |
| 3522 | 3522 | |
| 3523 | 3523 | $url_button = array(); |
@@ -3527,7 +3527,7 @@ discard block |
||
| 3527 | 3527 | 'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT), |
| 3528 | 3528 | 'perm' => (bool) $usercancreate, |
| 3529 | 3529 | 'label' => $langs->trans('AddTitleLine'), |
| 3530 | - 'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken() |
|
| 3530 | + 'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken() |
|
| 3531 | 3531 | ); |
| 3532 | 3532 | |
| 3533 | 3533 | $url_button[] = array( |
@@ -3535,7 +3535,7 @@ discard block |
||
| 3535 | 3535 | 'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT), |
| 3536 | 3536 | 'perm' => (bool) $usercancreate, |
| 3537 | 3537 | 'label' => $langs->trans('AddSubtotalLine'), |
| 3538 | - 'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken() |
|
| 3538 | + 'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken() |
|
| 3539 | 3539 | ); |
| 3540 | 3540 | |
| 3541 | 3541 | print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true); |
@@ -3546,9 +3546,9 @@ discard block |
||
| 3546 | 3546 | || ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0) |
| 3547 | 3547 | ) { |
| 3548 | 3548 | if ($usercanvalidate) { |
| 3549 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken() . '">' . (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')) . '</a>'; |
|
| 3549 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.(!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).'</a>'; |
|
| 3550 | 3550 | } else { |
| 3551 | - print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>'; |
|
| 3551 | + print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>'; |
|
| 3552 | 3552 | } |
| 3553 | 3553 | } |
| 3554 | 3554 | // Create event |
@@ -3558,23 +3558,23 @@ discard block |
||
| 3558 | 3558 | }*/ |
| 3559 | 3559 | // Edit |
| 3560 | 3560 | if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) { |
| 3561 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>'; |
|
| 3561 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>'; |
|
| 3562 | 3562 | } |
| 3563 | 3563 | |
| 3564 | 3564 | // ReOpen |
| 3565 | 3565 | if (((getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && $object->status == Propal::STATUS_NOTSIGNED) || (!getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && ($object->status == Propal::STATUS_SIGNED || $object->status == Propal::STATUS_NOTSIGNED || $object->status == Propal::STATUS_BILLED || $object->status == Propal::STATUS_CANCELED)))) { |
| 3566 | 3566 | if ($usercanreopen) { |
| 3567 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"'; |
|
| 3568 | - print '>' . $langs->trans('ReOpen') . '</a>'; |
|
| 3567 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"'; |
|
| 3568 | + print '>'.$langs->trans('ReOpen').'</a>'; |
|
| 3569 | 3569 | } else { |
| 3570 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>'; |
|
| 3570 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>'; |
|
| 3571 | 3571 | } |
| 3572 | 3572 | } |
| 3573 | 3573 | |
| 3574 | 3574 | // Send |
| 3575 | 3575 | if (empty($user->socid)) { |
| 3576 | 3576 | if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) { |
| 3577 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend); |
|
| 3577 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend); |
|
| 3578 | 3578 | } |
| 3579 | 3579 | } |
| 3580 | 3580 | |
@@ -3586,7 +3586,7 @@ discard block |
||
| 3586 | 3586 | 'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED), |
| 3587 | 3587 | 'perm' => $usercancreateorder, |
| 3588 | 3588 | 'label' => 'AddOrder', |
| 3589 | - 'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3589 | + 'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3590 | 3590 | ); |
| 3591 | 3591 | /*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) { |
| 3592 | 3592 | if ($usercancreateorder) { |
@@ -3601,7 +3601,7 @@ discard block |
||
| 3601 | 3601 | 'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")), |
| 3602 | 3602 | 'perm' => $usercancreatepurchaseorder, |
| 3603 | 3603 | 'label' => 'AddPurchaseOrder', |
| 3604 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3604 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3605 | 3605 | ); |
| 3606 | 3606 | /*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) { |
| 3607 | 3607 | if ($usercancreatepurchaseorder) { |
@@ -3616,7 +3616,7 @@ discard block |
||
| 3616 | 3616 | 'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED), |
| 3617 | 3617 | 'perm' => $usercancreateintervention, |
| 3618 | 3618 | 'label' => 'AddIntervention', |
| 3619 | - 'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3619 | + 'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3620 | 3620 | ); |
| 3621 | 3621 | /*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) { |
| 3622 | 3622 | if ($usercancreateintervention) { |
@@ -3631,7 +3631,7 @@ discard block |
||
| 3631 | 3631 | 'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED), |
| 3632 | 3632 | 'perm' => $usercancreatecontract, |
| 3633 | 3633 | 'label' => 'AddContract', |
| 3634 | - 'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3634 | + 'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3635 | 3635 | ); |
| 3636 | 3636 | /*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) { |
| 3637 | 3637 | $langs->load("contracts"); |
@@ -3648,7 +3648,7 @@ discard block |
||
| 3648 | 3648 | 'enabled' => isModEnabled('invoice'), |
| 3649 | 3649 | 'perm' => $usercancreateinvoice, |
| 3650 | 3650 | 'label' => 'CreateBill', |
| 3651 | - 'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid), |
|
| 3651 | + 'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid), |
|
| 3652 | 3652 | ]; |
| 3653 | 3653 | /*if (isModEnabled('invoice') && $usercancreateinvoice) { |
| 3654 | 3654 | print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>'; |
@@ -3657,7 +3657,7 @@ discard block |
||
| 3657 | 3657 | |
| 3658 | 3658 | $actionButtonsParameters = [ |
| 3659 | 3659 | "areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"), |
| 3660 | - "backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id) |
|
| 3660 | + "backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id) |
|
| 3661 | 3661 | ]; |
| 3662 | 3662 | |
| 3663 | 3663 | if ($numlines > 0) { |
@@ -3670,9 +3670,9 @@ discard block |
||
| 3670 | 3670 | $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); |
| 3671 | 3671 | if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) { |
| 3672 | 3672 | if ($usercanclose) { |
| 3673 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>'; |
|
| 3673 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>'; |
|
| 3674 | 3674 | } else { |
| 3675 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>'; |
|
| 3675 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>'; |
|
| 3676 | 3676 | } |
| 3677 | 3677 | } |
| 3678 | 3678 | } |
@@ -3681,33 +3681,33 @@ discard block |
||
| 3681 | 3681 | // Close as accepted/refused |
| 3682 | 3682 | if ($object->status == Propal::STATUS_VALIDATED) { |
| 3683 | 3683 | if ($usercanclose) { |
| 3684 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"'; |
|
| 3685 | - print '>' . $langs->trans('SetAcceptedRefused') . '</a>'; |
|
| 3684 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"'; |
|
| 3685 | + print '>'.$langs->trans('SetAcceptedRefused').'</a>'; |
|
| 3686 | 3686 | } else { |
| 3687 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"'; |
|
| 3688 | - print '>' . $langs->trans('SetAcceptedRefused') . '</a>'; |
|
| 3687 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"'; |
|
| 3688 | + print '>'.$langs->trans('SetAcceptedRefused').'</a>'; |
|
| 3689 | 3689 | } |
| 3690 | 3690 | } |
| 3691 | 3691 | } else { |
| 3692 | 3692 | // Set not signed (close) |
| 3693 | 3693 | if ($object->status == Propal::STATUS_DRAFT && $usercanclose) { |
| 3694 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"'; |
|
| 3695 | - print '>' . $langs->trans('SetRefusedAndClose') . '</a>'; |
|
| 3694 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"'; |
|
| 3695 | + print '>'.$langs->trans('SetRefusedAndClose').'</a>'; |
|
| 3696 | 3696 | } |
| 3697 | 3697 | } |
| 3698 | 3698 | |
| 3699 | 3699 | // Cancel propal |
| 3700 | 3700 | if ($object->status > Propal::STATUS_DRAFT && $usercanclose) { |
| 3701 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>'; |
|
| 3701 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>'; |
|
| 3702 | 3702 | } |
| 3703 | 3703 | |
| 3704 | 3704 | // Clone |
| 3705 | 3705 | if ($usercancreate) { |
| 3706 | - print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken() . '&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a>'; |
|
| 3706 | + print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object='.$object->element.'">'.$langs->trans("ToClone").'</a>'; |
|
| 3707 | 3707 | } |
| 3708 | 3708 | |
| 3709 | 3709 | // Delete |
| 3710 | - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete); |
|
| 3710 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete); |
|
| 3711 | 3711 | } |
| 3712 | 3712 | } |
| 3713 | 3713 | |
@@ -3726,8 +3726,8 @@ discard block |
||
| 3726 | 3726 | * Generated documents |
| 3727 | 3727 | */ |
| 3728 | 3728 | $objref = dol_sanitizeFileName($object->ref); |
| 3729 | - $filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref); |
|
| 3730 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
| 3729 | + $filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref); |
|
| 3730 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
| 3731 | 3731 | $genallowed = $usercanread; |
| 3732 | 3732 | $delallowed = $usercancreate; |
| 3733 | 3733 | $tooltipAfterComboOfModels = ''; |
@@ -3754,19 +3754,19 @@ discard block |
||
| 3754 | 3754 | |
| 3755 | 3755 | if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) { |
| 3756 | 3756 | print '<br><!-- Link to sign -->'; |
| 3757 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php'; |
|
| 3758 | - print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>'; |
|
| 3757 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; |
|
| 3758 | + print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>'; |
|
| 3759 | 3759 | } |
| 3760 | 3760 | |
| 3761 | 3761 | print '</div><div class="fichehalfright">'; |
| 3762 | 3762 | |
| 3763 | 3763 | $MAXEVENT = 10; |
| 3764 | 3764 | |
| 3765 | - $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id); |
|
| 3766 | - $morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id); |
|
| 3765 | + $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id); |
|
| 3766 | + $morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id); |
|
| 3767 | 3767 | |
| 3768 | 3768 | // List of actions on element |
| 3769 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
| 3769 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
| 3770 | 3770 | $formactions = new FormActions($db); |
| 3771 | 3771 | $somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty |
| 3772 | 3772 | |
@@ -3777,9 +3777,9 @@ discard block |
||
| 3777 | 3777 | $modelmail = 'propal_send'; |
| 3778 | 3778 | $defaulttopic = 'SendPropalRef'; |
| 3779 | 3779 | $diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity]; |
| 3780 | - $trackid = 'pro' . $object->id; |
|
| 3780 | + $trackid = 'pro'.$object->id; |
|
| 3781 | 3781 | |
| 3782 | - include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; |
|
| 3782 | + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
| 3783 | 3783 | } |
| 3784 | 3784 | |
| 3785 | 3785 | // End of page |