@@ -122,38 +122,38 @@ |
||
122 | 122 | $objd = $db->fetch_object($resd); |
123 | 123 | |
124 | 124 | switch($objd->item){ |
125 | - case "Invoice": |
|
126 | - $subdir=dol_sanitizeFileName($objd->ref); |
|
127 | - $upload_dir = $conf->facture->dir_output.'/'.$subdir; |
|
128 | - $link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
129 | - break; |
|
130 | - case "InvoiceSupplier": |
|
131 | - $subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').dol_sanitizeFileName($objd->ref); |
|
132 | - $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; |
|
133 | - $link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
134 | - break; |
|
135 | - case "Expense": |
|
136 | - $subdir=dol_sanitizeFileName($objd->ref); |
|
137 | - $upload_dir = $conf->expensereport->dir_output.'/'.$subdir; |
|
138 | - $link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
139 | - break; |
|
140 | - case "Salary": |
|
141 | - $subdir=dol_sanitizeFileName($objd->id); |
|
142 | - $upload_dir = $conf->salaries->dir_output.'/'.$subdir; |
|
143 | - $link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
144 | - break; |
|
145 | - case "Donation": |
|
146 | - $subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->id); |
|
147 | - $upload_dir = $conf->don->dir_output . '/' . $subdir; |
|
148 | - $link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
149 | - break; |
|
150 | - case "Charge": |
|
151 | - $subdir=dol_sanitizeFileName($objd->id); |
|
152 | - $upload_dir = $conf->tax->dir_output . '/' . $subdir; |
|
153 | - $link="../../document.php?modulepart=tax&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
154 | - break; |
|
155 | - default: |
|
156 | - break; |
|
125 | + case "Invoice": |
|
126 | + $subdir=dol_sanitizeFileName($objd->ref); |
|
127 | + $upload_dir = $conf->facture->dir_output.'/'.$subdir; |
|
128 | + $link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
129 | + break; |
|
130 | + case "InvoiceSupplier": |
|
131 | + $subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').dol_sanitizeFileName($objd->ref); |
|
132 | + $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; |
|
133 | + $link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
134 | + break; |
|
135 | + case "Expense": |
|
136 | + $subdir=dol_sanitizeFileName($objd->ref); |
|
137 | + $upload_dir = $conf->expensereport->dir_output.'/'.$subdir; |
|
138 | + $link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
139 | + break; |
|
140 | + case "Salary": |
|
141 | + $subdir=dol_sanitizeFileName($objd->id); |
|
142 | + $upload_dir = $conf->salaries->dir_output.'/'.$subdir; |
|
143 | + $link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
144 | + break; |
|
145 | + case "Donation": |
|
146 | + $subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->id); |
|
147 | + $upload_dir = $conf->don->dir_output . '/' . $subdir; |
|
148 | + $link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
149 | + break; |
|
150 | + case "Charge": |
|
151 | + $subdir=dol_sanitizeFileName($objd->id); |
|
152 | + $upload_dir = $conf->tax->dir_output . '/' . $subdir; |
|
153 | + $link="../../document.php?modulepart=tax&file=".str_replace('/','%2F',$subdir).'%2F'; |
|
154 | + break; |
|
155 | + default: |
|
156 | + break; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | if(!empty($upload_dir)){ |
@@ -3879,15 +3879,15 @@ discard block |
||
3879 | 3879 | { |
3880 | 3880 | switch ($type) |
3881 | 3881 | { |
3882 | - case 0: |
|
3883 | - return $this->LibStatut($this->status, $mode, $type); |
|
3884 | - case 1: |
|
3885 | - return $this->LibStatut($this->status_buy, $mode, $type); |
|
3886 | - case 2: |
|
3887 | - return $this->LibStatut($this->status_batch, $mode, $type); |
|
3888 | - default: |
|
3889 | - //Simulate previous behavior but should return an error string |
|
3890 | - return $this->LibStatut($this->status_buy, $mode, $type); |
|
3882 | + case 0: |
|
3883 | + return $this->LibStatut($this->status, $mode, $type); |
|
3884 | + case 1: |
|
3885 | + return $this->LibStatut($this->status_buy, $mode, $type); |
|
3886 | + case 2: |
|
3887 | + return $this->LibStatut($this->status_batch, $mode, $type); |
|
3888 | + default: |
|
3889 | + //Simulate previous behavior but should return an error string |
|
3890 | + return $this->LibStatut($this->status_buy, $mode, $type); |
|
3891 | 3891 | } |
3892 | 3892 | } |
3893 | 3893 | |
@@ -3912,23 +3912,23 @@ discard block |
||
3912 | 3912 | if ($type == 2) { |
3913 | 3913 | switch ($mode) |
3914 | 3914 | { |
3915 | - case 0: |
|
3916 | - return ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch')); |
|
3917 | - case 1: |
|
3918 | - return ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort')); |
|
3919 | - case 2: |
|
3920 | - return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); |
|
3921 | - case 3: |
|
3922 | - if ($status == 0) { |
|
3923 | - return img_picto($langs->trans('ProductStatusNotOnBatch'), 'statut5'); |
|
3924 | - } |
|
3925 | - return img_picto($langs->trans('ProductStatusOnBatch'), 'statut4'); |
|
3926 | - case 4: |
|
3927 | - return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2); |
|
3928 | - case 5: |
|
3929 | - return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2); |
|
3930 | - default: |
|
3931 | - return $langs->trans('Unknown'); |
|
3915 | + case 0: |
|
3916 | + return ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch')); |
|
3917 | + case 1: |
|
3918 | + return ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort')); |
|
3919 | + case 2: |
|
3920 | + return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); |
|
3921 | + case 3: |
|
3922 | + if ($status == 0) { |
|
3923 | + return img_picto($langs->trans('ProductStatusNotOnBatch'), 'statut5'); |
|
3924 | + } |
|
3925 | + return img_picto($langs->trans('ProductStatusOnBatch'), 'statut4'); |
|
3926 | + case 4: |
|
3927 | + return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2); |
|
3928 | + case 5: |
|
3929 | + return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2); |
|
3930 | + default: |
|
3931 | + return $langs->trans('Unknown'); |
|
3932 | 3932 | } |
3933 | 3933 | } |
3934 | 3934 | if ($mode == 0) { |