diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 2bed305783a..cfb7372308a 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -138,7 +138,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''; print ''; print ''.$langs->trans("AdherentLoginRequired").''; - print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?$conf->global->ADHERENT_LOGIN_NOT_REQUIRED:1),1); + print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); print ''; print ''; print "\n"; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index fd9df1ea848..705c7d6ff1c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -753,7 +753,9 @@ if (empty($action) || $action == 'show_month') // View by month $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewcal=1'; echo ''; echo ' '; $i=0; @@ -824,7 +826,9 @@ elseif ($action == 'show_week') // View by week $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewweek=1'; echo '
'; echo ' '; $i=0; @@ -878,6 +882,8 @@ else // View by day $newparam=$param; // newparam is for birthday links $newparam=preg_replace('/action=show_month&?/i','',$newparam); $newparam=preg_replace('/action=show_week&?/i','',$newparam); + $newparam=preg_replace('/viewday=[0-9]+&?/i','',$newparam); + $newparam.='&viewday=1'; // Code to show just one day $style='cal_current_month'; $today=0; @@ -944,6 +950,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $theme_datacolor; global $cachethirdparties, $cachecontacts, $colorindexused; + print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print '
'; @@ -951,7 +958,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; if ($showinfo) print dol_print_date($curtime,'daytext'); else print dol_print_date($curtime,'%d'); @@ -959,6 +965,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; - if ($object->statut == 0) + if ($allowaddtarget) { print '
'; print ''; @@ -326,7 +328,7 @@ if ($object->fetch($id) >= 0) print ''; print '
'; - if ($object->statut == 0) print ''; + if ($allowaddtarget) print ''; print "\n"; } @@ -349,13 +351,6 @@ if ($object->fetch($id) >= 0) } // List of selected targets - print "\n\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.fk_mailing=".$object->id; @@ -375,10 +370,26 @@ if ($object->fetch($id) >= 0) if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname); if ($search_email) $param.= "&search_email=".urlencode($search_email); + print ''; + print ''; + print ''; + print ''; + print ''; + $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,''); + print ''; + + print "\n\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + + if ($page) $param.= "&page=".$page; print '
'; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 08b0e150227..90c01d54725 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -220,8 +220,10 @@ if ($object->fetch($id) >= 0) $var=!$var; + $allowaddtarget=($object->statut == 0 || $object->statut == 1); + // Show email selectors - if ($object->statut == 0 && $user->rights->mailing->creer) + if ($allowaddtarget && $user->rights->mailing->creer) { print_fiche_titre($langs->trans("ToAddRecipientsChooseHere"),($user->admin?info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"),1):''),''); @@ -291,7 +293,7 @@ if ($object->fetch($id) >= 0) $var = !$var; print '
'; - if ($object->statut == 0) + if ($allowaddtarget) { print ''; } @@ -337,7 +339,7 @@ if ($object->fetch($id) >= 0) } print '
'; print ''; @@ -510,6 +521,8 @@ if ($object->fetch($id) >= 0) } print "

"; + print ''; + $db->free($resql); } else @@ -517,7 +530,6 @@ if ($object->fetch($id) >= 0) dol_print_error($db); } - print ''; print "\n\n"; } diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index a07395a8f4f..5c15947d186 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -55,6 +55,10 @@ $result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtyp $paiementtype=GETPOST('paiementtype','alpha',3); $req_nb=GETPOST("req_nb",'',3); $thirdparty=GETPOST("thirdparty",'',3); +$req_desc=GETPOST("req_desc",'',3); +$req_debit=GETPOST("req_debit",'',3); +$req_credit=GETPOST("req_credit",'',3); + $vline=GETPOST("vline"); $page=GETPOST('page','int'); $negpage=GETPOST('negpage','int'); @@ -186,22 +190,22 @@ if ($id > 0 || ! empty($ref)) $param.='&req_nb='.urlencode($req_nb); $mode_search = 1; } - if (GETPOST("req_desc")) + if ($req_desc) { - $sql_rech.= " AND b.label LIKE '%".$db->escape(GETPOST("req_desc"))."%'"; - $param.='&req_desc='.urlencode(GETPOST("req_desc")); + $sql_rech.= " AND b.label LIKE '%".$db->escape($req_desc)."%'"; + $param.='&req_desc='.urlencode($req_desc); $mode_search = 1; } - if (GETPOST("req_debit")) + if ($req_debit != '') { - $sql_rech.=" AND b.amount = -".price2num(GETPOST("req_debit")); - $param.='&req_debit='.urlencode(GETPOST("req_debit")); + $sql_rech.=" AND b.amount = -".price2num($req_debit); + $param.='&req_debit='.urlencode($req_debit); $mode_search = 1; } - if (GETPOST("req_credit")) + if ($req_credit != '') { - $sql_rech.=" AND b.amount = ".price2num(GETPOST("req_credit")); - $param.='&req_credit='.urlencode(GETPOST("req_credit")); + $sql_rech.=" AND b.amount = ".price2num($req_credit); + $param.='&req_credit='.urlencode($req_credit); $mode_search = 1; } if ($thirdparty) @@ -291,25 +295,25 @@ if ($id > 0 || ! empty($ref)) $param.='&account='.$object->id; // Define transaction list navigation string - $navig = '
'; + $navig = '
'; //print 'nbpage='.$totalPages.' viewline='.$viewline.' limitsql='.$limitsql; if ($limitsql > $viewline) $navig.=''.img_previous().''; - $navig.= $langs->trans("Page")." "; // ' Page '; - $navig.=''; + $navig.= ' "; // ' Page '; + $navig.=''; $navig.=''; $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; + $navig.=''; + $navig.=''; + $navig.=''; $navig.=''; - $navig.=''; - $navig.=''; + $navig.=''; + $navig.=''; $navig.='/'.$totalPages.' '; if ($total_lines > $limitsql ) { $navig.= ''.img_next().''; } - $navig.=''; + $navig.='
'; //var_dump($navig); // Confirmation delete @@ -325,7 +329,7 @@ if ($id > 0 || ! empty($ref)) // Show title if ($action != 'addline' && $action != 'delete') { - print ''.$navig.''; + print ''.$navig.''; } // Form to add a transaction with no invoice @@ -375,7 +379,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ""; - print ' '."\n"; + print ' '."\n"; } /* @@ -412,10 +416,10 @@ if ($id > 0 || ! empty($ref)) print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8); print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ' '; print ''; print "\n"; @@ -674,7 +678,7 @@ if ($id > 0 || ! empty($ref)) } // Balance - if ($action != 'search') + if (! $mode_search) { if ($total >= 0) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1651407d746..565e63fd749 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -125,8 +125,8 @@ class FactureRec extends Facture $sql.= ", '".$facsrc->socid."'"; $sql.= ", ".$conf->entity; $sql.= ", ".$this->db->idate($now); - $sql.= ", '".$facsrc->amount."'"; - $sql.= ", '".$facsrc->remise."'"; + $sql.= ", ".(!empty($facsrc->amount)?$facsrc->amount:'0'); + $sql.= ", ".(!empty($facsrc->remise)?$this->remise:'0'); $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); $sql.= ", '".$user->id."'"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fb1ce97fd01..749e2fa08ce 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -107,7 +107,7 @@ class Contact extends CommonObject $this->db->begin(); // Clean parameters - $this->lastname=$this->lastname?trim($this->lastname):$this->lastname; + $this->lastname=$this->lastname?trim($this->lastname):trim($this->name); $this->firstname=trim($this->firstname); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); @@ -883,7 +883,8 @@ class Contact extends CommonObject global $langs; $langs->load("dict"); - $code=$this->civilite_id; + $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); + if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7981c290183..75183c2448a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -64,6 +64,7 @@ abstract class CommonObject { global $conf; + //print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."
\n"; $lastname=$this->lastname; $firstname=$this->firstname; if (empty($lastname)) $lastname=($this->lastname?$this->lastname:($this->name?$this->name:$this->nom)); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 146237122ca..206856c3530 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -559,7 +559,7 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; } } - + return $array_name_label; } else @@ -626,11 +626,11 @@ class ExtraFields { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif ($type == 'text') { @@ -646,27 +646,27 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'mail') { - $out=''; + $out=''; } elseif ($type == 'phone') { - $out=''; + $out=''; } elseif ($type == 'price') { - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { - $out=' '; + $out=' '; } elseif ($type == 'select') { - $out=''; foreach ($param['options'] as $key=>$val ) { $out.='