diff --git a/.gitignore b/.gitignore index 3748a6ef1b8..3ec764dec5b 100755 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ doxygen_warnings.log /.project .DS_Store .idea +*.iml diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index ba2a80cfa7d..524e6c04e7a 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -536,8 +536,8 @@ if ($rowid) print ''.$langs->trans("Firstname").''.$object->firstname.' '; print ''; - // EMail - print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; + // EMail + print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; // Status print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 344bf615f56..733e8cfdf74 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1504,7 +1504,7 @@ class Adherent extends CommonObject $langs->load("dict"); $code=$this->civilite_id; - return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); + return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } /** @@ -1531,11 +1531,11 @@ class Adherent extends CommonObject $lien = ''; $lienfin=''; } - if ($option == 'category') - { - $lien = ''; - $lienfin=''; - } + if ($option == 'category') + { + $lien = ''; + $lienfin=''; + } $picto='user'; $label=$langs->trans("ShowMember"); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index c4c62d8285f..1e70df2da8d 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -49,8 +49,8 @@ $backtopage=GETPOST('backtopage','alpha'); $confirm=GETPOST('confirm','alpha'); $rowid=GETPOST('rowid','int'); $typeid=GETPOST('typeid','int'); -$userid=GETPOST('userid','int'); -$socid=GETPOST('socid','int'); +$userid=GETPOST('userid','int'); +$socid=GETPOST('socid','int'); if (! empty($conf->mailmanspip->enabled)) { @@ -249,16 +249,16 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; $morphy=$morphy=$_POST["morphy"];; - if ($morphy != 'mor' && empty($lastname)) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; - } - if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; - } + if ($morphy != 'mor' && empty($lastname)) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; + } + if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; + } // Create new object if ($result > 0 && ! $error) @@ -383,7 +383,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) else { setEventMessage($object->mesgs, 'mesgs'); - } + } } $rowid=$object->id; @@ -715,7 +715,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Adherent($db); $result=$object->fetch($rowid); - if ($result <= 0) dol_print_error('',$object->error); + if ($result <= 0) dol_print_error('',$object->error); } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template @@ -1409,8 +1409,8 @@ else // Firstname print ''.$langs->trans("Firstname").''.$object->firstname.' '; - // EMail - print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; + // EMail + print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 7c1cc07ad69..b84350528d4 100755 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -44,7 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); +$langs->load("members"); $langs->load("companies"); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 38a47555706..090e414c548 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -23,9 +23,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); +$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); $mapratio = 0.5; $graphheight = round($graphwidth * $mapratio); @@ -44,7 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); +$langs->load("members"); $langs->load("companies"); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 7ca24d5bd4f..6d0fcf6bb9e 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -46,8 +46,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); -$langs->load("companies"); +$langs->load("members"); +$langs->load("companies"); /* diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index d5bdedc01d5..31d313b84e9 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -347,7 +347,7 @@ foreach($boxtoadd as $box) print ''; print ''; print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print ''; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 726bd912964..41a3f02838d 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -84,11 +84,11 @@ print '
'; print $langs->trans("ClickToDialUrlDesc").'
'; print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; -//if (! empty($user->clicktodial_url)) -//{ - print '
'; - print info_admin($langs->trans("ValueOverwrittenByUserSetup")); -//} +//if (! empty($user->clicktodial_url)) +//{ + print '
'; + print info_admin($langs->trans("ValueOverwrittenByUserSetup")); +//} print ''; @@ -113,9 +113,9 @@ if (! empty($conf->global->CLICKTODIAL_URL)) print ''; $setupcomplete=1; - if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; - if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; - if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; + if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; + if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; + if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; if ($setupcomplete) { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 391b399ceaa..bc586140250 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -44,8 +44,8 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); $type = 'order'; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 4f7f0729472..5da3ad27183 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -40,8 +40,8 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); $type='invoice'; @@ -158,19 +158,19 @@ else if ($action == 'del') // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->FACTURE_ADDON_PDF = $value; - } - - // On active le modele - $ret = delDocumentModel($value, $type); - if ($ret > 0) - { - $ret = addDocumentModel($value, $type, $label, $scandir); - } + if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->FACTURE_ADDON_PDF = $value; + } + + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } else if ($action == 'setmod') diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index c6e2819f5d7..bbb2c60e51f 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -23,8 +23,8 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("admin"); @@ -48,18 +48,18 @@ if (isset($title)) -print ''; -print ''; -print "\n"; - +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print ''; +print "\n"; + $var=false; -// Recupere la version de l'OS -$phpversion=version_php(); -print "\n"; +// Recupere la version de l'OS +$phpversion=version_php(); +print "\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Version")."".$phpversion."
'.$langs->trans("Version")."".$phpversion."
'; -print '
'; +print '
'; diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 3d9ebbd1d29..980bd9ef4bb 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -52,27 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(0,'priority'); -print ' - - - - - +print '
'.$langs->trans("File").''.$langs->trans("Active").' 
+ + + + + '; - -$var=True; -foreach ($triggers as $trigger) -{ - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("File").''.$langs->trans("Active").' 
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''.$form->textwithpicto('', $trigger['info']).'
'; + +$var=True; +foreach ($triggers as $trigger) +{ + $var=!$var; + print ''; + print ''.$trigger['picto'].''; + print ''.$trigger['file'].''; + print ''.$trigger['status'].''; + print ''.$form->textwithpicto('', $trigger['info']).''; + print ''; +} + +print ''; llxFooter(); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 19e8b1a9f5d..50950506778 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -379,7 +379,7 @@ class Categorie { if ($this->id == -1) return -2; if ($type == 'company') $type='societe'; - if ($type == 'fournisseur') $type='societe'; + if ($type == 'fournisseur') $type='societe'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$type.")"; $sql .= " VALUES (".$this->id.", ".$obj->id.")"; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 4e9f376977c..bd293f9febb 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -127,7 +127,7 @@ else print ' '; //print ''; print ''; -print '

'; +print '

'; // Charge tableau des categories diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 36ed1bd4ded..3cdb5d516f1 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -36,7 +36,7 @@ $ref=GETPOST('ref'); $type=GETPOST('type'); $action=GETPOST('action'); $confirm=GETPOST('confirm'); -$removeelem = GETPOST('removeelem','int'); +$removeelem = GETPOST('removeelem','int'); if ($id == "") { @@ -62,39 +62,39 @@ $type=$object->type; * Actions */ -// Remove element from category -if ($id > 0 && $removeelem > 0) -{ - if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) - { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $tmpobject = new Product($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'product'; - } - if ($type==1 && $user->rights->societe->creer) - { - $tmpobject = new Societe($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'fournisseur'; - } - if ($type==2 && $user->rights->societe->creer) - { - $tmpobject = new Societe($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'societe'; - } - if ($type == 3 && $user->rights->adherent->creer) +// Remove element from category +if ($id > 0 && $removeelem > 0) +{ + if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) { - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $tmpobject = new Adherent($db); - $result = $tmpobject->fetch($removeelem); + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $tmpobject = new Product($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'product'; + } + if ($type==1 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'fournisseur'; + } + if ($type==2 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'societe'; + } + if ($type == 3 && $user->rights->adherent->creer) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $tmpobject = new Adherent($db); + $result = $tmpobject->fetch($removeelem); $elementtype = 'member'; - } - + } + $result=$object->del_type($tmpobject,$elementtype); - if ($result < 0) dol_print_error('',$object->error); -} + if ($result < 0) dol_print_error('',$object->error); +} if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confirm == 'yes') { @@ -312,21 +312,21 @@ if ($object->type == 1) print ''; print $soc->getNomUrl(1,'category_supplier'); print "\n"; - // Link to delete from category - print ''; - $typeid=$object->type; - $permission=0; - if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); - if ($typeid == 1) $permission=$user->rights->societe->creer; - if ($typeid == 2) $permission=$user->rights->societe->creer; - if ($typeid == 3) $permission=$user->rights->adherent->creer; - if ($permission) - { - print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; - } - print ''; + // Link to delete from category + print ''; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print ''; print "\n"; } @@ -364,20 +364,20 @@ if($object->type == 2) print ''; print $soc->getNomUrl(1,'category'); print "\n"; - // Link to delete from category - print ''; - $typeid=$object->type; - $permission=0; - if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); - if ($typeid == 1) $permission=$user->rights->societe->creer; - if ($typeid == 2) $permission=$user->rights->societe->creer; - if ($typeid == 3) $permission=$user->rights->adherent->creer; - if ($permission) - { - print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; - } + // Link to delete from category + print ''; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } print ''; print "\n"; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bb30efe8ef9..f4bb4542843 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -334,7 +334,7 @@ class ActionComm extends CommonObject $this->priority = $obj->priority; $this->fulldayevent = $obj->fulldayevent; $this->location = $obj->location; - $this->transparency = $obj->transparency; + $this->transparency = $obj->transparency; $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->societe->id = $obj->fk_soc; @@ -476,7 +476,7 @@ class ActionComm extends CommonObject $sql.= ", priority = '".$this->priority."'"; $sql.= ", fulldayevent = '".$this->fulldayevent."'"; $sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null"); - $sql.= ", transparency = '".$this->transparency."'"; + $sql.= ", transparency = '".$this->transparency."'"; $sql.= ", fk_user_mod = '".$user->id."'"; $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 4b438786d56..94a6e276a89 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -523,8 +523,8 @@ if ($action == 'create') // Busy print ''.$langs->trans("Busy").''; - print ''; - print ''; + print ''; + print ''; // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) @@ -764,13 +764,13 @@ if ($id > 0) print ''; // Busy - print ''.$langs->trans("Busy").''; + print ''.$langs->trans("Busy").''; print 'transparency?' checked="checked"':'').'">'; - print ''; - + print ''; + // Realised by - if ($conf->global->AGENDA_ENABLE_DONEBY) - { + if ($conf->global->AGENDA_ENABLE_DONEBY) + { print ''.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index fd9df1ea848..f95842884bb 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -76,7 +76,7 @@ $pid=GETPOST("projectid","int",3); $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); if (GETPOST('viewcal')) { $action='show_month'; $day=''; @@ -1014,17 +1014,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa { // Define color index if not yet defined $idusertouse=($event->usertodo->id?$event->usertodo->id:0); - if (isset($colorindexused[$idusertouse])) - { - $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user - } - else - { - $colorindex=$nextindextouse; - $colorindexused[$idusertouse]=$colorindex; - if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color - } - //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; + if (isset($colorindexused[$idusertouse])) + { + $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user + } + else + { + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; + if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color + } + //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; // Define color $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index fbc76d402e1..f32fa89b59b 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -249,7 +249,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } -print '
'; +print '
'; $NBMAX=3; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 08b0e150227..dfb84f5a01d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -375,7 +375,7 @@ if ($object->fetch($id) >= 0) if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname); if ($search_email) $param.= "&search_email=".urlencode($search_email); - $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; + $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,''); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c8d0bfeebde..db8dd255b6c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1797,10 +1797,10 @@ class Propal extends CommonObject $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.fk_statut = c.id"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } if ($socid) $sql.= " AND s.rowid = ".$socid; if ($draft) $sql.= " AND p.fk_statut = 0"; if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 54ddc846272..34584c7f99e 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 508f9a70fc6..edfbb35f5cd 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2026,19 +2026,19 @@ class Commande extends CommonOrder { $obj = $this->db->fetch_object($result); - if ($shortlist == 1) - { - $ga[$obj->cid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->cid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; + if ($shortlist == 1) + { + $ga[$obj->cid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->cid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; } $i++; } diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 56c69d84541..40714e98811 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index a02dff6b868..5c9edf478e1 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -35,10 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 402dbeda095..dbe67212f37 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $action=GETPOST('action'); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 2224627cd94..a5e6605ad85 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -23,10 +23,10 @@ */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (!$user->rights->banque->lire) accessforbidden(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index e14b3e92df6..672e1363d3e 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -24,10 +24,10 @@ */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index ab589e89001..94370d699e6 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -112,8 +112,8 @@ llxHeader(); print_fiche_titre($langs->trans("Rubriques")); -print '
'; -print ''; +print ''; +print ''; print ''; print ''; @@ -160,7 +160,7 @@ if ($result) $db->free($result); } -print ""; +print ""; /* * Line to add category @@ -176,7 +176,7 @@ if ($action != 'edit') print "
"; -print ""; +print ""; llxFooter(); diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index daee366ebdb..407a5398dc5 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $action=GETPOST("action"); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 932acf5dcb5..3954edf99ee 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -27,12 +27,12 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); -$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); +$langs->load("banks"); +$langs->load("categories"); + +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); // Security check if (isset($_GET["account"]) || isset($_GET["ref"])) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 344231cea5d..51b7a4dc818 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index a4a871cec93..a5a0cdf1677 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -24,10 +24,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index da28602314a..29a47a60e9b 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); if (! $user->rights->banque->consolidate) accessforbidden(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 2d9ac9cd86e..b62ea51118c 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -25,16 +25,16 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $langs->load("bills"); @@ -82,14 +82,14 @@ $pagenext = $page + 1; llxHeader(); $form = new Form($db); -$societestatic=new Societe($db); -$chargestatic=new ChargeSociales($db); -$memberstatic=new Adherent($db); -$paymentstatic=new Paiement($db); -$paymentsupplierstatic=new PaiementFourn($db); -$paymentvatstatic=new TVA($db); -$bankstatic=new Account($db); -$banklinestatic=new AccountLine($db); +$societestatic=new Societe($db); +$chargestatic=new ChargeSociales($db); +$memberstatic=new Adherent($db); +$paymentstatic=new Paiement($db); +$paymentsupplierstatic=new PaiementFourn($db); +$paymentvatstatic=new TVA($db); +$bankstatic=new Account($db); +$banklinestatic=new AccountLine($db); // Load account @@ -332,59 +332,59 @@ else if ($links[$key]['type']=='payment') { $paymentstatic->id=$links[$key]['url_id']; - $paymentstatic->ref=$langs->trans("Payment"); + $paymentstatic->ref=$langs->trans("Payment"); print ' '.$paymentstatic->getNomUrl(1); $newline=0; } elseif ($links[$key]['type']=='payment_supplier') { - $paymentsupplierstatic->id=$links[$key]['url_id']; - $paymentsupplierstatic->ref=$langs->trans("Payment");; + $paymentsupplierstatic->id=$links[$key]['url_id']; + $paymentsupplierstatic->ref=$langs->trans("Payment");; print ' '.$paymentsupplierstatic->getNomUrl(1); $newline=0; } elseif ($links[$key]['type']=='payment_sc') { - print ''; - print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; - print $langs->trans("SocialContributionPayment"); - print ''; + print ''; + print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; + print $langs->trans("SocialContributionPayment"); + print ''; $newline=0; } - elseif ($links[$key]['type']=='payment_vat') - { - $paymentvatstatic->id=$links[$key]['url_id']; - $paymentvatstatic->ref=$langs->trans("Payment"); - print ' '.$paymentvatstatic->getNomUrl(2); - } + elseif ($links[$key]['type']=='payment_vat') + { + $paymentvatstatic->id=$links[$key]['url_id']; + $paymentvatstatic->ref=$langs->trans("Payment"); + print ' '.$paymentvatstatic->getNomUrl(2); + } elseif ($links[$key]['type']=='banktransfert') { - // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. - if ($objp->amount > 0) - { - $banklinestatic->fetch($links[$key]['url_id']); - $bankstatic->id=$banklinestatic->fk_account; - $bankstatic->label=$banklinestatic->bank_account_label; - print ' ('.$langs->trans("from").' '; - print $bankstatic->getNomUrl(1,'transactions'); - print ' '.$langs->trans("toward").' '; - $bankstatic->id=$objp->bankid; - $bankstatic->label=$objp->bankref; - print $bankstatic->getNomUrl(1,''); - print ')'; - } - else - { - $bankstatic->id=$objp->bankid; - $bankstatic->label=$objp->bankref; - print ' ('.$langs->trans("from").' '; - print $bankstatic->getNomUrl(1,''); - print ' '.$langs->trans("toward").' '; - $banklinestatic->fetch($links[$key]['url_id']); - $bankstatic->id=$banklinestatic->fk_account; - $bankstatic->label=$banklinestatic->bank_account_label; - print $bankstatic->getNomUrl(1,'transactions'); - print ')'; - } + // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. + if ($objp->amount > 0) + { + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + print ' ('.$langs->trans("from").' '; + print $bankstatic->getNomUrl(1,'transactions'); + print ' '.$langs->trans("toward").' '; + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + print $bankstatic->getNomUrl(1,''); + print ')'; + } + else + { + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + print ' ('.$langs->trans("from").' '; + print $bankstatic->getNomUrl(1,''); + print ' '.$langs->trans("toward").' '; + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + print $bankstatic->getNomUrl(1,'transactions'); + print ')'; + } } elseif ($links[$key]['type']=='company') { print ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index bdfda680d6d..ea7d29beb0f 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -27,8 +27,8 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; $langs->load("banks"); $langs->load("categories"); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 91f05a2fdaa..af7078421a2 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index f770c5bc371..bea66e6a47d 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (! $user->rights->banque->transfer) accessforbidden(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index eade2e3c13d..d6c1465937f 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -205,7 +205,7 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print '
'; +print '
'; // Show filter box diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 250605f386b..3663e71ffde 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2687,7 +2687,7 @@ else if ($id > 0 || ! empty($ref)) print $formconfirm; - + // Invoice content diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c45e52bec39..bd0bbaf121e 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2660,77 +2660,77 @@ class Facture extends CommonInvoice } - /** - * Return list of invoices (eventually filtered on a user) into an array - * - * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) - * @param int $draft 0=not draft, 1=draft - * @param User $excluser Objet user to exclude - * @param int $socid Id third pary - * @param int $limit For pagination - * @param int $offset For pagination - * @param string $sortfield Sort criteria - * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK - */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') - { - global $conf,$user; - - $ga = array(); - - $sql = "SELECT s.rowid, s.nom as name, s.client,"; - $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } - if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($draft) $sql.= " AND f.fk_statut = 0"; - if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; - $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit,$offset); - - $result=$this->db->query($sql); - if ($result) - { - $numc = $this->db->num_rows($result); - if ($numc) - { - $i = 0; - while ($i < $numc) - { - $obj = $this->db->fetch_object($result); - - if ($shortlist == 1) - { - $ga[$obj->fid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->fid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; - } - $i++; - } - } - return $ga; - } - else - { - dol_print_error($this->db); - return -1; - } + /** + * Return list of invoices (eventually filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Objet user to exclude + * @param int $socid Id third pary + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return int -1 if KO, array with result if OK + */ + function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + { + global $conf,$user; + + $ga = array(); + + $sql = "SELECT s.rowid, s.nom as name, s.client,"; + $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } + if ($socid) $sql.= " AND s.rowid = ".$socid; + if ($draft) $sql.= " AND f.fk_statut = 0"; + if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; + $sql.= $this->db->order($sortfield,$sortorder); + $sql.= $this->db->plimit($limit,$offset); + + $result=$this->db->query($sql); + if ($result) + { + $numc = $this->db->num_rows($result); + if ($numc) + { + $i = 0; + while ($i < $numc) + { + $obj = $this->db->fetch_object($result); + + if ($shortlist == 1) + { + $ga[$obj->fid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->fid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; + } + $i++; + } + } + return $ga; + } + else + { + dol_print_error($this->db); + return -1; + } } @@ -3121,7 +3121,7 @@ class Facture extends CommonInvoice $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; } - $this->revenuestamp = 0; + $this->revenuestamp = 0; // Add a line "offered" $line=new FactureLigne($this->db); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 4abff5b63be..ffdc17e0e63 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -54,8 +54,8 @@ $endyear=$year; * View */ -$langs->load("bills"); -$langs->load("companies"); +$langs->load("bills"); +$langs->load("companies"); $form=new Form($db); diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 8a24ab3ce29..3251b4a1ab6 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -29,9 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); $langs->load('bills'); $langs->load('companies'); $langs->load('compta'); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index cfde42a5cf3..80ea9ea6817 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -26,9 +26,9 @@ require('../../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php index 8370bd95551..705bc15eb88 100644 --- a/htdocs/compta/paiement/cheque/liste.php +++ b/htdocs/compta/paiement/cheque/liste.php @@ -26,9 +26,9 @@ require('../../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e5dd9e60ea4..7ef5f44fb88 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -392,7 +392,7 @@ class Paiement extends CommonObject $this->error='Bad value for parameter accountid'; dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR); return -1; - } + } $this->db->begin(); diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php index 89b40e095bc..b1bcbb3d04b 100644 --- a/htdocs/compta/prelevement/bon.php +++ b/htdocs/compta/prelevement/bon.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $langs->load("categories"); diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index ce33322d03a..8f2d336defe 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); // Security check diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index f9d770111a7..ddf8a988b48 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); $langs->load("companies"); $langs->load("bills"); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 3012a70bd55..3ae2b850aac 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -28,10 +28,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index ec8eaa51479..115a7829374 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $langs->load('withdrawals'); $langs->load('bills'); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index c77a0ab6682..87516c3ad65 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load('withdrawals'); $langs->load('bills'); diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 161df078aae..5fcd70b1a9b 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -27,11 +27,11 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$langs->load("withdrawals"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); +$langs->load("withdrawals"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index a7ebf00c950..22af3b3548d 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (!$user->rights->prelevement->bons->lire) accessforbidden(); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index d3823cc130e..56a7529fd9a 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); // Security check diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 28358dc75f5..54aaf02841a 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 445f1e66755..c322142b6a9 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index d3d8634d64a..cd09dc6cf25 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -26,9 +26,9 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); $langs->load("withdrawals"); $langs->load("companies"); $langs->load("categories"); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index b33a5fd2455..5744ab0eb7b 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -28,10 +28,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 34ffdb168b5..418d733dbd4 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index a31b4030b65..f36fd0be5a5 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -41,7 +41,7 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -$tva = new Tva($db); +$tva = new Tva($db); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('taxvatcard')); @@ -54,7 +54,7 @@ $hookmanager->initHooks(array('taxvatcard')); if ($_POST["cancel"] == $langs->trans("Cancel")) { - header("Location: reglement.php"); + header("Location: reglement.php"); exit; } @@ -231,9 +231,9 @@ if ($id) print $vatpayment->ref; print ''; - // Label - print ''.$langs->trans("Label").''.$vatpayment->label.''; - + // Label + print ''.$langs->trans("Label").''.$vatpayment->label.''; + print ""; print ''.$langs->trans("DatePayment").''; print dol_print_date($vatpayment->datep,'day'); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fb1ce97fd01..90bd7861435 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1009,13 +1009,13 @@ class Contact extends CommonObject $this->country = 'France'; $this->email = 'specimen@specimen.com'; - $this->phone_pro = '0909090901'; - $this->phone_perso = '0909090902'; - $this->phone_mobile = '0909090903'; - $this->fax = '0909090909'; + $this->phone_pro = '0909090901'; + $this->phone_perso = '0909090902'; + $this->phone_mobile = '0909090903'; + $this->fax = '0909090909'; - $this->note_public='This is a comment (public)'; - $this->note_private='This is a comment (private)'; + $this->note_public='This is a comment (public)'; + $this->note_private='This is a comment (private)'; $socid = rand(1, $num_socs); $this->socid = $socids[$socid]; diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index c876c67fe01..27a56b48825 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $action = GETPOST('action'); @@ -66,7 +66,7 @@ else if ($action == 'setnote_private' && $user->rights->societe->creer) * View */ -$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $form = new Form($db); @@ -90,68 +90,68 @@ if ($id > 0) print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Name - print ''; - print ''; - - // Company - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - if ($object->socid > 0) - { - $objsoc = new Societe($db); - $objsoc->fetch($object->socid); - - print ''; - } - - else - { - print ''; - } - } - - // Civility - print ''; - - // Date To Birth - print ''; - if (! empty($object->birthday)) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - - print ''; - } - else - { - print '"; - } - print ""; + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Name + print ''; + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + if ($object->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($object->socid); + + print ''; + } + + else + { + print ''; + } + } + + // Civility + print ''; + + // Date To Birth + print ''; + if (! empty($object->birthday)) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + print ''; + } + else + { + print '"; + } + print ""; print "
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback); - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print '
'.$langs->trans("UserTitle").''; - print $object->getCivilityLabel(); - print '
'.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); - - print '   '; - //var_dump($birthdatearray); - $ageyear=convertSecondToTime($now-$object->birthday,'year')-1970; - $agemonth=convertSecondToTime($now-$object->birthday,'month')-1; - if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; - else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; - else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; - - - print '   -   '; - if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); - else print $langs->trans("BirthdayAlertOff"); - print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown")."
'.$langs->trans("Ref").''; + print $form->showrefnav($object, 'id', $linkback); + print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print '
'.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print '
'.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); + + print '   '; + //var_dump($birthdatearray); + $ageyear=convertSecondToTime($now-$object->birthday,'year')-1970; + $agemonth=convertSecondToTime($now-$object->birthday,'month')-1; + if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; + else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; + else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; + + + print '   -   '; + if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); + else print $langs->trans("BirthdayAlertOff"); + print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown")."
"; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index ad0da9451e9..d0b59b67dd7 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -42,21 +42,21 @@ class box_activity extends ModeleBoxes var $info_box_contents = array(); - /** - * Constructor - * - * @param DoliDB $db Database handler - * @param string $param More parameters - */ - function __construct($db,$param) - { - global $conf; - - $this->db=$db; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. // FIXME: Removed number_format (not compatible with all languages) // FIXME: Pb into some status - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) } /** diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 3ec5add8a05..5bce26306f3 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -39,18 +39,18 @@ class box_graph_invoices_permonth extends ModeleBoxes var $info_box_contents = array(); - /** - * Constructor - * - * @param DoliDB $db Database handler - * @param string $param More parameters - */ - function __construct($db,$param) + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) { global $conf; - - $this->db=$db; - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; + + $this->db=$db; + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2cbf113b362..419174a31dc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -81,24 +81,24 @@ abstract class CommonObject return dol_trunc($ret,$maxlen); } - /** - * Return full address of contact - * - * @param int $withcountry 1=Add country into address string - * @param string $sep Separator to use to build string - * @return string Full address string - */ - function getFullAddress($withcountry=0,$sep="\n") - { - if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) - { - require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; - $tmparray=getCountry($this->country_id,'all'); - $this->country_code=$tmparray['code']; - $this->country =$tmparray['label']; - } + /** + * Return full address of contact + * + * @param int $withcountry 1=Add country into address string + * @param string $sep Separator to use to build string + * @return string Full address string + */ + function getFullAddress($withcountry=0,$sep="\n") + { + if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) + { + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + $tmparray=getCountry($this->country_id,'all'); + $this->country_code=$tmparray['code']; + $this->country =$tmparray['label']; + } - return dol_format_address($this, $withcountry, $sep); + return dol_format_address($this, $withcountry, $sep); } /** diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index a7a8fe04903..4ce1bbf8c3d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -63,11 +63,11 @@ class Conf //! Used to store list of entities to use for each element public $entities = array(); - public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url - public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url - public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone - public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone - public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url + public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url + public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url + public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone + public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone + public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url /** diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 58c7063e40a..43722bb59f2 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -166,8 +166,8 @@ class HookManager } } - if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); - if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; + if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; } // Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6501dd94ef8..d68d9c8d59f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -702,13 +702,13 @@ class Form $selected_input_value=$product->ref; } ======= - if ($selected && empty($selected_input_value)) - { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $product = new Product($this->db); - $product->fetch($selected); - $selected_input_value=$product->ref; - } + if ($selected && empty($selected_input_value)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($this->db); + $product->fetch($selected); + $selected_input_value=$product->ref; + } >>>>>>> refs/remotes/origin/3.3 // mode=1 means customers products $ajaxoptions=array(); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b7477c203f5..ef8422a7dbc 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -230,7 +230,7 @@ class FormActions //asort($arraylist); if ($selected == 'manual') $selected='AC_OTH'; - if ($selected == 'auto') $selected='AC_OTH_AUTO'; + if ($selected == 'auto') $selected='AC_OTH_AUTO'; print $form->selectarray($htmlname, $arraylist, $selected); if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5d2fbf4f225..f8f2503c9a7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -383,18 +383,18 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - -// Keep this. Used for test with jmobile -/*print ' -
- -
-';*/ + +// Keep this. Used for test with jmobile +/*print ' +
+ +
+';*/ if (empty($noform)) $out.= '
'; $out.= ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c2d3a7c32c2..f5def186abb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -945,30 +945,30 @@ class FormOther if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();'; print ' - jQuery("#left, #right").sortable({ - /* placeholder: \'ui-state-highlight\', */ - handle: \'.boxhandle\', - revert: \'invalid\', - items: \'.box\', - containment: \'.fiche\', - connectWith: \'.connectedSortable\', - stop: function(event, ui) { - updateBoxOrder(0); - } + jQuery("#left, #right").sortable({ + /* placeholder: \'ui-state-highlight\', */ + handle: \'.boxhandle\', + revert: \'invalid\', + items: \'.box\', + containment: \'.fiche\', + connectWith: \'.connectedSortable\', + stop: function(event, ui) { + updateBoxOrder(0); + } }); - jQuery(".boxclose").click(function() { - var self = this; // because JQuery can modify this + jQuery(".boxclose").click(function() { + var self = this; // because JQuery can modify this var boxid=self.id.substring(8); - var label=jQuery(\'#boxlabelentry\'+boxid).val(); + var label=jQuery(\'#boxlabelentry\'+boxid).val(); jQuery(\'#boxto_\'+boxid).remove(); if (boxid > 0) jQuery(\'#boxcombo\').append(new Option(label, boxid)); - updateBoxOrder(1); - }); + updateBoxOrder(1); + }); - });'."\n"; + });'."\n"; - print ''."\n"; + print ''."\n"; } $nbboxactivated=count($boxidactivatedforuser); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index d399256dc0e..98c1ee909fc 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -300,7 +300,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $sqlmodified++; } - if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); + if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); $result=$db->query($newsql,$usesavepoint); if ($result) @@ -1078,9 +1078,9 @@ function form_constantes($tableau,$strictw3c=0) } if ($const == 'ADHERENT_MAILMAN_LISTS') { - print '. '.$langs->trans("Example").': '.img_down().'
'; + print '. '.$langs->trans("Example").': '.img_down().'
'; print '