Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.5' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 15, 2013
2 parents b03d1d9 + 7864fe3 commit 6946fdb
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 106 deletions.
7 changes: 3 additions & 4 deletions htdocs/admin/dict.php
Expand Up @@ -446,7 +446,7 @@
}
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
$ok=0;
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
}
if (isset($_POST["code"]))
Expand All @@ -456,8 +456,7 @@
$ok=0;
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
}
// FIXME regresion if code with not in numeric base
/*if (!is_numeric($_POST['code']))
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
Expand Down Expand Up @@ -1100,7 +1099,7 @@
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0;
else if ($obj->code == 'RECEP') $iserasable = 0;
else if ($obj->code == 'EF0') $iserasable = 0;
}
}

if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;

Expand Down
12 changes: 6 additions & 6 deletions htdocs/comm/action/fiche.php
Expand Up @@ -167,7 +167,7 @@
$actioncomm->datep = $datep;
$actioncomm->datef = $datef;
$actioncomm->percentage = $percentage;
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
60;

$usertodo=new User($db);
Expand All @@ -193,7 +193,7 @@
}

// Special for module webcal and phenix
// FIXME external modules
// TODO external modules
if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $actioncomm->use_webcal=1;
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;

Expand Down Expand Up @@ -484,7 +484,7 @@ function setdatefields()

// Full day
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';

// Date start
$datep=$actioncomm->datep;
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
Expand Down Expand Up @@ -565,7 +565,7 @@ function setdatefields()
}
else
{

$events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company
Expand All @@ -581,7 +581,7 @@ function setdatefields()
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
print '</td></tr>';


// Project
if (! empty($conf->projet->enabled))
Expand Down Expand Up @@ -623,7 +623,7 @@ function setdatefields()
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
$doleditor->Create();
print '</td></tr>';


// Other attributes
$parameters=array();
Expand Down
114 changes: 55 additions & 59 deletions htdocs/comm/contact.php
Expand Up @@ -42,6 +42,7 @@
$search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility
$search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility
$contactname=GETPOST('contactname');
$begin=GETPOST('begin','alpha');

// Security check
$socid = GETPOST('socid','int');
Expand Down Expand Up @@ -87,13 +88,7 @@

if (dol_strlen($stcomm))
{
$sql.= " AND s.fk_stcomm=$stcomm";
}

// FIXME $begin not exist
if (dol_strlen($begin)) // filtre sur la premiere lettre du nom
{
$sql.= " AND upper(p.name) LIKE '".$begin."%'";
$sql.= " AND s.fk_stcomm=".$db->escape($stcomm);
}

if (! empty($search_lastname))
Expand All @@ -113,7 +108,7 @@

if (! empty($contactname)) // acces a partir du module de recherche
{
$sql.= " AND (p.name LIKE '%".$db->escape(strtolower($contactname))."%' OR lower(p.firstname) LIKE '%".$db->escape(strtolower($contactname))."%') ";
$sql.= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.name";
$sortorder = "ASC";
}
Expand All @@ -124,55 +119,57 @@
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);

$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], "&amp;type=$type",$sortfield,$sortorder,"",$num);

print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print "</tr>\n";

print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>';
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
print '</form>';

$var=True;
$i = 0;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);

$var=!$var;

print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
print "<td>$obj->firstname</TD>";

print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";

print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';

print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').'&nbsp;</td>';

print "</tr>\n";
$i++;
}
print "</table></p>";
$db->free($resql);
$num = $db->num_rows($resql);

$param="&type=".$type;

$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num);

print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print "</tr>\n";

print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>';
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
print '</form>';

$var=True;
$i = 0;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);

$var=!$var;

print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
print "<td>$obj->firstname</TD>";

print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";

print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';

print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').'&nbsp;</td>';

print "</tr>\n";
$i++;
}
print "</table></p>";
$db->free($resql);
}
else
{
Expand All @@ -182,5 +179,4 @@
llxFooter();

$db->close();

?>
?>
1 change: 1 addition & 0 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -3085,6 +3085,7 @@ function fetch($rowid)
$this->fk_product = $objp->fk_product;
$this->product_type = $objp->product_type;
$this->info_bits = $objp->info_bits;
$this->special_code = $objp->special_code;
$this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva;
$this->total_localtax1 = $objp->total_localtax1;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -3396,7 +3396,7 @@ function fetch($rowid)
$sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,';
$sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,';
$sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,';
$sql.= ' fd.info_bits, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,';
$sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,';
$sql.= ' fd.fk_code_ventilation,';
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd';
Expand Down Expand Up @@ -3425,6 +3425,7 @@ function fetch($rowid)
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->info_bits = $objp->info_bits;
$this->special_code = $objp->special_code;
$this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva;
$this->total_localtax1 = $objp->total_localtax1;
Expand Down
1 change: 0 additions & 1 deletion htdocs/compta/facture/prelevement.php
Expand Up @@ -211,7 +211,6 @@
}
print ')';
}
// FIXME $facidnext not defined
/*
if ($facidnext > 0)
{
Expand Down
1 change: 0 additions & 1 deletion htdocs/contrat/fiche.php
Expand Up @@ -1088,7 +1088,6 @@
}


$servicepos=(GETPOST('servicepos')?GETPOST('servicepos'):1); // FIXME : not used ?
$colorb='666666';

$arrayothercontracts=$object->getListOfContracts('others');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/boxes/box_activity.php
Expand Up @@ -56,7 +56,7 @@ function __construct($db,$param)
// 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 comments)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/html.form.class.php
Expand Up @@ -138,7 +138,7 @@ function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='str
if (empty($typeofdata)) return 'ErrorBadParameter';

// When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker
{
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success);
}
Expand Down
14 changes: 7 additions & 7 deletions htdocs/core/db/pgsql.class.php
Expand Up @@ -61,7 +61,7 @@ class DoliDBPgsql extends DoliDB
var $lastqueryerror;
var $lasterror;
var $lasterrno;

var $unescapeslashquot=0; // By default we do not force the unescape of \'. This is used only to process sql with mysql escaped data.
var $standard_conforming_strings=1; // Database has option standard_conforming_strings to on

Expand Down Expand Up @@ -211,7 +211,7 @@ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=0)
// tinyint type conversion
$line=preg_replace('/tinyint\(?[0-9]*\)?/','smallint',$line);
$line=preg_replace('/tinyint/i','smallint',$line);

// nuke unsigned
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);

Expand All @@ -234,13 +234,13 @@ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=0)
$line=preg_replace('/^float/i','numeric',$line);
$line=preg_replace('/(\s*)float/i','\\1numeric',$line);

//Check tms timestamp field case (in Mysql this field is defautled to now and
//Check tms timestamp field case (in Mysql this field is defautled to now and
// on update defaulted by now
$line=preg_replace('/(\s*)tms(\s*)timestamp/i','\\1tms timestamp without time zone DEFAULT now() NOT NULL',$line);

// nuke ON UPDATE CURRENT_TIMESTAMP
$line=preg_replace('/(\s*)on(\s*)update(\s*)CURRENT_TIMESTAMP/i','\\1',$line);

// unique index(field1,field2)
if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i',$line))
{
Expand Down Expand Up @@ -468,7 +468,7 @@ function getDriverInfo()
{
return '';
}

/**
* Close database connexion
*
Expand Down Expand Up @@ -1254,7 +1254,7 @@ function DDLUpdateField($table,$field_name,$field_desc)
$sql.="(".$field_desc['value'].")";
}

// FIXME May not work with pgsql. May need to run a second request. If it works, just remove the FIXME tag
// TODO May not work with pgsql. May need to run a second request. If it works, just remove the comment
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";

dol_syslog($sql,LOG_DEBUG);
Expand Down
20 changes: 10 additions & 10 deletions htdocs/core/tpl/admin_extrafields_add.tpl.php
Expand Up @@ -31,14 +31,14 @@ function init_typeoffields(type)
{
print 'jQuery("#value_choice").hide();';
}

if (GETPOST('type') == "separate")
{
print "jQuery('#size, #unique, #required, #default_value').val('').attr('disabled','disabled');";
print 'jQuery("#value_choice").hide();';
}
?>

if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
else if (type == 'datetime') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
else if (type == 'double') { size.val('24,8').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
Expand Down Expand Up @@ -67,17 +67,19 @@ function init_typeoffields(type)
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">

<table summary="listofattributes" class="border centpercent">
<!-- Label -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label'); ?>"></td></tr>
<!-- Code -->
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?> (<?php echo $langs->trans("AlphaNumOnlyCharsAndNoSpace"); ?>)</td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname'); ?>"></td></tr>
<!-- Type -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
<?php print $form->selectarray('type',$type2label,GETPOST('type')); ?>
</td></tr>
<!-- Size -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size')?GETPOST('size'):''); ?>"></td></tr>
<!-- Position -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos'); ?>"></td></tr>
<!-- Label -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label'); ?>"></td></tr>
<!-- Code -->
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?> (<?php echo $langs->trans("AlphaNumOnlyCharsAndNoSpace"); ?>)</td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname'); ?>"></td></tr>
<!-- Value (for select list / radio/ checkbox) -->
<tr><td><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos'); ?>"></td></tr>
<!-- Default Value (for select list / radio/ checkbox) -->
<tr id="value_choice">

<td>
Expand All @@ -95,8 +97,6 @@ function init_typeoffields(type)
</tr>
<!-- Default Value -->
<tr><td><?php echo $langs->trans("DefaultValue"); ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo (GETPOST('"default_value"')?GETPOST('"default_value"'):''); ?>"></td></tr>
<!-- Size -->
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size')?GETPOST('size'):''); ?>"></td></tr>
<!-- Unique -->
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique" <?php echo (GETPOST('unique')?' checked="true"':''); ?>></td></tr>
<!-- Required -->
Expand Down

0 comments on commit 6946fdb

Please sign in to comment.