diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index af1c7c88698..d076e77bf44 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -368,20 +368,20 @@ foreach ($dirmodels as $reldir) { if (file_exists($dir.'/'.$file)) { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + $name = substr($file, 4, dol_strlen($file) - 16); + $classname = substr($file, 0, dol_strlen($file) - 12); require_once $dir.'/'.$file; $module = new $classname($db); - $modulequalified=1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + $modulequalified = 1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; if ($modulequalified) { print ''; - print (empty($module->name)?$name:$module->name); + print (empty($module->name) ? $name : $module->name); print "\n"; if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index cc2edb550a0..51f6c1fd720 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -240,9 +240,9 @@ dol_syslog("select rss boxes", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { - $boxlist = InfoBox::listBoxes($db, 'activated', -1, null); - $num = $db->num_rows($resql); - $i = 0; + $boxlist = InfoBox::listBoxes($db, 'activated', -1, null); + $num = $db->num_rows($resql); + $i = 0; while ($i < $num) { @@ -350,9 +350,9 @@ $db->close(); */ function _isInBoxList($idrss, array $boxlist) { - foreach($boxlist as $box) + foreach ($boxlist as $box) { - if($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false) + if ($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false) { return true; } diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 99643401386..0455fb961ae 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -48,19 +48,19 @@ $action = GETPOST('action', 'aZ09'); if ($action == 'update' || $action == 'add') { $constlineid = GETPOST('rowid', 'int'); - $constname=GETPOST('constname', 'alpha'); + $constname = GETPOST('constname', 'alpha'); - $constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); - $consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); - $constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); + $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); + $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; - $res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); + $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); - if (! $res > 0) $error++; + if (!$res > 0) $error++; - if (! $error) + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } @@ -183,7 +183,7 @@ $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents(); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Editing global variables not related to a specific theme - $constantes=array(); + $constantes = array(); foreach ($listofnotifiedevents as $notifiedevent) { $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; @@ -210,7 +210,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { $constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label); } - $helptext=''; + $helptext = ''; form_constantes($constantes, 0, $helptext); } else { print ''; diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 945a0efdf46..ec7a6b89596 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1426,7 +1426,7 @@ class Setup extends DolibarrApi throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK'); } - if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || ! isset($conf->global->$constantname)) { + if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) { throw new RestException(500, 'Error Bad or unknown value for constantname'); } if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) { diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 56be39a8ad0..bfb0c7d073a 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -202,7 +202,7 @@ class AssetType extends CommonObject $action = 'update'; // Actions on extra fields - if (! $error) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/blockedlog/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index ab91d772288..936ad5edb9c 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -44,26 +44,26 @@ $signature = GETPOST('s'); $newblock = GETPOST('b'); $hash = GETPOST('h'); -if($auth->fetch(0, $signature)<=0) { +if ($auth->fetch(0, $signature) <= 0) { $auth->signature = $signature; $auth->create($user); } -if(!empty($hash)) { +if (!empty($hash)) { echo $auth->checkBlockchain($hash) ? 'hashisok' : 'hashisjunk'; } -elseif(!empty($newblock)){ - if($auth->checkBlock($newblock)) { +elseif (!empty($newblock)) { + if ($auth->checkBlock($newblock)) { $auth->addBlock($newblock); $auth->update($user); echo 'blockadded'; } - else{ + else { echo 'blockalreadyadded'; } } -else{ +else { echo 'idontunderstandwhatihavetodo'; } diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php index a082d4a1003..d6b8ebf9a7c 100644 --- a/htdocs/bom/tpl/linkedobjectblock.tpl.php +++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php @@ -42,7 +42,7 @@ $ilink = 0; foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; - $product_static= new Product($db); + $product_static = new Product($db); $trclass = 'oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total'; echo ''; diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index c8a7e09a9df..3c4a4dd6c7a 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -32,23 +32,23 @@ * View */ -$form=new Form($db); +$form = new Form($db); // Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled) -if ( GETPOST('filtre', 'alpha') ) { +if (GETPOST('filtre', 'alpha')) { // Avec filtre - $ret=array(); $i=0; + $ret = array(); $i = 0; $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type"; - if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; - $sql.= " WHERE p.entity IN (".getEntity('product').")"; - $sql.= " AND p.tosell = 1"; - if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; - $sql.= " AND ("; - $sql.= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'"; - if (! empty($conf->barcode->enabled)) + if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel"; + $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; + if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + $sql .= " WHERE p.entity IN (".getEntity('product').")"; + $sql .= " AND p.tosell = 1"; + if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0"; + $sql .= " AND ("; + $sql .= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'"; + if (!empty($conf->barcode->enabled)) { $filtre = GETPOST('filtre', 'alpha'); @@ -85,23 +85,23 @@ if ( GETPOST('filtre', 'alpha') ) { { dol_print_error($db); } - $tab_designations=$ret; + $tab_designations = $ret; } else { // Sans filtre - $ret=array(); - $i=0; + $ret = array(); + $i = 0; $sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type"; - if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; - $sql.= " WHERE p.entity IN (".getEntity('product').")"; - $sql.= " AND p.tosell = 1"; - if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; - $sql.= " ORDER BY p.label"; + if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel"; + $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; + if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + $sql .= " WHERE p.entity IN (".getEntity('product').")"; + $sql .= " AND p.tosell = 1"; + if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0"; + $sql .= " ORDER BY p.label"; dol_syslog($sql); - $resql=$db->query($sql); + $resql = $db->query($sql); if ($resql) { $nbr_enreg = $db->num_rows($resql); diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index ea5efee7ebf..4e4e302d439 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -40,20 +40,20 @@ top_httphead(); //print ''."\n"; // Load original field value -if (! empty($output) && isset($amount) && isset($tva_tx)) +if (!empty($output) && isset($amount) && isset($tva_tx)) { - $return=array(); - $price=''; + $return = array(); + $price = ''; if (is_numeric($amount) && $amount != '') { if ($output == 'price_ttc') { - $price = price2num($amount * (1 + ($tva_tx/100)), 'MU'); + $price = price2num($amount * (1 + ($tva_tx / 100)), 'MU'); $return['price_ht'] = $amount; $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : ''); } elseif ($output == 'price_ht') { - $price = price2num($amount / (1 + ($tva_tx/100)), 'MU'); + $price = price2num($amount / (1 + ($tva_tx / 100)), 'MU'); $return['price_ht'] = (isset($price) && $price != '' ? price($price) : ''); $return['price_ttc'] = ($tva_tx == 0 ? $price : $amount); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7804f7a304f..70e4ab1520c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7130,7 +7130,7 @@ abstract class CommonObject // HTML, select, integer and text add default value if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int'))) { - if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$key]; + if ($action == 'create') $value = $extrafields->attributes[$this->table_element]['default'][$key]; else $value = $this->array_options['options_'.$key]; } diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 7c5f72e12c6..f921e8ad638 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -732,7 +732,7 @@ class dolReceiptPrinter extends Printer break; case 'DOL_PRINT_ORDER_LINES': foreach ($object->lines as $line) { - if ($line->special_code==$this->orderprinter) + if ($line->special_code == $this->orderprinter) { $spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1; $spaces = str_repeat(' ', $spacestoadd); diff --git a/htdocs/core/class/extralanguages.class.php b/htdocs/core/class/extralanguages.class.php index 8ae1fd0a4c7..71a6fa8c1aa 100644 --- a/htdocs/core/class/extralanguages.class.php +++ b/htdocs/core/class/extralanguages.class.php @@ -90,15 +90,15 @@ class ExtraLanguages $array_name_label = array(); - if (! empty($conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR)) { + if (!empty($conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR)) { $tmpelement = explode(';', $conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR); - foreach($tmpelement as $elementstring) { - $reg=array(); + foreach ($tmpelement as $elementstring) { + $reg = array(); preg_match('/^(.*):(.*)$/', $elementstring, $reg); $element = $reg[1]; $array_name_label[$element] = array(); - $tmpfields=explode(',', $reg[2]); - foreach($tmpfields as $field) { + $tmpfields = explode(',', $reg[2]); + foreach ($tmpfields as $field) { //var_dump($fields); //$tmpkeyvar = explode(':', $fields); //$array_name_label[$element][$tmpkeyvar[0]] = $tmpkeyvar[1]; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b19a75135aa..b06877c8c3b 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -203,7 +203,7 @@ class FormActions if ($typeelement == 'project') $projectid = $object->id; $newcardbutton = ''; - if (!empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) + if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage)); } diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 8375e5f6770..921b3d14bb6 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -275,7 +275,7 @@ if (is_array($search_groupby) && count($search_groupby)) { if (class_exists($classname)) { $tmpobject = new $classname($db); $tmpobject->fetch($obj->val); - foreach($tmpobject->fields as $fieldkey => $field) { + foreach ($tmpobject->fields as $fieldkey => $field) { if ($field['showoncombobox']) { $valuetranslated = $tmpobject->$fieldkey; //if ($valuetranslated == '-') $valuetranslated = $langs->transnoentitiesnoconv("Unknown") @@ -747,7 +747,7 @@ if ($mode == 'graph') { $px1->draw($filenamenb, $fileurlnb); $texttoshow = $langs->trans("NoRecordFound"); - if (! GETPOSTISSET('search_measures') || ! GETPOSTISSET('search_xaxis')) { + if (!GETPOSTISSET('search_measures') || !GETPOSTISSET('search_xaxis')) { $texttoshow = $langs->trans("SelectYourGraphOptionsFirst"); } diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index ba1ed6bb8a0..a301ac40a2b 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -42,24 +42,24 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l function dol_setcache($memoryid, $data) { global $conf; - $result=0; + $result = 0; // Using a memcached server - if (! empty($conf->memcached->enabled) && class_exists('Memcached')) + if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { global $dolmemcache; - if (empty($dolmemcache) || ! is_object($dolmemcache)) + if (empty($dolmemcache) || !is_object($dolmemcache)) { - $dolmemcache=new Memcached(); - $tmparray=explode(':', $conf->global->MEMCACHED_SERVER); - $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - if (! $result) return -1; + $dolmemcache = new Memcached(); + $tmparray = explode(':', $conf->global->MEMCACHED_SERVER); + $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211); + if (!$result) return -1; } - $memoryid=session_name().'_'.$memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); - $dolmemcache->add($memoryid, $data); // This fails if key already exists - $rescode=$dolmemcache->getResultCode(); + $dolmemcache->add($memoryid, $data); // This fails if key already exists + $rescode = $dolmemcache->getResultCode(); if ($rescode == 0) { return count($data); @@ -69,20 +69,20 @@ function dol_setcache($memoryid, $data) return -$rescode; } } - elseif (! empty($conf->memcached->enabled) && class_exists('Memcache')) + elseif (!empty($conf->memcached->enabled) && class_exists('Memcache')) { global $dolmemcache; - if (empty($dolmemcache) || ! is_object($dolmemcache)) + if (empty($dolmemcache) || !is_object($dolmemcache)) { - $dolmemcache=new Memcache(); - $tmparray=explode(':', $conf->global->MEMCACHED_SERVER); - $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - if (! $result) return -1; + $dolmemcache = new Memcache(); + $tmparray = explode(':', $conf->global->MEMCACHED_SERVER); + $result = $dolmemcache->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211); + if (!$result) return -1; } - $memoryid=session_name().'_'.$memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); - $result=$dolmemcache->add($memoryid, $data); // This fails if key already exists + $result = $dolmemcache->add($memoryid, $data); // This fails if key already exists if ($result) { return count($data); @@ -112,22 +112,22 @@ function dol_getcache($memoryid) global $conf; // Using a memcached server - if (! empty($conf->memcached->enabled) && class_exists('Memcached')) + if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { global $m; - if (empty($m) || ! is_object($m)) + if (empty($m) || !is_object($m)) { - $m=new Memcached(); - $tmparray=explode(':', $conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - if (! $result) return -1; + $m = new Memcached(); + $tmparray = explode(':', $conf->global->MEMCACHED_SERVER); + $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211); + if (!$result) return -1; } - $memoryid=session_name().'_'.$memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); //print "Get memoryid=".$memoryid; - $data=$m->get($memoryid); - $rescode=$m->getResultCode(); + $data = $m->get($memoryid); + $rescode = $m->getResultCode(); //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
"; //var_dump($data); if ($rescode == 0) @@ -139,20 +139,20 @@ function dol_getcache($memoryid) return -$rescode; } } - elseif (! empty($conf->memcached->enabled) && class_exists('Memcache')) + elseif (!empty($conf->memcached->enabled) && class_exists('Memcache')) { global $m; - if (empty($m) || ! is_object($m)) + if (empty($m) || !is_object($m)) { - $m=new Memcache(); - $tmparray=explode(':', $conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - if (! $result) return -1; + $m = new Memcache(); + $tmparray = explode(':', $conf->global->MEMCACHED_SERVER); + $result = $m->addServer($tmparray[0], $tmparray[1] ? $tmparray[1] : 11211); + if (!$result) return -1; } - $memoryid=session_name().'_'.$memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); - $data=$m->get($memoryid); + $data = $m->get($memoryid); //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
"; //var_dump($data); if ($data) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b8b458c4b2a..1fb4e33a6c6 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -174,7 +174,7 @@ class CommActionRapport $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right - $nbpage = $this->_pages($pdf, $outputlangs); // Write content + $nbpage = $this->_pages($pdf, $outputlangs); // Write content if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); $pdf->Close(); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 1a8f13ea1af..2e0733f1ba2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -214,14 +214,14 @@ class pdf_rouget extends ModelePdfExpedition $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); - if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { - $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/"; + $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { - $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; + $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index cf6bc12b9a1..3a66a8ae961 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -354,12 +354,12 @@ class pdf_standard extends ModeleExpenseReport // Loop on each lines $i = 0; while ($i < $nblines) { - $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage + $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); if (empty($showpricebeforepagebreak)) { - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. } else { $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. } @@ -385,8 +385,8 @@ class pdf_standard extends ModeleExpenseReport $pdf->setPage($pageposafter + 1); $showpricebeforepagebreak = 1; $nexY = $tab_top_newpage; - $nexY += ($pdf->getFontSize() * 1.3); // Passe espace entre les lignes - $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage + $nexY += ($pdf->getFontSize() * 1.3); // Passe espace entre les lignes + $pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index dcb6cc33a96..1310aec4ccb 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -356,7 +356,7 @@ class pdf_crabe extends ModelePDFFactures if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); // Set certificate - $cert=empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT; + $cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT; // If use has no certificate, we try to take the company one if (!$cert) { $cert = empty($conf->global->CERTIFICATE_CRT) ? '' : $conf->global->CERTIFICATE_CRT; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 85392dd21fa..de32e84d43a 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -462,39 +462,39 @@ class ImportCsv extends ModeleImports $errorforthistable++; $error++; }*/ - $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. + $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } call_user_func_array(array($classinstance, $method), $param_array); // If not found, try the fetch from label - if (! ($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeorlabel') + if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } - $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]=$classinstance->id; + $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id; //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') // id may be 0, it is a found value { - $newval=$classinstance->id; + $newval = $classinstance->id; } else { - if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); - elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); - else $this->errors[$error]['lib']='ErrorBadDefinitionOfImportProfile'; - $this->errors[$error]['type']='FOREIGNKEY'; + if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); + elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); + else $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; + $this->errors[$error]['type'] = 'FOREIGNKEY'; $errorforthistable++; $error++; } } } } - elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeandlabel') + elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeandlabel') { - $isidorref='id'; - if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i', $newval)) $isidorref='ref'; - $newval=preg_replace('/^(id|ref):/i', '', $newval); + $isidorref = 'id'; + if (!is_numeric($newval) && $newval != '' && !preg_match('/^id:/i', $newval)) $isidorref = 'ref'; + $newval = preg_replace('/^(id|ref):/i', '', $newval); if ($isidorref == 'ref') { $file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']); diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 78055abf5d3..624311c74f0 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -348,8 +348,8 @@ class modFournisseur extends DolibarrModules $tmp = ''; $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $var=array_keys($tmpparam['options']); - $tmp=array_shift($var); + $var = array_keys($tmpparam['options']); + $tmp = array_shift($var); } if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 2ad05c19fe9..78ed97cd295 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -51,17 +51,17 @@ class modLabel extends DolibarrModules // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto='generic'; + $this->picto = 'generic'; // Data directories to create when module is enabled $this->dirs = array("/label/temp"); // Dependencies - $this->hidden = false; // A condition to hide module - $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled - $this->requiredby = array(); // List of module ids to disable if this one is disabled - $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5,4); // Minimum version of PHP required by module + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5, 4); // Minimum version of PHP required by module // Config pages // $this->config_page_url = array("label.php"); diff --git a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php index 6595223083e..4f435bb2106 100644 --- a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php +++ b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php @@ -53,7 +53,7 @@ $(document).ready(function(){ }); - var $dialog = $('') + var $dialog = $('') .load( page + " #tablelines", function() { $("#" + formId + " #tablelines").prop("id", "ajaxloaded_tablelines"); // change id attribute diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 97612645b7d..32f6e67cb00 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -70,14 +70,14 @@ if ($action == 'delete') ); } -$formfile=new FormFile($db); +$formfile = new FormFile($db); // We define var to enable the feature to add prefix of uploaded files. // Caller of this include can make // $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; if (!isset($savingdocmask) || !empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) { - $savingdocmask=''; + $savingdocmask = ''; if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) { //var_dump($modulepart); if (in_array($modulepart, array( diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 28b6c6f0dbd..8849020b885 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -284,7 +284,7 @@ if ($line->special_code == 3) { ?> { $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); - if (! $senderissupplier && is_object($object->thirdparty)) { + if (!$senderissupplier && is_object($object->thirdparty)) { if ($object->thirdparty->useLocalTax(1)) { if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); else $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 3ef5a12d720..74c254d395f 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -117,15 +117,15 @@ class ActionsDatapolicy $object->state_id = ''; $object->skype = ''; $object->country_id = ''; - $object->note_private = $object->note_private . '
' . $langs->trans('ANONYMISER_AT', dol_print_date(time())); + $object->note_private = $object->note_private.'
'.$langs->trans('ANONYMISER_AT', dol_print_date(time())); if ($object->update($object->id, $user, 0)) { // On supprime les contacts associé - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "socpeople WHERE fk_soc = " . $object->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$object->id; $this->db->query($sql); setEventMessages($langs->trans('ANONYMISER_SUCCESS'), array()); - header('Location:' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id); + header('Location:'.$_SERVER["PHP_SELF"]."?socid=".$object->id); } } } elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'datapolicy_portabilite') { @@ -394,40 +394,40 @@ class ActionsDatapolicy if ($parameters['currentcontext'] == 'thirdpartycard') { if (GETPOST('action') == 'create' || GETPOST('action') == 'edit' || GETPOST('action') == '') { $jsscript .= ''; } elseif (GETPOST('action') == 'confirm_delete' && GETPOST('confirm') == 'yes' && GETPOST('socid') > 0) { // La suppression n'a pas été possible - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $societe = new Societe($this->db); $societe->fetch(GETPOST('socid')); // On vérifie si il est utilisé if ((in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $societe->typent_id == 8) && $societe->isObjectUsed(GETPOST('socid'))) { - require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $form = new Form($this->db); - echo $form->formconfirm($_SERVER["PHP_SELF"] . "?socid=" . GETPOST('socid'), substr($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE"), 0, strlen($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE")) - 2), $langs->trans("DATAPOLICIES_POPUP_ANONYME_TEXTE"), 'anonymiser', '', '', 1); + echo $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".GETPOST('socid'), substr($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE"), 0, strlen($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE")) - 2), $langs->trans("DATAPOLICIES_POPUP_ANONYME_TEXTE"), 'anonymiser', '', '', 1); } } if (GETPOST('socid')) { - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $societe = new Societe($this->db); $societe->fetch(GETPOST('socid')); if (!in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) && $societe->typent_id != 8) { - require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $jsscript .= ''; } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b6bc5b15a91..e653ab5d3ca 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1046,7 +1046,7 @@ class Expedition extends CommonObject } } $line->entrepot_id = $linebatch->entrepot_id; - $line->origin_line_id = $dbatch['ix_l']; // deprecated + $line->origin_line_id = $dbatch['ix_l']; // deprecated $line->fk_origin_line = $dbatch['ix_l']; $line->qty = $dbatch['qty']; $line->detail_batch = $tab; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 139d87162c6..1f20965fab3 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -490,16 +490,16 @@ class SupplierInvoices extends DolibarrApi */ public function getLines($id) { - if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); } $result = $this->invoice->fetch($id); - if( ! $result ) { + if (!$result) { throw new RestException(404, 'Supplier invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } $this->invoice->fetch_lines(); @@ -522,16 +522,16 @@ class SupplierInvoices extends DolibarrApi */ public function postLine($id, $request_data = null) { - if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); } $result = $this->invoice->fetch($id); - if( ! $result ) { + if (!$result) { throw new RestException(404, 'Supplier invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } $request_data = (object) $request_data; @@ -586,16 +586,16 @@ class SupplierInvoices extends DolibarrApi */ public function putLine($id, $lineid, $request_data = null) { - if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); } $result = $this->invoice->fetch($id); - if( ! $result ) { + if (!$result) { throw new RestException(404, 'Supplier invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } $request_data = (object) $request_data; @@ -647,20 +647,20 @@ class SupplierInvoices extends DolibarrApi */ public function deleteLine($id, $lineid) { - if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); } $result = $this->invoice->fetch($id); - if( ! $result ) { + if (!$result) { throw new RestException(404, 'Supplier invoice not found'); } - if(empty($lineid)) { + if (empty($lineid)) { throw new RestException(400, 'Line ID is mandatory'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { + if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index b809a9fcd37..19ea5880346 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -211,9 +211,9 @@ class CommandeFournisseurDispatch extends CommonObject } // Create extrafields - if (! $error) + if (!$error) { - $result=$this->insertExtraFields(); + $result = $this->insertExtraFields(); if ($result < 0) $error++; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index ce2de03a762..7bc56994fdb 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -977,9 +977,9 @@ class FactureFournisseur extends CommonInvoice } } - if (! $error) + if (!$error) { - $result=$this->insertExtraFields(); + $result = $this->insertExtraFields(); if ($result < 0) { $error++; @@ -3150,9 +3150,9 @@ class SupplierInvoiceLine extends CommonObjectLine $this->deleteObjectLinked(); // Remove extrafields - if (! $error) + if (!$error) { - $result=$this->deleteExtraFields(); + $result = $this->deleteExtraFields(); if ($result < 0) { $error++; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 9d81bca42ce..a5e6b9d3377 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -566,21 +566,21 @@ if (!$error && $db->connected && $action == "set") $error++; } - if (! $error) + if (!$error) { if ($db->connected) { $resultbis = 1; // Create user - $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); + $result = $db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); // Create user bis if ($databasefortest == 'mysql') { - if (! in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local'))) + if (!in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local'))) { - $resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); + $resultbis = $db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); } } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 86dd2f128e3..6533b4bfe54 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2351,7 +2351,7 @@ function main_area($title = '') if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); // Permit to add user company information on each printed document by set SHOW_SOCINFO_ON_PRINT - if (! empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) + if (!empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) { global $hookmanager; $hookmanager->initHooks(array('showsocinfoonprint')); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 336c6b85fa4..e8dd338f4cd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4737,7 +4737,7 @@ class Product extends CommonObject $op[1] = "-".trim($nbpiece); $movementstock = new MouvementStock($this->db); - $movementstock->setOrigin($origin_element, $origin_id); // Set ->origin and ->origin->id + $movementstock->setOrigin($origin_element, $origin_id); // Set ->origin and ->origin->id $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode); if ($result >= 0) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 54b70528f9b..7cc5d3966c1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -780,33 +780,33 @@ SCRIPT; if (empty($rowid)) { foreach ($extralabels as $key => $value) { if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) { - if(!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); + if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); print 'attributes["product_fournisseur_price"]['required'][$key] ? ' class="fieldrequired"' : '').'>'; if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) print $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); else print $langs->trans($value); - print ''; + print ''; } } } else { $sql = "SELECT"; $sql .= " fk_object"; foreach ($extralabels as $key => $value) { - $sql .= ", " . $key; + $sql .= ", ".$key; } - $sql .= " FROM " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields"; - $sql .= " WHERE fk_object = " . $rowid; + $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields"; + $sql .= " WHERE fk_object = ".$rowid; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); foreach ($extralabels as $key => $value) { if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) { - if(!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); + if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); print 'attributes["product_fournisseur_price"]['required'][$key] ? ' class="fieldrequired"' : '').'>'; if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) print $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); else print $langs->trans($value); - print ''; } @@ -912,7 +912,7 @@ SCRIPT; foreach ($extralabels as $key => $value) { // Show field if not hidden if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { - if(!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); + if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); else $extratitle = $langs->trans($value); print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 9f764f7d412..510a6469482 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -112,7 +112,7 @@ class Entrepot extends CommonObject /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( + public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), @@ -184,7 +184,7 @@ class Entrepot extends CommonObject $error = 0; - if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility + if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility $this->label = trim($this->label); if ($this->label == '') diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 06d3e46728f..15b92c83acc 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -97,11 +97,11 @@ $fieldstosearchall = array( ); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all", 'alpha')); -$search=array(); -foreach($object->fields as $key => $val) +$search_all = trim(GETPOST("search_all", 'alpha')); +$search = array(); +foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key]=GETPOST('search_'.$key, 'alpha'); + if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha'); } // Definition of fields for list @@ -110,7 +110,7 @@ $arrayfields = array( 'estimatedvalue'=>array('type'=>'float', 'label'=>'EstimatedStockValue', 'enabled'=>1, 'visible'=>-2, 'position'=>71), 'estimatedstockvaluesell'=>array('type'=>'float', 'label'=>'EstimatedStockValueSell', 'enabled'=>1, 'visible'=>-2, 'position'=>72), ); -foreach($object->fields as $key => $val) +foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); @@ -241,20 +241,20 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql.= " GROUP BY "; -foreach($object->fields as $key => $val) +$sql .= " GROUP BY "; +foreach ($object->fields as $key => $val) { - $sql.='t.'.$key.', '; + $sql .= 't.'.$key.', '; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql=preg_replace('/,\s*$/', '', $sql); +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); $totalnboflines = 0; $result = $db->query($sql); if ($result) @@ -408,7 +408,7 @@ print ''; foreach ($object->fields as $key => $val) { - if($key == 'statut'){ continue; } + if ($key == 'statut') { continue; } $cssforfield = (empty($val['css']) ? '' : $val['css']); if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -421,7 +421,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0 || strpos($val['type'], 'sellist:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -466,7 +466,7 @@ print ''; foreach ($object->fields as $key => $val) { - if($key == 'statut'){ continue; } + if ($key == 'statut') { continue; } $cssforfield = (empty($val['css']) ? '' : $val['css']); if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -525,7 +525,7 @@ if ($num) $warehouse->fk_parent = $obj->fk_parent; $warehouse->statut = $obj->statut; - foreach ($object->fields as $key => $val){ + foreach ($object->fields as $key => $val) { $warehouse->{$key} = $obj->{$key}; } @@ -535,7 +535,7 @@ if ($num) foreach ($warehouse->fields as $key => $val) { - if($key == 'statut'){ continue; } + if ($key == 'statut') { continue; } $cssforfield = (empty($val['css']) ? '' : $val['css']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -562,7 +562,7 @@ if ($num) // Stock qty if (!empty($arrayfields["stockqty"]['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'stockqty'; } @@ -599,7 +599,7 @@ if ($num) // Status if (!empty($arrayfields['t.statut']['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index df6d5b3a13f..3d6903065ab 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -116,7 +116,7 @@ if ($resql) $listofoppstatus[$objp->rowid] = $objp->percent; $listofopplabel[$objp->rowid] = $objp->label; $listofoppcode[$objp->rowid] = $objp->code; - switch($objp->code) { + switch ($objp->code) { case 'PROSP': $colorseries[$objp->rowid] = "-".$badgeStatus0; break; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 26b00bae2a9..6f60904c67b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -713,7 +713,7 @@ while ($i < min($num, $limit)) $object->public = $obj->public; $object->ref = $obj->ref; $object->datee = $db->jdate($obj->date_end); - $object->statut = $obj->status; // deprecated + $object->statut = $obj->status; // deprecated $object->status = $obj->status; $object->public = $obj->public; $object->opp_status = $obj->fk_opp_status; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 8a3bb00e765..4291cb6f834 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -111,54 +111,54 @@ $user = new User($db); $user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS); $user->getrights(); -if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabled) && is_object($mc)) +if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled) && is_object($mc)) { $sql = "SELECT entity"; - $sql.= " FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql.= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'"; + $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; + $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'"; - dol_syslog(get_class($db) . "::fetch", LOG_DEBUG); + dol_syslog(get_class($db)."::fetch", LOG_DEBUG); $result = $db->query($sql); if ($result) { if ($db->num_rows($result)) { $obj = $db->fetch_object($result); - $key=$obj->entity; + $key = $obj->entity; } else { - $key=1; + $key = 1; } } else { - $key=1; + $key = 1; } - $ret=$mc->switchEntity($key); - if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; - if (! $res) die("Include of main fails"); + $ret = $mc->switchEntity($key); + if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; + if (!$res) die("Include of main fails"); } // list of action -$stripe=new Stripe($db); +$stripe = new Stripe($db); // Subject $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; -if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; dol_syslog("***** Stripe IPN was called with event->type = ".$event->type); if ($event->type == 'payout.created') { - $error=0; + $error = 0; - $result=dolibarr_set_const($db, $service."_NEXTPAYOUT", date('Y-m-d H:i:s', $event->data->object->arrival_date), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", date('Y-m-d H:i:s', $event->data->object->arrival_date), 'chaine', 0, '', $conf->entity); if ($result > 0) { $subject = $societeName.' - [NOTIFICATION] Stripe payout scheduled'; if (!empty($user->email)) { - $sendto = dolGetFirstLastname($user->firstname, $user->lastname) . " <".$user->email.">"; + $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; } else { $sendto = $conf->global->MAIN_INFO_SOCIETE_MAIL.'" <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index b4e5d0633c7..dbf6e4b9e29 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -306,9 +306,9 @@ class Reception extends CommonObject } // Create extrafields - if (! $error) + if (!$error) { - $result=$this->insertExtraFields(); + $result = $this->insertExtraFields(); if ($result < 0) $error++; } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index fd89ba5dd2d..fd6e7a3ec95 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -58,7 +58,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $filtre = GETPOST("filtre", 'none'); -if (! GETPOST('typeid', 'int')) +if (!GETPOST('typeid', 'int')) { $newfiltre = str_replace('filtre=', '', $filtre); $filterarray = explode('-', $newfiltre); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c35b17fe4fa..62140ba5d89 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3623,7 +3623,7 @@ class Societe extends CommonObject $this->phone = $member->phone; // Prof phone $this->email = $member->email; $this->socialnetworks = $member->socialnetworks; - $this->entity=$member->entity; + $this->entity = $member->entity; $this->client = 1; // A member is a customer by default $this->code_client = ($customercode ? $customercode : -1); diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index c12526bbe85..7e5b6aaf531 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -66,87 +66,87 @@ if (!file_exists($conffile)) // Load conf file if it is already defined -if (! defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > 8) // Test on filesize is to ensure that conf file is more that an empty template with just 8) // Test on filesize is to ensure that conf file is more that an empty template with just global->MAIN_LOGTOHTML = 1; // Define prefix -if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; -define('MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:'')); +if (!isset($dolibarr_main_db_prefix) || !$dolibarr_main_db_prefix) $dolibarr_main_db_prefix = 'llx_'; +define('MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : '')); -define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir -define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root)?$dolibarr_main_data_root:'')); -define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root)?$dolibarr_main_url_root:'')); // URL relative root -$uri=preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* -$suburi = strstr($uri, '/'); // $suburi contains url without domain -if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now '' -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) +define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir +define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root : '')); +define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root : '')); // URL relative root +$uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* +$suburi = strstr($uri, '/'); // $suburi contains url without domain +if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now '' +define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) -if (empty($character_set_client)) $character_set_client="UTF-8"; -$conf->file->character_set_client=strtoupper($character_set_client); -if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set=($conf->db->type=='mysql'?'latin1':''); // Old installation -$conf->db->character_set=$dolibarr_main_db_character_set; -if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation=($conf->db->type=='mysql'?'latin1_swedish_ci':''); // Old installation -$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation; -if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0; +if (empty($character_set_client)) $character_set_client = "UTF-8"; +$conf->file->character_set_client = strtoupper($character_set_client); +if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type == 'mysql' ? 'latin1' : ''); // Old installation +$conf->db->character_set = $dolibarr_main_db_character_set; +if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type == 'mysql' ? 'latin1_swedish_ci' : ''); // Old installation +$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation; +if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption = 0; $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption; -if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey=''; +if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey = ''; $conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey; -if (empty($conf->db->user)) $conf->db->user=''; +if (empty($conf->db->user)) $conf->db->user = ''; // Defini objet langs diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 24061a9e949..5d06973abf6 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -294,9 +294,9 @@ print ''."\n"; //print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS; $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r"; -$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" -$sql .= " AND r.entity = " . $entity; -if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled +$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" +$sql .= " AND r.entity = ".$entity; +if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled $sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id"; $result = $db->query($sql);
'.$extrafields->showInputField($key, GETPOSTISSET('options_' . $key) ? $extrafield_values['options_' . $key] : '', '', '', '', '', 0, 'product_fournisseur_price').'
'.$extrafields->showInputField($key, GETPOSTISSET('options_'.$key) ? $extrafield_values['options_'.$key] : '', '', '', '', '', 0, 'product_fournisseur_price').'
'.$extrafields->showInputField($key, GETPOSTISSET('options_' . $key) ? $extrafield_values['options_' . $key] : $obj->{$key}, '', '', '', '', 0, 'product_fournisseur_price'); + print ''.$extrafields->showInputField($key, GETPOSTISSET('options_'.$key) ? $extrafield_values['options_'.$key] : $obj->{$key}, '', '', '', '', 0, 'product_fournisseur_price'); print '
' . price2num($obj->stockqty, 5) . ''.price2num($obj->stockqty, 5).'' . $warehouse->LibStatut($obj->statut, 5) . ''.$warehouse->LibStatut($obj->statut, 5).'