Fixing style errors.

This commit is contained in:
stickler-ci 2021-07-20 13:35:10 +00:00
parent dc90a62d90
commit 2f0ba41a53
6 changed files with 15 additions and 21 deletions

View File

@ -1958,15 +1958,14 @@ if ($action == 'create') {
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object); $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
} }
// mandatoryPeriod // mandatoryPeriod
$nbMandated = 0; $nbMandated = 0;
foreach ($object->lines as $line){ foreach ($object->lines as $line) {
$res = $line->fetch_product(); $res = $line->fetch_product();
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
$nbMandated++; $nbMandated++;
break; break;
} }

View File

@ -1912,10 +1912,10 @@ if ($action == 'create' && $usercancreate) {
// mandatoryPeriod // mandatoryPeriod
$nbMandated = 0; $nbMandated = 0;
foreach ($object->lines as $line){ foreach ($object->lines as $line) {
$res = $line->fetch_product(); $res = $line->fetch_product();
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
$nbMandated++; $nbMandated++;
break; break;
} }

View File

@ -4004,10 +4004,10 @@ if ($action == 'create') {
// mandatoryPeriod // mandatoryPeriod
$nbMandated = 0; $nbMandated = 0;
foreach ($object->lines as $line){ foreach ($object->lines as $line) {
$res = $line->fetch_product(); $res = $line->fetch_product();
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
$nbMandated++; $nbMandated++;
break; break;
} }

View File

@ -340,7 +340,7 @@ $coldisplay++;
} }
$res = $line->fetch_product(); $res = $line->fetch_product();
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isMandatoryPeriod() && $line->product->isService()) { if ($line->product->isMandatoryPeriod() && $line->product->isService()) {
print 'jQuery("#date_start").addClass("error");'; print 'jQuery("#date_start").addClass("error");';
} }
@ -356,7 +356,7 @@ $coldisplay++;
$res = $line->fetch_product(); $res = $line->fetch_product();
// on doit fetch le product là !!! pour connaître le type // on doit fetch le product là !!! pour connaître le type
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isMandatoryperiod() && $line->product->isService()) { if ($line->product->isMandatoryperiod() && $line->product->isService()) {
print 'jQuery("#date_end").addClass("error");'; print 'jQuery("#date_end").addClass("error");';
} }

View File

@ -180,14 +180,13 @@ if (($line->info_bits & 2) == 2) {
} else { } else {
if ($line->date_start || $line->date_end) { if ($line->date_start || $line->date_end) {
print '<br><div class="clearboth nowraponall opacitymedium">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; print '<br><div class="clearboth nowraponall opacitymedium">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
} }
if (!$line->date_start || !$line->date_end){ if (!$line->date_start || !$line->date_end) {
// show warning under line // show warning under line
// we need to fetch product associated to line for some test // we need to fetch product associated to line for some test
$res = $line->fetch_product(); $res = $line->fetch_product();
if ($res > 0 ){ if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod()){ if ($line->product->isService() && $line->product->isMandatoryPeriod()) {
print '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSet").'</span></div>'; print '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSet").'</span></div>';
} }
} }

View File

@ -582,7 +582,7 @@ if (empty($reshook)) {
} else { } else {
$object->accountancy_code_buy_export = $accountancy_code_buy_export; $object->accountancy_code_buy_export = $accountancy_code_buy_export;
} }
if ($object->isService()){ if ($object->isService()) {
$object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ;
} }
@ -1993,9 +1993,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<td><input type="checkbox" name="mandatoryperiod"'.($object->mandatory_period == 1 ? ' checked="checked"' : '').' /> '; print '<td><input type="checkbox" name="mandatoryperiod"'.($object->mandatory_period == 1 ? ' checked="checked"' : '').' /> ';
print '</td></tr>'; print '</td></tr>';
} }
} }
} }
print '</table>'; print '</table>';
@ -2287,7 +2284,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<td class="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td></tr>'; print '</td></tr>';
} else { } else {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
// Nature // Nature