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);
$text .= '<br>';
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
}
// mandatoryPeriod
$nbMandated = 0;
foreach ($object->lines as $line){
foreach ($object->lines as $line) {
$res = $line->fetch_product();
if ($res > 0 ){
if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){
if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
$nbMandated++;
break;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -582,7 +582,7 @@ if (empty($reshook)) {
} else {
$object->accountancy_code_buy_export = $accountancy_code_buy_export;
}
if ($object->isService()){
if ($object->isService()) {
$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></tr>';
}
}
}
print '</table>';
@ -2287,7 +2284,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td></tr>';
} else {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
// Nature