Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
eldy committed Jan 31, 2014
2 parents a2afea7 + 1b88ab2 commit 7f15aa4
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 73 deletions.
3 changes: 0 additions & 3 deletions ChangeLog
Expand Up @@ -70,9 +70,6 @@ For users:
- New: Add object_hour and object_date_rfc as substitution tag for open document generation.
- New: Add options to send an email when paypal or paybox payment is done.
- New: Clone product/service composition.
- New: [ task #926 ] Add extrafield feature on order lines.
- New: [ task #927 ] Add extrafield feature on Proposal lines.
- New: [ task #928 ] Add extrafield feature on invoice lines.
- New: Add option ADHERENT_LOGIN_NOT_REQUIRED.
- New: Add a cron module to define scheduled jobs.
- New: Add new graphical boxes (customer and supplier invoices and orders per month).
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/barcode.php
Expand Up @@ -332,4 +332,4 @@
$db->close();

llxFooter();
?>
?>
3 changes: 1 addition & 2 deletions htdocs/comm/action/fiche.php
Expand Up @@ -583,11 +583,10 @@ function setdatefields()
// Project
if (! empty($conf->projet->enabled))
{

$formproject=new FormProjets($db);

// Projet associe
$langs->load("project");
$langs->load("projects");

print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';

Expand Down
16 changes: 8 additions & 8 deletions htdocs/contact/class/contact.class.php
Expand Up @@ -7,6 +7,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -66,7 +67,7 @@ class Contact extends CommonObject

var $code;
var $email;
var $skype;
var $skype;
var $jabberid;
var $phone_pro;
var $phone_perso;
Expand Down Expand Up @@ -102,6 +103,7 @@ class Contact extends CommonObject
function __construct($db)
{
$this->db = $db;
$this->statut = 1; // By default, status is enabled
}

/**
Expand All @@ -124,9 +126,9 @@ function create($user)
$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);
if (! $this->socid) $this->socid = 0;
if (! $this->priv) $this->priv = 0;
if (empty($this->statut)) $this->statut = 0;
if (empty($this->socid)) $this->socid = 0;
if (empty($this->priv)) $this->priv = 0;
if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request

$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
$sql.= " datec";
Expand Down Expand Up @@ -236,7 +238,7 @@ function update($id, $user=0, $notrigger=0, $action='update')
$this->phone_perso=trim($this->phone_perso);
$this->phone_mobile=trim($this->phone_mobile);
$this->jabberid=trim($this->jabberid);
$this->skype=trim($this->skype);
$this->skype=trim($this->skype);
$this->fax=trim($this->fax);
$this->zip=(empty($this->zip)?'':$this->zip);
$this->town=(empty($this->town)?'':$this->town);
Expand All @@ -260,7 +262,7 @@ function update($id, $user=0, $notrigger=0, $action='update')
$sql .= ", poste='".$this->db->escape($this->poste)."'";
$sql .= ", fax='".$this->db->escape($this->fax)."'";
$sql .= ", email='".$this->db->escape($this->email)."'";
$sql .= ", skype='".$this->db->escape($this->skype)."'";
$sql .= ", skype='".$this->db->escape($this->skype)."'";
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");
Expand Down Expand Up @@ -1099,7 +1101,5 @@ function setstatus($statut)
}
}



}
?>
26 changes: 18 additions & 8 deletions htdocs/contact/fiche.php
Expand Up @@ -744,11 +744,17 @@
print $form->selectarray('priv',$selectarray,$object->priv,0);
print '</td></tr>';

// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
print isset($_POST["note"])?$_POST["note"]:$object->note;
print '</textarea></td></tr>';
// Note Public
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td><td colspan="3">';
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';

// Note Private
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td><td colspan="3">';
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';

// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
Expand Down Expand Up @@ -961,10 +967,14 @@
print $object->LibPubPriv($object->priv);
print '</td></tr>';

// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print nl2br($object->note);
// Note Public
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td><td colspan="3">';
print nl2br($object->note_public);
print '</td></tr>';

// Note Private
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td><td colspan="3">';
print nl2br($object->note_private);

// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -3741,15 +3741,16 @@ function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select')
* @param int $maxlen Length maximum for labels
* @param int $disabled Html select box is disabled
* @param int $sort 'ASC' or 'DESC' =Sort on label, '' or 'NONE'=Do not sort
* @param string $morecss Add more class to css styles
* @return string HTML select string
*/
function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0, $sort='')
function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='')
{
global $langs;

if ($value_as_key) $array=array_combine($array, $array);

$out='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat" name="'.$htmlname.'" '.($option != ''?$option:'').'>';
$out='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($option != ''?$option:'').'>';

if ($show_empty)
{
Expand Down
52 changes: 29 additions & 23 deletions htdocs/core/lib/agenda.lib.php
Expand Up @@ -46,7 +46,7 @@
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') {

global $conf, $user, $langs, $db;

// Filters
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER ["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
Expand All @@ -56,63 +56,63 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<input type="hidden" name="day" value="' . $day . '">';
print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
print '<table class="nobordernopadding" width="100%">';

print '<tr><td class="nowrap">';

print '<table class="nobordernopadding">';

if ($canedit)
{
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("ActionsAskedBy");
print ' &nbsp;</td><td class="nowrap">';
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit);
print '</td>';
print '</tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy");
print ' &nbsp;</td><td class="nowrap">';
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
print '</td></tr>';

print '<tr>';
print '<td class="nowrap">';
print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy");
print ' &nbsp;</td><td class="nowrap">';
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit);
print '</td></tr>';

include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap">';
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';

print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0));

print '</td></tr>';
}

if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
$formproject=new FormProjets($db);

print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap">';
print '</td><td class="nowrap maxwidthonsmartphone">';
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64);
print '</td></tr>';
}

print '</table>';
print '</td>';

// Buttons
print '<td align="center" valign="middle" class="nowrap">';
print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans("ViewCal") . '">';
Expand All @@ -123,7 +123,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<br>';
print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans("ViewList") . '">';
print '</td>';

// Legend
if ($conf->use_javascript_ajax && is_array($showextcals))
{
Expand All @@ -144,22 +144,24 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
foreach ($showextcals as $val)
{
$htmlname = dol_string_nospecial($val['name']);
print '<tr><td>';
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_' . $htmlname . '").click(function() { jQuery(".family_' . $htmlname . '").toggle(); });' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<tr><td><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . '</td></tr>';
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
print '</td></tr>';
}
}
}
print '<tr><td><input type="checkbox" id="check_birthday" name="check_birthday checked="false"> ' . $langs->trans("AgendaShowBirthdayEvents") . '</td></tr>';
print '<tr><td>'.$langs->trans("AgendaShowBirthdayEvents").' <input type="checkbox" id="check_birthday" name="check_birthday"></td></tr>';
print '</table>';
print '</td>';
}

print '</tr>';

print '</table>';
print '</form>';
}
Expand Down Expand Up @@ -432,6 +434,10 @@ function actions_prepare_head($object)
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;

complete_head_from_modules($conf,$langs,$object,$head,$h,'action');

complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove');

return $head;
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -128,7 +128,7 @@ function societe_prepare_head($object)
// Attached files
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->societe->dir_output . "/" . $object->id;
$nbFiles = count(dol_dir_list($upload_dir));
$nbFiles = count(dol_dir_list($upload_dir,'files'));
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
Expand Down Expand Up @@ -621,7 +621,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')

// Copy to clipboard
print "<td>&nbsp;</td>";

// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
Expand Down Expand Up @@ -726,7 +726,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if (!empty($object->country))
$coords .= "<br />".addslashes($object->country);
}

print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
print img_picto($langs->trans("Address"), 'object_address.png');
print '</a></td>';
Expand All @@ -745,7 +745,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print img_object($langs->trans("Event"),"action");
print '</a></td>';
}

// Edit
if ($user->rights->societe->contact->creer)
{
Expand Down
4 changes: 3 additions & 1 deletion htdocs/core/lib/invoice.lib.php
Expand Up @@ -132,11 +132,13 @@ function invoice_admin_prepare_head($object)
$head[$h][2] = 'attributes';
$h++;

if ($conf->global->FEATURES_LEVEL >= 2) // FIXME This feature will works when form for predefined and free product will be merged, otherwise there is duplicate fields with same name
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';
$h++;

}

complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice_admin','remove');

Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/lib/order.lib.php
Expand Up @@ -138,10 +138,13 @@ function order_admin_prepare_head($object)
$head[$h][2] = 'attributes';
$h++;

if ($conf->global->FEATURES_LEVEL >= 2) // FIXME This feature will works when form for predefined and free product will be merged, otherwise there is duplicate fields with same name
{
$head[$h][0] = DOL_URL_ROOT.'/admin/orderdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';
$h++;
}

complete_head_from_modules($conf,$langs,$object,$head,$h,'order_admin','remove');

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/product.lib.php
Expand Up @@ -120,7 +120,7 @@ function product_prepare_head($object, $user)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir));
$nbFiles = count(dol_dir_list($upload_dir,'files'));
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/lib/propal.lib.php
Expand Up @@ -136,10 +136,13 @@ function propal_admin_prepare_head($object)
$head[$h][2] = 'attributes';
$h++;

if ($conf->global->FEATURES_LEVEL >= 2) // FIXME This feature will works when form for predefined and free product will be merged, otherwise there is duplicate fields with same name
{
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';
$h++;
}

complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_admin','remove');

Expand Down
1 change: 1 addition & 0 deletions htdocs/core/tpl/document_actions_post_headers.tpl.php
Expand Up @@ -25,6 +25,7 @@

if ($action == 'delete')
{
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
$ret = $form->form_confirm(
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'),
$langs->trans('DeleteFile'),
Expand Down

0 comments on commit 7f15aa4

Please sign in to comment.