psr2 Squiz.WhiteSpace.ScopeClosingBrace.Indent

This commit is contained in:
Frédéric FRANCE 2019-02-03 14:29:45 +01:00
parent 2e5382f40d
commit 80a12fcd1c
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
104 changed files with 2035 additions and 2058 deletions

View File

@ -140,12 +140,10 @@ else { print "err"; }
$prodids = array(); $prodids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql) {
{
$num_prods = $db->num_rows($resql); $num_prods = $db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num_prods) while ($i < $num_prods) {
{
$i++; $i++;
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
@ -155,7 +153,6 @@ if ($resql)
print "Build ".GEN_NUMBER_COMMANDE." orders\n"; print "Build ".GEN_NUMBER_COMMANDE." orders\n";
for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
{ {

View File

@ -173,6 +173,8 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. --> <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties> <properties>

View File

@ -280,7 +280,7 @@ if (! empty($search_credit)) {
if (! empty($search_lettering_code)) { if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code; $filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code); $param .= '&search_lettering_code=' . urlencode($search_lettering_code);
} }
if ($action == 'delbookkeeping') { if ($action == 'delbookkeeping') {

View File

@ -106,13 +106,13 @@ class Subscription extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
if ($this->fk_type == null) { if ($this->fk_type == null) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$member=new Adherent($this->db); $member=new Adherent($this->db);
$result=$member->fetch($this->fk_adherent); $result=$member->fetch($this->fk_adherent);
$type=$member->typeid; $type=$member->typeid;
} else { } else {
$type=$this->fk_type; $type=$this->fk_type;
} }
$sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',"; $sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->dateh)."',"; $sql.= " '".$this->db->idate($this->dateh)."',";
$sql.= " '".$this->db->idate($this->datef)."',"; $sql.= " '".$this->db->idate($this->datef)."',";

View File

@ -159,7 +159,8 @@ if ($mode)
} }
if ($mode == 'memberbyregion') //+ if ($mode == 'memberbyregion') //+
{ {
$data[]=array('label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), $data[]=array(
'label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")), 'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb, 'nb'=>$obj->nb,

View File

@ -313,7 +313,7 @@ if ($rowid && $action != 'edit')
print '<tr>'; print '<tr>';
print '<td class="titlefield">'.$langs->trans("Type").'</td>'; print '<td class="titlefield">'.$langs->trans("Type").'</td>';
print '<td class="valeur">'; print '<td class="valeur">';
if ( ! empty($object->fk_type) ) { if (! empty($object->fk_type) ) {
$adht->fetch($object->fk_type); $adht->fetch($object->fk_type);
print $adht->getNomUrl(1); print $adht->getNomUrl(1);
} else { } else {

View File

@ -68,8 +68,7 @@ if (!function_exists('gzdecode')) {
* Action * Action
*/ */
if ($action == 'addprinter' && $user->admin) if ($action == 'addprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printername)) { if (empty($printername)) {
@ -81,8 +80,7 @@ if ($action == 'addprinter' && $user->admin)
setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings'); setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
} }
if (! $error) if (! $error) {
{
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); $result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -100,8 +98,7 @@ if ($action == 'addprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'deleteprinter' && $user->admin) if ($action == 'deleteprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -109,8 +106,7 @@ if ($action == 'deleteprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->DeletePrinter($printerid); $result= $printer->DeletePrinter($printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -128,8 +124,7 @@ if ($action == 'deleteprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'updateprinter' && $user->admin) if ($action == 'updateprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -137,18 +132,14 @@ if ($action == 'updateprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); $result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("PrinterUpdated",$printername), null); setEventMessages($langs->trans("PrinterUpdated",$printername), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -156,24 +147,19 @@ if ($action == 'updateprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'testprinter' && $user->admin) if ($action == 'testprinter' && $user->admin) {
{
$error=0; $error=0;
if (empty($printerid)) { if (empty($printerid)) {
$error++; $error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
// test // test
$ret = $printer->SendTestToPrinter($printerid); $ret = $printer->SendTestToPrinter($printerid);
if ($ret == 0) if ($ret == 0) {
{
setEventMessages($langs->trans("TestSentToPrinter", $printername), null); setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
} } else {
else
{
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} }
} }
@ -181,8 +167,7 @@ if ($action == 'testprinter' && $user->admin)
} }
if ($action == 'updatetemplate' && $user->admin) if ($action == 'updatetemplate' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($templateid)) { if (empty($templateid)) {
@ -190,18 +175,14 @@ if ($action == 'updatetemplate' && $user->admin)
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors'); setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdateTemplate($templatename, $template, $templateid); $result= $printer->UpdateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("TemplateUpdated",$templatename), null); setEventMessages($langs->trans("TemplateUpdated",$templatename), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -223,8 +204,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"),$linkback,'title_set
$head = receiptprinteradmin_prepare_head($mode); $head = receiptprinteradmin_prepare_head($mode);
if ($mode == 'config' && $user->admin) if ($mode == 'config' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='editprinter') { if ($action!='editprinter') {
@ -253,11 +233,9 @@ if ($mode == 'config' && $user->admin)
if ($ret > 0) { if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} else { } else {
for ($line=0; $line < $nbofprinters; $line++) for ($line=0; $line < $nbofprinters; $line++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
{
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">'; print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>'; print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
@ -291,10 +269,8 @@ if ($mode == 'config' && $user->admin)
} }
} }
if ($action!='editprinter') if ($action!='editprinter') {
{ if ($nbofprinters > 0) {
if ($nbofprinters > 0)
{
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>'; print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>'; print '<th>'.$langs->trans("Type").'</th>';
@ -357,8 +333,7 @@ if ($mode == 'config' && $user->admin)
dol_fiche_end(); dol_fiche_end();
} }
if ($mode == 'template' && $user->admin) if ($mode == 'template' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='edittemplate') { if ($action!='edittemplate') {
@ -429,8 +404,7 @@ if ($mode == 'template' && $user->admin)
print '<th>'.$langs->trans("Description").'</th>'; print '<th>'.$langs->trans("Description").'</th>';
print "</tr>\n"; print "</tr>\n";
$max = count($printer->tags); $max = count($printer->tags);
for ($tag=0; $tag < $max; $tag++) for ($tag=0; $tag < $max; $tag++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>'; print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
print '</tr>'; print '</tr>';

View File

@ -98,15 +98,14 @@ print '<br>';
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook'); $arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
foreach($arrayofsocialnetworks as $snkey => $snlabel) foreach($arrayofsocialnetworks as $snkey => $snlabel) {
{
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey); $consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck); $link = ajax_constantonoff($consttocheck);
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
$link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck); $link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck);
} }
print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>'; print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>';
} }

View File

@ -96,8 +96,7 @@ foreach ($modulesdir as $dir)
if (empty($conf->$module->enabled)) $enabled=false; if (empty($conf->$module->enabled)) $enabled=false;
if ($enabled) if ($enabled) {
{
/* /*
* If exists, load the API class for enable module * If exists, load the API class for enable module
* *

View File

@ -875,8 +875,8 @@ class AdvanceTargetingMailing extends CommonObject
foreach($extralabels as $key=>$val) { foreach($extralabels as $key=>$val) {
if (($extrafields->attribute_type[$key] == 'varchar') || if (($extrafields->attribute_type[$key] == 'varchar')
($extrafields->attribute_type[$key] == 'text')) { || ($extrafields->attribute_type[$key] == 'text')) {
if (!empty($arrayquery['options_'.$key])) { if (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')"; $sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
} }
@ -890,11 +890,11 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['options_'.$key.'_end_dt'])){ if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')"; $sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
} }
}elseif ($extrafields->attribute_type[$key] == 'boolean') { } elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){ if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")"; $sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
} }
}else{ } else {
if (is_array($arrayquery['options_'.$key])) { if (is_array($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." IN ('".implode("','",$arrayquery['options_'.$key])."'))"; $sqlwhere[]= " (tse.".$key." IN ('".implode("','",$arrayquery['options_'.$key])."'))";
} elseif (!empty($arrayquery['options_'.$key])) { } elseif (!empty($arrayquery['options_'.$key])) {

View File

@ -109,14 +109,12 @@ if (is_resource($handle))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num ) while ($i < $num ) {
{
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<td>'.img_object('',$mailmodule->picto).' '.$obj->label.'</td><td class="right">'.$obj->nb.'<td>'; print '<td>'.img_object('',$mailmodule->picto).' '.$obj->label.'</td><td class="right">'.$obj->nb.'<td>';
$i++; $i++;
@ -154,8 +152,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " ORDER BY m.date_creat DESC"; $sql.= " ORDER BY m.date_creat DESC";
$sql.= " LIMIT ".$limit; $sql.= " LIMIT ".$limit;
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("LastMailings",$limit).'</td>'; print '<td colspan="2">'.$langs->trans("LastMailings",$limit).'</td>';
@ -164,12 +161,10 @@ if ($result)
print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td></tr>'; print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td></tr>';
$num = $db->num_rows($result); $num = $db->num_rows($result);
if ($num > 0) if ($num > 0) {
{
$i = 0; $i = 0;
while ($i < $num ) while ($i < $num ) {
{
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -207,7 +202,7 @@ if ($langs->file_exists("html/spam.html",0)) {
print '</div>'; print '</div>';
print '<br>'; print '<br>';
} }
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -297,8 +297,7 @@ class Proposals extends DolibarrApi
if ($updateRes > 0) { if ($updateRes > 0) {
return $updateRes; return $updateRes;
} } else {
else {
throw new RestException(400, $this->propal->error); throw new RestException(400, $this->propal->error);
} }
} }

View File

@ -24,8 +24,7 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -54,7 +53,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
?> ?>
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > <tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?> <td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) <?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{ {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>'; print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
@ -86,7 +86,7 @@ if (count($linkedObjectBlock) > 1)
<td class="right"></td> <td class="right"></td>
<td class="right"></td> <td class="right"></td>
</tr> </tr>
<?php <?php
} }
?> ?>

View File

@ -183,13 +183,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
foreach($sqls as $sql){ foreach($sqls as $sql){
$resql = $db->query($sql); $resql = $db->query($sql);
if($resql){ if ($resql) {
while($sqlobj = $db->fetch_object($resql)){ while ($sqlobj = $db->fetch_object($resql)) {
$tab_sqlobj[] = $sqlobj; $tab_sqlobj[] = $sqlobj;
$tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr); $tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr);
} }
$db->free($resql); $db->free($resql);
}else{ } else {
$error++; $error++;
} }
} }

View File

@ -66,10 +66,8 @@ print '<tr class="liste_titre">';
print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n"; print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n";
print "</tr>\n"; print "</tr>\n";
if ($resql) if ($resql) {
{ if ($row = $db->fetch_row($resql) ) {
if ($row = $db->fetch_row($resql) )
{
$num = $row[0]; $num = $row[0];
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -57,8 +57,7 @@ $date_startday = GETPOST("date_startday");
$date_endyear = GETPOST("date_endyear"); $date_endyear = GETPOST("date_endyear");
$date_endmonth = GETPOST("date_endmonth"); $date_endmonth = GETPOST("date_endmonth");
$date_endday = GETPOST("date_endday"); $date_endday = GETPOST("date_endday");
if (empty($year)) if (empty($year)) {
{
$year_current = strftime("%Y",dol_now()); $year_current = strftime("%Y",dol_now());
$month_current = strftime("%m",dol_now()); $month_current = strftime("%m",dol_now());
$year_start = $year_current; $year_start = $year_current;
@ -302,7 +301,7 @@ print_liste_field_titre(
"", "",
$sortfield, $sortfield,
$sortorder $sortorder
); );
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
print_liste_field_titre( print_liste_field_titre(
$langs->trans('AmountHT'), $langs->trans('AmountHT'),
@ -314,7 +313,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sortfield, $sortfield,
$sortorder $sortorder
); );
} else { } else {
print_liste_field_titre(''); print_liste_field_titre('');
} }
print_liste_field_titre( print_liste_field_titre(
@ -326,7 +325,7 @@ print_liste_field_titre(
'align="right"', 'align="right"',
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"],"amount_ttc", $_SERVER["PHP_SELF"],"amount_ttc",
@ -335,7 +334,7 @@ print_liste_field_titre(
'align="right"', 'align="right"',
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("OtherStatistics"), $langs->trans("OtherStatistics"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
@ -343,7 +342,7 @@ print_liste_field_titre(
"", "",
"", "",
'align="center" width="20%"' 'align="center" width="20%"'
); );
print "</tr>\n"; print "</tr>\n";
if (count($amount)) { if (count($amount)) {

View File

@ -74,8 +74,7 @@ $date_startday = GETPOST("date_startday",'alpha');
$date_endyear = GETPOST("date_endyear",'alpha'); $date_endyear = GETPOST("date_endyear",'alpha');
$date_endmonth = GETPOST("date_endmonth",'alpha'); $date_endmonth = GETPOST("date_endmonth",'alpha');
$date_endday = GETPOST("date_endday",'alpha'); $date_endday = GETPOST("date_endday",'alpha');
if (empty($year)) if (empty($year)) {
{
$year_current = strftime("%Y",dol_now()); $year_current = strftime("%Y",dol_now());
$month_current = strftime("%m",dol_now()); $month_current = strftime("%m",dol_now());
$year_start = $year_current; $year_start = $year_current;
@ -452,7 +451,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sortfield, $sortfield,
$sortorder $sortorder
); );
} else { } else {
print_liste_field_titre(''); print_liste_field_titre('');
} }
print_liste_field_titre( print_liste_field_titre(
@ -464,7 +463,7 @@ print_liste_field_titre(
'align="right"', 'align="right"',
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
@ -474,7 +473,7 @@ print_liste_field_titre(
'align="right"', 'align="right"',
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("OtherStatistics"), $langs->trans("OtherStatistics"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
@ -482,7 +481,7 @@ print_liste_field_titre(
"", "",
"", "",
'align="center" width="20%"' 'align="center" width="20%"'
); );
print "</tr>\n"; print "</tr>\n";

View File

@ -1010,7 +1010,8 @@ class Contact extends CommonObject
} }
// Removed extrafields // Removed extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) {
// For avoid conflicts if trigger used
$result=$this->deleteExtraFields($this); $result=$this->deleteExtraFields($this);
if ($result < 0) $error++; if ($result < 0) $error++;
} }

View File

@ -220,7 +220,7 @@ class Contracts extends DolibarrApi
*/ */
function getLines($id) function getLines($id)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->lire) { if (! DolibarrApiAccess::$user->rights->contrat->lire) {
throw new RestException(401); throw new RestException(401);
} }

View File

@ -5434,8 +5434,7 @@ abstract class CommonObject
elseif (in_array($type,array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/',$type)) elseif (in_array($type,array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/',$type))
{ {
$morecss = 'maxwidth75'; $morecss = 'maxwidth75';
}elseif ($type == 'url') } elseif ($type == 'url') {
{
$morecss='minwidth400'; $morecss='minwidth400';
} }
elseif ($type == 'boolean') elseif ($type == 'boolean')

View File

@ -1470,7 +1470,7 @@ class Form
$contactstatic->id=$obj->rowid; $contactstatic->id=$obj->rowid;
$contactstatic->lastname=$obj->lastname; $contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname; $contactstatic->firstname=$obj->firstname;
if ($obj->statut == 1){ if ($obj->statut == 1) {
if ($htmlname != 'none') if ($htmlname != 'none')
{ {
$disabled=0; $disabled=0;

View File

@ -1403,8 +1403,7 @@ class DoliDBSqlite3 extends DoliDB
$weekday=self::calc_weekday($first_daynr, !$monday_first); $weekday=self::calc_weekday($first_daynr, !$monday_first);
$calc_year=$year; $calc_year=$year;
if ($month == 1 && $day <= 7-$weekday) if ($month == 1 && $day <= 7-$weekday) {
{
if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4))) if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)))
return 0; return 0;
$week_year= 1; $week_year= 1;
@ -1415,16 +1414,13 @@ class DoliDBSqlite3 extends DoliDB
if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) { if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) {
$days= $daynr - ($first_daynr+ (7-$weekday)); $days= $daynr - ($first_daynr+ (7-$weekday));
} } else {
else {
$days= $daynr - ($first_daynr - $weekday); $days= $daynr - ($first_daynr - $weekday);
} }
if ($week_year && $days >= 52*7) if ($week_year && $days >= 52*7) {
{
$weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7; $weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7;
if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) {
{
$calc_year++; $calc_year++;
return 1; return 1;
} }

View File

@ -2367,13 +2367,16 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif (strtoupper($countrycode) == "MU") elseif (strtoupper($countrycode) == "MU")
{//Maurice {
//Maurice
if(dol_strlen($phone) == 11) if(dol_strlen($phone) == 11)
{//ex: +230_ABC_DE_FG {
//ex: +230_ABC_DE_FG
$newphone = substr($newphone,0,4).$separ.substr($newphone,4,3).$separ.substr($newphone,7,2).$separ.substr($newphone,9,2); $newphone = substr($newphone,0,4).$separ.substr($newphone,4,3).$separ.substr($newphone,7,2).$separ.substr($newphone,9,2);
} }
elseif(dol_strlen($phone) == 12) elseif(dol_strlen($phone) == 12)
{//ex: +230_ABCD_EF_GH {
//ex: +230_ABCD_EF_GH
$newphone = substr($newphone,0,4).$separ.substr($newphone,4,4).$separ.substr($newphone,8,2).$separ.substr($newphone,10,2); $newphone = substr($newphone,0,4).$separ.substr($newphone,4,4).$separ.substr($newphone,8,2).$separ.substr($newphone,10,2);
} }
} }
@ -2514,9 +2517,11 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif(strtoupper($countrycode) == "AU") elseif(strtoupper($countrycode) == "AU")
{//Australie {
//Australie
if(dol_strlen($phone) == 12) if(dol_strlen($phone) == 12)
{//ex: +61_A_BCDE_FGHI {
//ex: +61_A_BCDE_FGHI
$newphone = substr($newphone,0,3).$separ.substr($newphone,3,1).$separ.substr($newphone,4,4).$separ.substr($newphone,8,4); $newphone = substr($newphone,0,3).$separ.substr($newphone,3,1).$separ.substr($newphone,4,4).$separ.substr($newphone,8,4);
} }
} }

View File

@ -771,8 +771,7 @@ class pdf_einstein extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -831,8 +831,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -294,8 +294,9 @@ class doc_generic_contract_odt extends ModelePDFContract
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -1315,8 +1315,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
} }
} }
//}
} }
//}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -1377,8 +1377,8 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
} }
} }
//}
} }
//}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -130,7 +130,7 @@ class mod_arctic extends ModeleNumRefFicheinter
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
// On d<EFBFBD>fini critere recherche compteur // On défini critere recherche compteur
$mask=$conf->global->FICHINTER_ARTIC_MASK; $mask=$conf->global->FICHINTER_ARTIC_MASK;
if (! $mask) if (! $mask)

View File

@ -321,8 +321,9 @@ class doc_generic_product_odt extends ModelePDFProduct
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -321,8 +321,9 @@ class doc_generic_stock_odt extends ModelePDFStock
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -235,7 +235,10 @@ if ($permission) {
</form> </form>
<?php $i++; ?> <?php $i++; ?>
<?php } } ?> <?php
}
}
?>
</div> </div>
</div> </div>

View File

@ -21,8 +21,7 @@
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -67,13 +66,18 @@ $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize
?> ?>
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
<?php if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { <?php
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random' // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
?> ?>
<body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;"> <body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
<?php } else { ?> <?php
} else {
?>
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php } ?> <?php
}
?>
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -193,16 +193,19 @@ $coldisplay=-1; // We remove first td
&nbsp; &nbsp;
<?php } ?> <?php } ?>
</td> </td>
<?php <?php
if ($this->situation_cycle_ref) { if ($this->situation_cycle_ref) {
$coldisplay++; $coldisplay++;
print '<td class="nowrap right"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>'; print '<td class="nowrap right"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>';
} }
if (! empty($usemargins)) if (! empty($usemargins))
{ {
?> if (!empty($user->rights->margins->creer)) {
<?php if (!empty($user->rights->margins->creer)) { ?> ?>
<td class="margininfos right"><?php $coldisplay++; ?> <td class="margininfos right">
<?php
$coldisplay++;
?>
<!-- For predef product --> <!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select> <select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
@ -211,7 +214,8 @@ $coldisplay=-1; // We remove first td
<input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>"> <input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>">
</td> </td>
<?php } ?> <?php } ?>
<?php if ($user->rights->margins->creer) { <?php
if ($user->rights->margins->creer) {
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{ {
$margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx))); $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx)));
@ -234,7 +238,7 @@ $coldisplay=-1; // We remove first td
} }
} }
} }
?> ?>
<!-- colspan=4 for this td because it replace total_ht+3 td for buttons --> <!-- colspan=4 for this td because it replace total_ht+3 td for buttons -->
<td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=4; ?> <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=4; ?>

View File

@ -204,13 +204,15 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } ?> <?php } ?>
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> <td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { <?php
if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
} else echo '&nbsp;'; ?> } else echo '&nbsp;';
?>
</td> </td>
<?php <?php
@ -308,9 +310,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } else { ?> <?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td> <td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?> <?php } ?>
<?php } else { ?> <?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> <td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php } ?> <?php
}
?>
<?php if($action == 'selectlines'){ ?> <?php if($action == 'selectlines'){ ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?> <?php } ?>

View File

@ -206,8 +206,7 @@ class ActionsDatapolicy
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php'; require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
DataPolicy::sendMailDataPolicyContact($object); DataPolicy::sendMailDataPolicyContact($object);
} } elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
$object->fetch(GETPOST('id')); $object->fetch(GETPOST('id'));
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php'; require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';

View File

@ -48,7 +48,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td align="right"><?php <td align="right"><?php
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?> } ?>
</td> </td>
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td> <td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
</tr> </tr>

View File

@ -184,7 +184,7 @@ class Shipments extends DolibarrApi
*/ */
function post($request_data = null) function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) { if (! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
} }
// Check mandatory fields // Check mandatory fields
@ -259,7 +259,7 @@ class Shipments extends DolibarrApi
} }
$result = $this->shipment->fetch($id); $result = $this->shipment->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Shipment not found'); throw new RestException(404, 'Shipment not found');
} }
@ -317,12 +317,12 @@ class Shipments extends DolibarrApi
/* /*
function putLine($id, $lineid, $request_data = null) function putLine($id, $lineid, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) { if (! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->shipment->fetch($id); $result = $this->shipment->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Shipment not found'); throw new RestException(404, 'Shipment not found');
} }
@ -495,15 +495,15 @@ class Shipments extends DolibarrApi
*/ */
function validate($id, $notrigger = 0) function validate($id, $notrigger = 0)
{ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) { if (! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->shipment->fetch($id); $result = $this->shipment->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Shipment not found'); throw new RestException(404, 'Shipment not found');
} }
if( ! DolibarrApi::_checkAccessToResource('expedition',$this->shipment->id)) { if ( ! DolibarrApi::_checkAccessToResource('expedition',$this->shipment->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -515,11 +515,11 @@ class Shipments extends DolibarrApi
throw new RestException(500, 'Error when validating Shipment: '.$this->shipment->error); throw new RestException(500, 'Error when validating Shipment: '.$this->shipment->error);
} }
$result = $this->shipment->fetch($id); $result = $this->shipment->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Shipment not found'); throw new RestException(404, 'Shipment not found');
} }
if( ! DolibarrApi::_checkAccessToResource('expedition',$this->shipment->id)) { if ( ! DolibarrApi::_checkAccessToResource('expedition',$this->shipment->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }

View File

@ -188,8 +188,7 @@ if ($action == 'create' || empty($action))
$total = $expensereport->total_ttc; $total = $expensereport->total_ttc;
// autofill remainder amount // autofill remainder amount
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax)) {
{
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
//Add js for AutoFill //Add js for AutoFill
print ' $(document).ready(function () {'; print ' $(document).ready(function () {';
@ -197,8 +196,8 @@ if ($action == 'create' || empty($action))
var amount = $(this).data("value"); var amount = $(this).data("value");
document.getElementById($(this).data(\'rowid\')).value = amount ; document.getElementById($(this).data(\'rowid\')).value = amount ;
});'; });';
print ' });'."\n"; print "\t});\n";
print ' </script>'."\n"; print "</script>\n";
} }
print load_fiche_titre($langs->trans("DoPayment")); print load_fiche_titre($langs->trans("DoPayment"));

View File

@ -281,8 +281,7 @@ class Interventions extends DolibarrApi
if ($updateRes > 0) { if ($updateRes > 0) {
return $updateRes; return $updateRes;
} } else {
else {
throw new RestException(400, $this->fichinter->error); throw new RestException(400, $this->fichinter->error);
} }
} }

View File

@ -3082,17 +3082,19 @@ class CommandeFournisseur extends CommonOrder
} }
return 4; return 4;
} }
}elseif(! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) ) } elseif (! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) ) {
{//set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...) //set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...)
$close=0; $close=0;
if( count($diff_array) > 0 ) if( count($diff_array) > 0 )
{//there are some difference between the two arrays {
//there are some difference between the two arrays
//scan the array of results //scan the array of results
foreach($diff_array as $key => $value) foreach($diff_array as $key => $value)
{//if the quantity delivered is greater or equal to wish quantity {
//if the quantity delivered is greater or equal to wish quantity
if($qtydelivered[$key] >= $qtywished[$key] ) if($qtydelivered[$key] >= $qtywished[$key] )
{ {
$close++; $close++;
@ -3101,10 +3103,9 @@ class CommandeFournisseur extends CommonOrder
} }
if($close == count($diff_array)) if($close == count($diff_array)) {
{//all the products are received equal or more than the wished quantity //all the products are received equal or more than the wished quantity
if ($closeopenorder) if ($closeopenorder) {
{
$ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can' $ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) { if ($ret<0) {
return -1; return -1;
@ -3122,7 +3123,8 @@ class CommandeFournisseur extends CommonOrder
} }
} }
else else
{//all the products are not received {
//all the products are not received
$ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can' $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) { if ($ret<0) {
return -1; return -1;

View File

@ -3218,4 +3218,4 @@ class SupplierInvoiceLine extends CommonObjectLine
return -2; return -2;
} }
} }
} }

View File

@ -726,7 +726,7 @@ if ($id > 0 || ! empty($ref)) {
// modified by hook // modified by hook
if (empty($reshook)) if (empty($reshook))
{ {
if(empty($conf->reception->enabled)){ if (empty($conf->reception->enabled)){
print $langs->trans("Comment").' : '; print $langs->trans("Comment").' : ';
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="'; print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref); print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);

View File

@ -35,10 +35,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
/* /*
* Actions * Actions
*/ */
if($action=="update"){ if ($action=="update"){
$res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity); $res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity);
if ($res1 < 0) if ($res1 < 0) {
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors'); setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback(); $db->rollback();
} }

View File

@ -639,8 +639,7 @@ class MultiCurrency extends CommonObject
curl_close($ch); curl_close($ch);
$response = json_decode($response); $response = json_decode($response);
if ($response->success) if ($response->success) {
{
$TRate = $response->quotes; $TRate = $response->quotes;
$timestamp = $response->timestamp; $timestamp = $response->timestamp;

View File

@ -277,19 +277,19 @@ class PriceExpression
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -201,19 +201,19 @@ class PriceGlobalVariable
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -225,19 +225,19 @@ class PriceGlobalVariableUpdater
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -36,8 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled)) {
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }

View File

@ -217,28 +217,26 @@ class Projects extends DolibarrApi
*/ */
function getLines($id, $includetimespent = 0) function getLines($id, $includetimespent = 0)
{ {
if(! DolibarrApiAccess::$user->rights->projet->lire) { if (! DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->project->fetch($id); $result = $this->project->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Project not found'); throw new RestException(404, 'Project not found');
} }
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { if ( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$this->project->getLinesArray(DolibarrApiAccess::$user); $this->project->getLinesArray(DolibarrApiAccess::$user);
$result = array(); $result = array();
foreach ($this->project->lines as $line) // $line is a task foreach ($this->project->lines as $line) {
{ // $line is a task
if ($includetimespent == 1) if ($includetimespent == 1) {
{
$timespent = $line->getSummaryOfTimeSpent(0); $timespent = $line->getSummaryOfTimeSpent(0);
} }
if ($includetimespent == 1) if ($includetimespent == 1) {
{
// TODO // TODO
// Add class for timespent records and loop and fill $line->lines with records of timespent // Add class for timespent records and loop and fill $line->lines with records of timespent
} }
@ -262,16 +260,16 @@ class Projects extends DolibarrApi
{ {
global $db; global $db;
if(! DolibarrApiAccess::$user->rights->projet->lire) { if (! DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->project->fetch($id); $result = $this->project->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Project not found'); throw new RestException(404, 'Project not found');
} }
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { if ( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -425,7 +423,7 @@ class Projects extends DolibarrApi
*/ */
function put($id, $request_data = null) function put($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->projet->creer) { if (! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401); throw new RestException(401);
} }
@ -434,7 +432,7 @@ class Projects extends DolibarrApi
throw new RestException(404, 'Project not found'); throw new RestException(404, 'Project not found');
} }
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { if ( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
foreach($request_data as $field => $value) { foreach($request_data as $field => $value) {
@ -442,7 +440,7 @@ class Projects extends DolibarrApi
$this->project->$field = $value; $this->project->$field = $value;
} }
if($this->project->update(DolibarrApiAccess::$user) >= 0) if ($this->project->update(DolibarrApiAccess::$user) >= 0)
{ {
return $this->get($id); return $this->get($id);
} }
@ -461,19 +459,19 @@ class Projects extends DolibarrApi
*/ */
function delete($id) function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->projet->supprimer) { if (! DolibarrApiAccess::$user->rights->projet->supprimer) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->project->fetch($id); $result = $this->project->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Project not found'); throw new RestException(404, 'Project not found');
} }
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { if ( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
if( ! $this->project->delete(DolibarrApiAccess::$user)) { if ( ! $this->project->delete(DolibarrApiAccess::$user)) {
throw new RestException(500, 'Error when delete project : '.$this->project->error); throw new RestException(500, 'Error when delete project : '.$this->project->error);
} }

View File

@ -190,7 +190,7 @@ class Tasks extends DolibarrApi
*/ */
function post($request_data = null) function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->projet->creer) { if (! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
} }
// Check mandatory fields // Check mandatory fields
@ -429,7 +429,7 @@ class Tasks extends DolibarrApi
*/ */
function put($id, $request_data = null) function put($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->projet->creer) { if (! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401); throw new RestException(401);
} }
@ -507,8 +507,6 @@ class Tasks extends DolibarrApi
*/ */
function addTimeSpent($id, $date, $duration, $user_id = 0, $note = '') function addTimeSpent($id, $date, $duration, $user_id = 0, $note = '')
{ {
if( ! DolibarrApiAccess::$user->rights->projet->creer) { if( ! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401); throw new RestException(401);
} }

View File

@ -116,7 +116,10 @@ if ($this->control->tpl['fournisseur']) {
<td><?php echo $langs->trans('SupplierCategory'); ?></td> <td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td> <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr> </tr>
<?php } }?> <?php
}
}
?>
<?php if (! empty($conf->barcode->enabled)) { ?> <?php if (! empty($conf->barcode->enabled)) { ?>
<tr> <tr>

View File

@ -113,7 +113,10 @@ if ($this->control->tpl['fournisseur']) {
<td><?php echo $langs->trans('SupplierCategory'); ?></td> <td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td> <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr> </tr>
<?php } }?> <?php
}
}
?>
<?php if (! empty($conf->barcode->enabled)) { ?> <?php if (! empty($conf->barcode->enabled)) { ?>
<tr> <tr>

View File

@ -2011,7 +2011,6 @@ class Societe extends CommonObject
$name=$this->name?$this->name:$this->nom; $name=$this->name?$this->name:$this->nom;
if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){ if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){
if(empty($option) && $this->client > 0) $option = 'customer'; if(empty($option) && $this->client > 0) $option = 'customer';
if(empty($option) && $this->fournisseur > 0) $option = 'supplier'; if(empty($option) && $this->fournisseur > 0) $option = 'supplier';
} }

View File

@ -457,16 +457,15 @@ $num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected=is_array($toselect)?$toselect:array();
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all != '' || $search_cti != '') && $action != 'list') if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all != '' || $search_cti != '') && $action != 'list') {
{
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$id = $obj->rowid; $id = $obj->rowid;
if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){ if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) {
if( $obj->client > 0) { if ( $obj->client > 0) {
header("Location: ".DOL_URL_ROOT.'/comm/card.php?socid='.$id); header("Location: ".DOL_URL_ROOT.'/comm/card.php?socid='.$id);
exit; exit;
} }
if( $obj->fournisseur > 0){ if ( $obj->fournisseur > 0){
header("Location: ".DOL_URL_ROOT.'/fourn/card.php?socid='.$id); header("Location: ".DOL_URL_ROOT.'/fourn/card.php?socid='.$id);
exit; exit;
} }

View File

@ -453,10 +453,9 @@ if ($conf->global->TAKEPOSCONNECTOR){
$hookmanager->initHooks(array('takeposfrontend')); $hookmanager->initHooks(array('takeposfrontend'));
$reshook=$hookmanager->executeHooks('ActionButtons'); $reshook=$hookmanager->executeHooks('ActionButtons');
if (!empty($reshook)) if (!empty($reshook)) {
{
$menus[$r++]=$reshook; $menus[$r++]=$reshook;
} }
?> ?>
<div class="div3"> <div class="div3">
@ -498,17 +497,17 @@ foreach($menus as $menu) {
<?php <?php
$count=0; $count=0;
while ($count<32) while ($count<32)
{ {
?> ?>
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>> <div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="95%" id='proimg<?php echo $count;?>'/> <img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="95%" id='proimg<?php echo $count;?>'/>
<div class='description'> <div class='description'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div> <div class='description_content' id='prodesc<?php echo $count;?>'></div>
</div> </div>
</div> </div>
<?php <?php
$count++; $count++;
} }
?> ?>
</div> </div>
</div> </div>

View File

@ -599,7 +599,8 @@ if (! empty($id) || ! empty($ref))
<td><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>"> <td><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>">
<input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td> <input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td>
</tr> </tr>
<?php if ($object->isProduct()) { <?php
if ($object->isProduct()) {
print '<tr>'; print '<tr>';
print '<td><label for="weight_impact">'.$langs->trans('WeightImpact').'</label></td>'; print '<td><label for="weight_impact">'.$langs->trans('WeightImpact').'</label></td>';
print '<td><input type="text" id="weight_impact" name="weight_impact" value="'.price($weight_impact).'"></td>'; print '<td><input type="text" id="weight_impact" name="weight_impact" value="'.price($weight_impact).'"></td>';