Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Florian Henry 2013-11-11 16:24:10 +01:00
commit d04f5c3148
230 changed files with 16257 additions and 1275 deletions

View File

@ -1,9 +1,6 @@
--------------------------------------------------------------
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: Bad rounding on margin calculations and display.
Fix: Option drop table into backup was broken.
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
@ -73,6 +70,9 @@ For users:
- Fix: [ bug #1022 ] correct margin calculation for credit notes.
- Fix: Better management of using ajax for upload form (to solve problem when enabling ajax jquery multifile upload in some cases).
New experimental module:
- New: [ task #157 ] Add a Skype button (adherents / third parties / contacts)
For translators:
- Qual: Normalized sort order of all languages files with English reference files.
- New: Add language code files for South Africa, France new Caledonia, Vietnam.
@ -126,7 +126,11 @@ parameter. All methods addline in this case were modified to remove this paramet
4) Method ->classer_facturee() is deprecated. It must be replace with ->classifyBilled().
5) Property ->tel on objects is now ->phone
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: Bad rounding on margin calculations and display.
Fix: Option drop table into backup was broken.
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined

View File

@ -123,6 +123,6 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
- Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise).
- Dolibarr ne gère en standard qu'une société/institution/association mère (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données.
- Dolibarr ne contient pas de module de Gestion de la paie.
- Les taches du module de gestion de projets n'ont pas de dépendance entre elle.
- Les tâches du module de gestion de projets n'ont pas de dépendance entre elle.
- Dolibarr ne contient pas de Webmail.
- Dolibarr ne fait pas le café (pas encore).

View File

@ -98,20 +98,26 @@ http://bugs.debian.org/package
##### Testing a package into unstable env
Check you have a mysql server available from another interface than localhost
Uncomment line if required and restart mysql
bind-address = 127.0.0.1
Create a chroot called "unstable-amd64-sbuild"
> sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
Pour lister les env chroot
> schroot -l
Puis pour se connecter
Puis pour se connecter et préparer l'environnement
> schroot -c name_of_chroot
> vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok)
> apt-get install links mysql-client
Pour tester un package
> cp *.deb /srv/chroot/unstable/tmp
> sudo schroot -c name_of_chroot
> dpkg -i dolibarr*.deb
> sudo apt-get install -f
> apt-get install -f
@ -173,6 +179,12 @@ http://packages.qa.debian.org/t/tcpdf.html
##### Update but tracker system
To set status of a bug to pending
> bts tag 728235 +pending
##### Create/Maintain dolibarr package
To update dolibarr debian package

View File

@ -17,9 +17,9 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.5.0-alpha
AppVerName=DoliWamp-3.5.0-beta
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
OutputBaseFilename=DoliWamp-3.5.0-alpha
OutputBaseFilename=DoliWamp-3.5.0-beta
; Define full path from wich all relative path are defined
; You must modify this to put here your dolibarr root directory
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx

View File

@ -10,7 +10,7 @@ use Cwd;
$PROJECT="dolibarr";
$MAJOR="3";
$MINOR="5";
$BUILD="0-alpha"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$RPMSUBVERSION="auto"; # auto use value found into BUILD
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages

View File

@ -325,10 +325,10 @@ then
fi
else
# Upgrade
echo "No remove ation done (this is an upgrade)"
echo "No remove action done (this is an upgrade)"
fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
- Initial version (#723326)

View File

@ -553,10 +553,10 @@ then
fi
else
# Upgrade
echo "No remove ation done (this is an upgrade)"
echo "No remove action done (this is an upgrade)"
fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
- Initial version (#723326)

View File

@ -329,11 +329,11 @@ then
fi
else
# Upgrade
echo "No remove ation done (this is an upgrade)"
echo "No remove action done (this is an upgrade)"
fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
- Initial version (#723326)

View File

@ -339,11 +339,11 @@ then
fi
else
# Upgrade
echo "No remove ation done (this is an upgrade)"
echo "No remove action done (this is an upgrade)"
fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
- Initial version (#723326)

File diff suppressed because one or more lines are too long

View File

@ -263,7 +263,7 @@ print '<br>';
/*
* Edition des variables globales non rattache a un theme specifique
* Edition des variables globales non rattachées à un theme specifique
*/
$constantes=array(
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',

View File

@ -65,6 +65,7 @@ class Adherent extends CommonObject
var $country;
var $email;
var $skype;
var $phone;
var $phone_perso;
var $phone_mobile;
@ -430,6 +431,7 @@ class Adherent extends CommonObject
$sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null");
$sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null");
$sql.= ", email='".$this->email."'";
$sql.= ", skype='".$this->skype."'";
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
$sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
@ -526,6 +528,7 @@ class Adherent extends CommonObject
$luser->societe_id=$this->societe;
$luser->email=$this->email;
$luser->skype=$this->skype;
$luser->office_phone=$this->phone;
$luser->user_mobile=$this->phone_mobile;
@ -564,6 +567,7 @@ class Adherent extends CommonObject
$lthirdparty->zip=$this->zip;
$lthirdparty->town=$this->town;
$lthirdparty->email=$this->email;
$lthirdparty->skype=$this->skype;
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
@ -1047,7 +1051,7 @@ class Adherent extends CommonObject
global $langs;
$sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
$sql.= " d.tms as datem,";
@ -1115,6 +1119,7 @@ class Adherent extends CommonObject
$this->phone_perso = $obj->phone_perso;
$this->phone_mobile = $obj->phone_mobile;
$this->email = $obj->email;
$this->skype = $obj->skype;
$this->photo = $obj->photo;
$this->statut = $obj->statut;
@ -1782,6 +1787,7 @@ class Adherent extends CommonObject
$this->country = 'France';
$this->morphy = 1;
$this->email = 'specimen@specimen.com';
$this->skype = 'tom.hanson';
$this->phone = '0999999999';
$this->phone_perso = '0999999998';
$this->phone_mobile = '0999999997';
@ -1853,6 +1859,7 @@ class Adherent extends CommonObject
if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town;
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype;
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -60,47 +61,31 @@ if (! $sortfield) $sortfield="name";
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $id;
$form = new Form($db);
$object=new Adherent($db);
$membert=new AdherentType($db);
$result=$object->fetch($id);
if ($result < 0)
{
dol_print_error($db);
exit;
}
/*
* Actions
*/
// Envoie fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_add_file_process($upload_dir,0,1,'userfile');
}
// Suppression fichier
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
$langs->load("other");
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
* View
*/
$form = new Form($db);
$object=new Adherent($db);
$membert=new AdherentType($db);
llxHeader();
if ($id > 0)
{
$result=$object->fetch($id);
$result=$membert->fetch($object->typeid);
if ($result > 0)
{
@ -180,23 +165,10 @@ if ($id > 0)
print '</div>';
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$object->id,'',0,0,$user->rights->adherent->creer,50,$object);
// List of document
$formfile->list_of_documents($filearray,$object,'member','', 0, get_exdir($object->id,2,0,1).'/'.$object->id.'/');
$modulepart = 'member';
$permission = $user->rights->adherent->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
print "<br><br>";
}
else

View File

@ -285,6 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$object->phone_perso = trim($_POST["phone_perso"]);
$object->phone_mobile= trim($_POST["phone_mobile"]);
$object->email = trim($_POST["email"]);
$object->skype = trim($_POST["skype"]);
$object->birth = $birthdate;
$object->typeid = $_POST["typeid"];
@ -413,6 +414,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
$phone=$_POST["phone"];
$phone_perso=$_POST["phone_perso"];
$phone_mobile=$_POST["phone_mobile"];
$skype=$_POST["member_skype"];
$email=$_POST["member_email"];
$login=$_POST["member_login"];
$pass=$_POST["password"];
@ -437,6 +439,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
$object->phone = $phone;
$object->phone_perso = $phone_perso;
$object->phone_mobile= $phone_mobile;
$object->skype = $skype;
$object->email = $email;
$object->login = $login;
$object->pass = $pass;
@ -844,6 +847,12 @@ else
// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype','alpha')?GETPOST('member_skype','alpha'):$object->skype).'"></td></tr>';
}
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc');
@ -1080,6 +1089,11 @@ else
// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
// Skype
if (! empty($conf->skype->enabled)) {
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
}
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
@ -1398,6 +1412,9 @@ else
// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
// Skype
print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
// Birthday
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';

View File

@ -220,11 +220,10 @@ $form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup');
print "<br>";
$head=fichinter_admin_prepare_head();
dol_fiche_head($head, 'ficheinter', $langs->trans("ModuleSetup"));
dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), 0, 'intervention');
// Interventions numbering model

View File

@ -61,6 +61,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',GETPOST("fieldhomephone"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++;
@ -214,6 +215,14 @@ print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_MOBILE"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked="checked"':'')."></td>";
print '</tr>';
// Skype
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
print '<input size="25" type="text" name="fieldskype" value="'.$conf->global->LDAP_CONTACT_FIELD_SKYPE.'">';
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_SKYPE"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked="checked"':'')."></td>";
print '</tr>';
// Fax
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldFax").'</td><td>';

View File

@ -65,6 +65,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',GETPOST("fieldphoneperso"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++;
@ -255,6 +256,14 @@ print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// Skype
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
print '<input size="25" type="text" name="fieldskype" value="'.$conf->global->LDAP_MEMBER_FIELD_SKYPE.'">';
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
print '<td align="right">&nbsp;</td>';
print '</tr>';
// Fax
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldFax").'</td><td>';

View File

@ -63,6 +63,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++;
@ -240,6 +241,14 @@ print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_MOBILE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked="checked"':'')."></td>";
print '</tr>';
// Skype
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
print '<input size="25" type="text" name="fieldskype" value="'.$conf->global->LDAP_FIELD_SKYPE.'">';
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_SKYPE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked="checked"':'')."></td>";
print '</tr>';
// Fax
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldFax").'</td><td>';
@ -383,6 +392,7 @@ if (function_exists("ldap_connect"))
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
$conf->global->LDAP_FIELD_PHONE,
$conf->global->LDAP_FIELD_FAX,
$conf->global->LDAP_FIELD_SKYPE,
$conf->global->LDAP_FIELD_MOBILE,
$conf->global->LDAP_FIELD_MAIL,
$conf->global->LDAP_FIELD_TITLE,

View File

@ -611,6 +611,7 @@ class ActionComm extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
@ -933,6 +934,7 @@ class ActionComm extends CommonObject
if ($resql)
{
// Note: Output of sql request is encoded in $conf->file->character_set_client
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$qualified=true;

View File

@ -78,14 +78,14 @@ class CActionComm
$this->libelle = $obj->libelle;
$this->active = $obj->active;
$this->db->free($resql);
return 1;
}
else
{
$this->db->free($resql);
return 0;
}
$this->db->free($resql);
}
else
{

View File

@ -270,7 +270,7 @@ class ICal
* Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
*
* @param string $ical_date String date
* @return timestamp
* @return int
*/
function ical_date_to_unix($ical_date)
{
@ -395,4 +395,4 @@ class ICal
return $this->cal;
}
}
?>
?>

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -40,8 +41,9 @@ $langs->load("commercial");
$langs->load("other");
$langs->load("bills");
$objectid = GETPOST('id','int');
$action=GETPOST('action','alpha');
$objectid = GETPOST('id', 'int');
$action=GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
// Security check
$socid = GETPOST('socid','int');
@ -79,26 +81,9 @@ if (! $sortfield) $sortfield="name";
/*
* Action envoie fichier
* Actions
*/
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
dol_add_file_process($upload_dir,0,1,'userfile');
}
/*
* Efface fichier
*/
if ($action == 'delete')
{
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$act);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action='';
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -268,15 +253,10 @@ if ($act->id > 0)
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
$param = '&id=' . $act->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{

View File

@ -167,7 +167,8 @@ if ($action == 'add_action')
$actioncomm->datep = $datep;
$actioncomm->datef = $datef;
$actioncomm->percentage = $percentage;
$actioncomm->duree=((GETPOST('dureehour') * 60) + GETPOST('dureemin')) * 60;
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
60;
$usertodo=new User($db);
if ($_POST["affectedto"] > 0)
@ -518,7 +519,7 @@ if ($action == 'create')
if (GETPOST("afaire") == 1) $percent=0;
else if (GETPOST("afaire") == 2) $percent=100;
}
print $htmlactions->form_select_status_action('formaction',$percent,1,'complete');
$htmlactions->form_select_status_action('formaction',$percent,1,'complete');
print '</td></tr>';
// Location
@ -774,7 +775,7 @@ if ($id > 0)
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage;
print $htmlactions->form_select_status_action('formaction',$percent,1);
$htmlactions->form_select_status_action('formaction',$percent,1);
print '</td></tr>';
// Location

View File

@ -6,6 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -196,9 +197,8 @@ if ($id > 0)
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" class="notopnoleft">';
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
@ -267,6 +267,12 @@ if ($id > 0)
// Fax
print '<td>'.$langs->trans('Fax').'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';
// Skype
if (! empty($conf->skype->enabled))
{
print '<td>'.$langs->trans('Skype').'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
}
// Assujeti a TVA ou pas
print '<tr>';
print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
@ -452,7 +458,7 @@ if ($id > 0)
}
else
{
print $langs->trans("UserNotLinkedToMember");
print $langs->trans("ThirdpartyNotLinkedToMember");
}
print '</td>';
print "</tr>\n";
@ -462,8 +468,6 @@ if ($id > 0)
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print "</td>\n";
//print '<td valign="top" width="50%" class="notopnoleftnoright">';
// Nbre max d'elements des petites listes
@ -800,8 +804,6 @@ if ($id > 0)
print '</div></div></div>';
print '<div style="clear:both"></div>';
//print "</td></tr>";
//print "</table>";
dol_fiche_end();

View File

@ -100,7 +100,7 @@ $hookmanager->initHooks(array('propalcard'));
/*
* Actions
*/
*/
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@ -131,7 +131,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
}
}
// Suppression de la propale
// Delete proposal
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer)
{
$result=$object->delete($user);
@ -436,9 +436,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST(
}
}
/*
* Add file in email form
*/
// Add file in email form
if (GETPOST('addfile'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -451,9 +449,7 @@ if (GETPOST('addfile'))
$action='presend';
}
/*
* Remove file in email form
*/
// Remove file in email form
if (GETPOST('removedfile'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -469,7 +465,7 @@ if (GETPOST('removedfile'))
/*
* Send mail
*/
*/
if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
{
$langs->load('mails');
@ -637,7 +633,7 @@ else if ($action == "setabsolutediscount" && $user->rights->propal->creer)
}
}
//Ajout d'une ligne produit dans la propale
// Add line
else if ($action == "addline" && $user->rights->propal->creer)
{
$idprod=GETPOST('idprod', 'int');
@ -1163,14 +1159,11 @@ else if ($action == 'update_extras')
{
// Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if($ret < 0) $error++;
if($ret < 0) {
$error++;
$action = 'edit_extras';
}
if(!$error) {
if (! $error)
{
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('propaldao'));
@ -1178,17 +1171,16 @@ else if ($action == 'update_extras')
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
$result=$object->insertExtraFields();
if ($result < 0)
{
$result=$object->insertExtraFields();
if ($result < 0)
{
$error++;
}
$error++;
}
}
else if ($reshook < 0) $error++;
}
if ($error) $action = 'edit_extras';
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer)
@ -1254,7 +1246,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->
/*
* View
*/
*/
llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
@ -1422,7 +1414,7 @@ if ($action == 'create')
/*
* Combobox pour la fonction de copie
*/
*/
if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE))
{
@ -1521,7 +1513,7 @@ else
{
/*
* Show object in view mode
*/
*/
$soc = new Societe($db);
$soc->fetch($object->socid);
@ -1615,13 +1607,12 @@ else
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
// Ref client
// Ref customer
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print $langs->trans('RefCustomer').'</td>';
print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('RefCustomer')).'</a></td>';
print '</td>';
if ($action != 'refclient' && ! empty($object->brouillon)) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
print '</td>';
print '</tr></table>';
print '</td><td colspan="5">';
if ($user->rights->propal->creer && $action == 'refclient')
@ -1639,6 +1630,7 @@ else
}
print '</td>';
print '</tr>';
// Company
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$soc->getNomUrl(1).'</td>';
print '</tr>';
@ -1897,20 +1889,12 @@ else
print '</tr>';
}
// Other attributes
// Other attributes (TODO Move this into an include)
$res=$object->fetch_optionals($object->id,$extralabels);
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if ($action == 'edit_extras')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
@ -1933,35 +1917,28 @@ else
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
}
if ($action == 'edit_extras' && $user->rights->propal->creer)
if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print $extrafields->showOutputField($key,$value);
if ($object->statut == 0 && $user->rights->propal->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
}
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->propal->creer)
{
print '<tr><td></td><td colspan="5">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
if ($object->statut == 0 && $user->rights->propal->creer)
{
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
}
}
}
}
// Amount HT
@ -2024,7 +2001,7 @@ else
/*
* Lines
*/
*/
if (! empty($conf->use_javascript_ajax) && $object->statut == 0)
{
@ -2077,7 +2054,7 @@ else
{
/*
* Formulaire cloture (signe ou non)
*/
*/
$form_close = '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
$form_close.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form_close.= '<table class="border" width="100%">';
@ -2105,7 +2082,7 @@ else
/*
* Boutons Actions
*/
*/
if ($action != 'presend')
{
print '<div class="tabsAction">';
@ -2216,7 +2193,7 @@ else
/*
* Documents generes
*/
*/
$filename=dol_sanitizeFileName($object->ref);
$filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;

View File

@ -296,7 +296,7 @@ class Propal extends CommonObject
* @param int $fk_product Id du produit/service predefini
* @param double $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC
* @param dobule $pu_ttc Prix unitaire TTC
* @param double $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $type Type of line (product, service)
* @param int $rang Position of line
@ -305,8 +305,8 @@ class Propal extends CommonObject
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax
* @param string $label ???
* @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line
* @param int $date_start Start date of the line
* @param int $date_end End date of the line
* @param array $array_option extrafields array
* @return int >0 if OK, <0 if KO
*
@ -479,8 +479,8 @@ class Propal extends CommonObject
* @param int $pa_ht Price (without tax) of product when it was bought
* @param string $label ???
* @param int $type 0/1=Product/service
* @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line
* @param int $date_start Start date of the line
* @param int $date_end End date of the line
* @param array $array_option extrafields array
* @return int 0 if OK, <0 if KO
*/
@ -1370,7 +1370,7 @@ class Propal extends CommonObject
* Define proposal date
*
* @param User $user Object user that modify
* @param timestamp $date Date
* @param int $date Date
* @return int <0 if KO, >0 if OK
*/
function set_date($user, $date)
@ -1407,7 +1407,7 @@ class Propal extends CommonObject
* Define end validity date
*
* @param User $user Object user that modify
* @param timestamp $date_fin_validite End of validity date
* @param int $date_fin_validite End of validity date
* @return int <0 if KO, >0 if OK
*/
function set_echeance($user, $date_fin_validite)
@ -1434,7 +1434,7 @@ class Propal extends CommonObject
* Set delivery date
*
* @param User $user Object user that modify
* @param timestamp $date_livraison Delivery date
* @param int $date_livraison Delivery date
* @return int <0 if ko, >0 if ok
*/
function set_date_livraison($user, $date_livraison)
@ -1625,7 +1625,7 @@ class Propal extends CommonObject
*
* @param User $user Object user that close
* @param int $statut Statut
* @param text $note Comment
* @param string $note Comment
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if KO, >0 if OK
*/
@ -1688,7 +1688,7 @@ class Propal extends CommonObject
*
* @param User $user Object user that close
* @param int $statut Statut
* @param text $note Comment
* @param string $note Comment
* @return int <0 if KO, >0 if OK
*/
function cloture($user, $statut, $note)
@ -1710,7 +1710,7 @@ class Propal extends CommonObject
{
if ($statut == 2)
{
// Classe la societe rattachee comme client
// Classe la société rattachée comme client
$soc=new Societe($this->db);
$soc->id = $this->socid;
$result=$soc->set_as_client();
@ -2368,6 +2368,7 @@ class Propal extends CommonObject
if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay;
if ($mode == 'signed') $delay_warning=$conf->propal->facturation->warning_delay;
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
@ -2506,6 +2507,7 @@ class Propal extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->nb["proposals"]=$obj->nb;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -64,38 +65,14 @@ $object->fetch($id,$ref);
if ($object->id > 0)
{
$object->fetch_thirdparty();
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
}
/*
* Actions
*/
// Envoi fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->id > 0)
{
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
dol_add_file_process($upload_dir,0,1,'userfile');
}
}
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id > 0)
{
$langs->load("other");
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
/*
@ -153,21 +130,10 @@ if ($object->id > 0)
print '</div>';
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propal->creer,50,$object);
// List of document
$formfile->list_of_documents($filearray,$object,'propal');
$modulepart = 'propal';
$permission = $user->rights->propal->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -21,7 +22,7 @@
/**
* \file htdocs/commande/document.php
* \ingroup order
* \brief Page de gestion des documents attachees a une commande
* \brief Documents setup page attached to an order
*/
require '../main.inc.php';
@ -65,35 +66,13 @@ $object = new Commande($db);
/*
* Actions
*/
// Envoi fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($object->fetch($id))
{
if ($object->fetch($id))
{
$object->fetch_thirdparty();
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
dol_add_file_process($upload_dir,0,1,'userfile');
}
$object->fetch_thirdparty();
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
}
// Delete
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->fetch($id))
{
$langs->load("other");
$object->fetch_thirdparty();
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -107,10 +86,10 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id, $ref))
{
$object->fetch_thirdparty();
{
$object->fetch_thirdparty();
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
$head = commande_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order');
@ -140,23 +119,10 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
print "</div>\n";
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'commande',$param);
$modulepart = 'commande';
$permission = $user->rights->commande->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{

View File

@ -1179,12 +1179,11 @@ else if ($action == 'update_extras')
{
// Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if($ret < 0) $error++;
if($ret < 0)
$error++;
if(!$error) {
if (! $error)
{
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('orderdao'));
@ -1192,22 +1191,16 @@ else if ($action == 'update_extras')
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
$result=$object->insertExtraFields();
if ($result < 0)
{
$result=$object->insertExtraFields();
if ($result < 0)
{
$error++;
}
$error++;
}
}
else if ($reshook < 0) $error++;
}
else
{
$action = 'edit_extras';
}
if ($error) $action = 'edit_extras';
}
/*
@ -2208,20 +2201,12 @@ else
print '</tr>';
}
// Other attributes
// Other attributes (TODO Move this into an include)
$res=$object->fetch_optionals($object->id,$extralabels);
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if ($action == 'edit_extras')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
@ -2244,35 +2229,27 @@ else
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
}
if ($action == 'edit_extras' && $user->rights->commande->creer)
if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print $extrafields->showOutputField($key,$value);
if ($object->statut == 0 && $user->rights->commande->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
}
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->commande->creer)
{
print '<tr><td></td><td colspan="5">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
if ($object->statut == 0 && $user->rights->commande->creer)
{
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
}
}
}
}
$rowspan=4;

View File

@ -301,7 +301,7 @@ if ($id > 0 || ! empty($ref))
{
$text=$langs->trans('ConfirmDeleteTransaction');
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
}
// Define transaction list navigation string
@ -487,7 +487,7 @@ if ($id > 0 || ! empty($ref))
$var=true;
$num = $db->num_rows($result);
$i = 0; $total = 0; $sep = 0;
$i = 0; $total = 0; $sep = -1;
while ($i < $num)
{
@ -500,13 +500,14 @@ if ($id > 0 || ! empty($ref))
// Is it a transaction in future ?
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
//print "dos=".$dos." nows=".$nows;
if ($dos > $nows && !$sep) // Yes, we show a subtotal
if ($dos < $nows) $sep=0; // 0 means there was at least one line before current date
if ($dos > $nows && ! $sep) // We have found a line in future and we already found on line before current date
{
$sep = 1 ;
print '<tr class="liste_total"><td colspan="8">';
print $langs->trans("CurrentBalance");
print '</td>';
print '<td align="right" nowrap><b>'.price($total - $objp->amount).'</b></td>';
print '<td align="right" class="nowrap"><b>'.price($total - $objp->amount).'</b></td>';
print "<td>&nbsp;</td>";
print '</tr>';
}
@ -584,7 +585,7 @@ if ($id > 0 || ! empty($ref))
$banklinestatic->fetch($links[$key]['url_id']);
$bankstatic->id=$banklinestatic->fk_account;
$bankstatic->label=$banklinestatic->bank_account_label;
print ' ('.$langs->trans("from").' ';
print ' ('.$langs->trans("TransferFrom").' ';
print $bankstatic->getNomUrl(1,'transactions');
print ' '.$langs->trans("toward").' ';
$bankstatic->id=$objp->bankid;
@ -596,7 +597,7 @@ if ($id > 0 || ! empty($ref))
{
$bankstatic->id=$objp->bankid;
$bankstatic->label=$objp->bankref;
print ' ('.$langs->trans("from").' ';
print ' ('.$langs->trans("TransferFrom").' ';
print $bankstatic->getNomUrl(1,'');
print ' '.$langs->trans("toward").' ';
$banklinestatic->fetch($links[$key]['url_id']);
@ -754,10 +755,10 @@ if ($id > 0 || ! empty($ref))
if ($page == 0 && ! $mode_search)
{
print '<tr class="liste_total"><td align="left" colspan="8">';
if ($sep) print '&nbsp;';
if ($sep > 0) print '&nbsp;'; // If we had at least one line in future
else print $langs->trans("CurrentBalance");
print '</td>';
print '<td align="right" nowrap>'.price($total).'</td>';
print '<td align="right" nowrap><b>'.price($total).'</b></td>';
print '<td>&nbsp;</td>';
print '</tr>';
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -71,29 +72,7 @@ $modulepart='trip';
* Actions
*/
if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_add_file_process($upload_dir,0,1,'userfile');
}
// Delete
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id > 0)
{
$langs->load("other");
$object->fetch_thirdparty();
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -141,23 +120,10 @@ if ($object->id)
print '</div>';
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id,'',0,0,$user->rights->deplacement->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'deplacement',$param);
$modulepart = 'deplacement';
$permission = $user->rights->deplacement->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else

View File

@ -1926,11 +1926,11 @@ if ($action == 'update_extras')
{
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if($ret < 0)
$error++;
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if ($ret < 0) $error++;
if(!$error) {
if (! $error)
{
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('invoicedao'));
@ -1938,22 +1938,16 @@ if ($action == 'update_extras')
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
$result=$object->insertExtraFields();
if ($result < 0)
{
$result=$object->insertExtraFields();
if ($result < 0)
{
$error++;
}
$error++;
}
}
else if ($reshook < 0) $error++;
}
else
{
$action = 'edit_extras';
}
if ($error) $action = 'edit_extras';
}
@ -3413,21 +3407,13 @@ else if ($id > 0 || ! empty($ref))
print '</tr>';
}
// Other attributes
// Other attributes (TODO Move this into an include)
$res=$object->fetch_optionals($object->id,$extralabels);
$parameters=array('colspan' => ' colspan="2"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if ($action == 'edit_extras')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
@ -3450,35 +3436,27 @@ else if ($id > 0 || ! empty($ref))
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
}
if ($action == 'edit_extras' && $user->rights->facture->creer)
if ($action == 'edit_extras' && $user->rights->facture->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print $extrafields->showOutputField($key,$value);
if ($object->statut == 0 && $user->rights->facture->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
}
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->facture->creer)
{
print '<tr><td></td><td colspan="5">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
if ($object->statut == 0 && $user->rights->facture->creer)
{
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
}
}
}
}
print '</table><br>';

View File

@ -146,7 +146,9 @@ if ($action == 'create')
/* ************************************************************************** */
if ($action == 'edit' && ! empty($attrname))
{
print "<br>";
$langs->load("members");
print "<br>";
print_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -64,40 +65,17 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$object = new Facture($db);
if ($object->fetch($id))
{
$object->fetch_thirdparty();
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
}
/*
* Actions
*/
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
// Envoi fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->fetch($id))
{
$object->fetch_thirdparty();
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
dol_add_file_process($upload_dir,0,1,'userfile');
}
}
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->fetch($id))
{
$langs->load("other");
$object->fetch_thirdparty();
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
/*
* View
@ -169,24 +147,10 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
print "</div>\n";
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer,50,$object);
// List of document
$param='&facid='.$object->id;
$formfile->list_of_documents($filearray,$object,'facture',$param);
$modulepart = 'facture';
$permission = $user->rights->facture->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -40,6 +41,7 @@ $langs->load("bills");
$id = GETPOST('id','int');
$action = GETPOST("action");
$confirm = GETPOST('confirm', 'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
@ -71,18 +73,7 @@ $modulepart='tax';
* Actions
*/
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
dol_add_file_process($upload_dir,0,1,'userfile');
}
if ($action == 'delete')
{
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -169,16 +160,10 @@ if ($object->id)
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object);
// List of document
//$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'tax',$param);
$modulepart = 'tax';
$permission = $user->rights->tax->charges->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{

View File

@ -5,7 +5,8 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -62,6 +63,7 @@ class Contact extends CommonObject
var $code;
var $email;
var $skype;
var $phone_pro;
var $phone_perso;
var $phone_mobile;
@ -226,6 +228,7 @@ class Contact extends CommonObject
$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->fax=trim($this->fax);
$this->zip=(empty($this->zip)?'':$this->zip);
$this->town=(empty($this->town)?'':$this->town);
@ -249,6 +252,7 @@ class Contact extends CommonObject
$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 .= ", 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");
@ -379,6 +383,7 @@ class Contact extends CommonObject
if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax;
if ($this->skype && ! empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype;
if ($this->note_private && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note_private;
if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email;
@ -494,7 +499,7 @@ class Contact extends CommonObject
$sql.= " c.fk_pays as country_id,";
$sql.= " c.fk_departement,";
$sql.= " c.birthday,";
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,";
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$sql.= " c.import_key,";
$sql.= " p.libelle as country, p.code as country_code,";
@ -549,6 +554,7 @@ class Contact extends CommonObject
$this->email = $obj->email;
$this->jabberid = $obj->jabberid;
$this->skype = $obj->skype;
$this->priv = $obj->priv;
$this->mail = $obj->email;
@ -1025,6 +1031,7 @@ class Contact extends CommonObject
$this->country_code = 'FR';
$this->country = 'France';
$this->email = 'specimen@specimen.com';
$this->skype = 'tom.hanson';
$this->phone_pro = '0909090901';
$this->phone_perso = '0909090902';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -168,13 +169,14 @@ if (empty($reshook))
$object->town = $_POST["town"];
$object->country_id = $_POST["country_id"];
$object->state_id = $_POST["state_id"];
$object->skype = $_POST["skype"];
$object->email = $_POST["email"];
$object->phone_pro = $_POST["phone_pro"];
$object->phone_perso = $_POST["phone_perso"];
$object->phone_mobile = $_POST["phone_mobile"];
$object->fax = $_POST["fax"];
$object->jabberid = $_POST["jabberid"];
$object->no_email = $_POST["no_email"];
$object->no_email = $_POST["no_email"];
$object->priv = $_POST["priv"];
$object->note_public = GETPOST("note_public");
$object->note_private = GETPOST("note_private");
@ -268,6 +270,7 @@ if (empty($reshook))
$object->country_id = $_POST["country_id"];
$object->email = $_POST["email"];
$object->skype = $_POST["skype"];
$object->phone_pro = $_POST["phone_pro"];
$object->phone_perso = $_POST["phone_perso"];
$object->phone_mobile = $_POST["phone_mobile"];
@ -514,7 +517,7 @@ else
print '<td>'.$langs->trans("No_Email").'</td><td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
}
else
{
{
print '<td colspan="2">&nbsp;</td>';
}
print '</tr>';
@ -522,6 +525,12 @@ else
// Instant message and no email
print '<tr><td>'.$langs->trans("IM").'</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td colspan="3"><input name="skype" type="text" size="50" maxlength="80" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
}
// Visibility
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
@ -712,7 +721,7 @@ else
print '</tr>';
// Jabberid
print '<tr><td>Jabberid</td><td><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
print '<tr><td>'.$langs->trans("Jabberid").'</td><td><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
if (! empty($conf->mailing->enabled))
{
print '<td>'.$langs->trans("No_Email").'</td><td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
@ -722,7 +731,13 @@ else
print '<td colspan="2">&nbsp;</td>';
}
print '</tr>';
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td><input name="skype" type="text" size="40" maxlength="80" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
}
// Visibility
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
@ -935,6 +950,12 @@ else
print '<td colspan="2">&nbsp;</td>';
}
print '</tr>';
// Skype
if (!empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
}
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
print $object->LibPubPriv($object->priv);

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -48,6 +49,7 @@ $search_phonepro=GETPOST("search_phonepro");
$search_phonemob=GETPOST("search_phonemob");
$search_fax=GETPOST("search_fax");
$search_email=GETPOST("search_email");
$search_skype=GETPOST("search_skype");
$search_priv=GETPOST("search_priv");
$search_categ = GETPOST("search_categ",'int');
$search_statut=GETPOST("search_statut");
@ -99,6 +101,7 @@ if (GETPOST('button_removefilter'))
$search_phonemob="";
$search_fax="";
$search_email="";
$search_skype="";
$search_priv="";
$sall="";
}
@ -117,7 +120,7 @@ $form=new Form($db);
$formother=new FormOther($db);
$sql = "SELECT s.rowid as socid, s.nom as name,";
$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email,";
$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,";
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
$sql.= " cp.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
@ -185,6 +188,10 @@ if (strlen($search_email)) // filtre sur l'email
{
$sql .= " AND p.email LIKE '%".$db->escape($search_email)."%'";
}
if (strlen($search_skype)) // filtre sur skype
{
$sql .= " AND p.skype LIKE '%".$db->escape($search_skype)."%'";
}
if ($type == "o") // filtre sur type
{
$sql .= " AND p.fk_soc IS NULL";
@ -281,6 +288,7 @@ if ($result)
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder);
if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); }
print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder);
@ -316,6 +324,12 @@ if ($result)
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_email" size="8" value="'.$search_email.'">';
print '</td>';
if (! empty($conf->skype->enabled))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_skype" size="8" value="'.$search_skype.'">';
print '</td>';
}
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="center">';
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
@ -376,7 +390,9 @@ if ($result)
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
// EMail
print '<td>'.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).'</td>';
// Skype
if (! empty($conf->skype->enabled)) { print '<td>'.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).'</td>'; }
// Date
print '<td align="center">'.dol_print_date($db->jdate($obj->tms),"day").'</td>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -74,28 +75,9 @@ $modulepart='contract';
/*
* Action envoie fichier
* Actions
*/
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
dol_add_file_process($upload_dir,0,1,'userfile');
}
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id)
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -140,24 +122,10 @@ if ($object->id)
print '</div>';
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->contrat->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'contract',$param);
$modulepart = 'contract';
$permission = $user->rights->contrat->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else

View File

@ -1,14 +1,11 @@
<?php
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
<<<<<<< HEAD
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
=======
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
>>>>>>> refs/remotes/origin/3.4
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -2138,14 +2135,16 @@ abstract class CommonObject
* Add/Update all extra fields values for the current object.
* All data to describe values to insert are stored into $this->array_options=array('keyextrafield'=>'valueextrafieldtoadd')
*
* @return void
* @return int -1=error, O=did nothing, 1=OK
*/
function insertExtraFields()
{
global $langs;
global $conf,$langs;
$error=0;
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
if (! empty($this->array_options))
{
// Check parameters
@ -2249,7 +2248,7 @@ abstract class CommonObject
$out = '';
if(count($extrafields->attribute_label) > 0)
if (count($extrafields->attribute_label) > 0)
{
$out .= "\n";
$out .= '<!-- showOptionalsInput --> ';

View File

@ -688,54 +688,53 @@ class ExtraFields
{
$param_list=array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]);
// 0 : tableName
// 1 : label field name
// 2 : key fields name (if differ of rowid)
// 3 : key field parent (for dependent lists)
// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
$keyList=(empty($InfoFieldList[2])?'rowid':$InfoFieldList[2].' as rowid');
// 0 1 : tableName
// 1 2 : label field name Nom du champ contenant le libelle
// 2 3 : key fields name (if differ of rowid)
// 3 4 : key field parent (for dependent lists)
// 4 5 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
$keyList='rowid';
if (count($InfoFieldList)>=3) {
if (count($InfoFieldList) > 3 && ! empty($InfoFieldList[3]))
{
list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
$keyList.= ', '.$parentField;
}
if (count($InfoFieldList)>=4 && !empty($InfoFieldList[4])) {
if (strpos($InfoFieldList[4], 'extra.')!==false) {
if (count($InfoFieldList) > 4 && ! empty($InfoFieldList[4]))
{
if (strpos($InfoFieldList[4], 'extra.') !== false)
{
$keyList='main.'.$InfoFieldList[2].' as rowid';
}else {
} else {
$keyList=$InfoFieldList[2].' as rowid';
}
}
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label)) {
$keyList .=', ';
$keyList .= implode(', ', $fields_label);
}
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label)) {
if (is_array($fields_label))
{
$keyList .=', ';
$keyList .= implode(', ', $fields_label);
}
$sqlwhere='';
$sql = 'SELECT '.$keyList;
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
if (!empty($InfoFieldList[4])) {
if (!empty($InfoFieldList[4]))
{
//We have to join on extrafield table
if (strpos($InfoFieldList[4], 'extra')!==false) {
if (strpos($InfoFieldList[4], 'extra')!==false)
{
$sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra';
$sql.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
}else {
$sql.= ' WHERE '.$InfoFieldList[4];
$sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
}
else
{
$sqlwhere.= ' AND '.$InfoFieldList[4];
}
}
//$sql.= ' WHERE entity = '.$conf->entity;
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
$sql.=preg_replace('/^ AND /','',$sqlwhere);
//print $sql;
dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
@ -807,6 +806,9 @@ class ExtraFields
}
$this->db->free($resql);
}
else {
print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
}
}
$out.='</select>';
}
@ -1005,13 +1007,14 @@ class ExtraFields
}
/**
* Fill array_options array for object by extrafields value (using for data send by forms)
* Fill array_options property of object by extrafields value (using for data sent by forms)
*
* @param array $extralabels $array of extrafields
* @param object &$object object
* @param object &$object Object
* @param string $onlykey Only following key is filled
* @return int 1 if array_options set / 0 if no value
*/
function setOptionalsFromPost($extralabels,&$object)
function setOptionalsFromPost($extralabels,&$object,$onlykey='')
{
global $_POST, $langs;
$nofillrequired='';// For error when required field left blank
@ -1022,6 +1025,8 @@ class ExtraFields
// Get extra fields
foreach ($extralabels as $key => $value)
{
if (! empty($onlykey) && $key != $onlykey) continue;
$key_type = $this->attribute_type[$key];
if($this->attribute_required[$key] && !GETPOST("options_$key",2))
{

View File

@ -3664,7 +3664,7 @@ class Form
* @param string $typehour if 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo
* @return void
*/
function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select')
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select')
{
global $langs;
@ -3680,7 +3680,7 @@ class Form
if ($typehour=='select')
{
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
for ($hour = 0; $hour < 24; $hour++)
for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours
{
print '<option value="'.$hour.'"';
if ($hourSelected == $hour)
@ -3942,7 +3942,7 @@ class Form
* Return a HTML area with the reference of object and a navigation bar for a business object
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
*
* @param Object $object Object to show
* @param object $object Object to show
* @param string $paramid Name of parameter to use to name the id into the URL link
* @param string $morehtml More html content to output just before the nav bar
* @param int $shownav Show Condition (navigation is shown if value is 1)

View File

@ -503,13 +503,13 @@ class FormCompany
/**
* Return list of third parties
*
* @param Object $object Object we try to find contacts
* @param object $object Object we try to find contacts
* @param string $var_id Name of id field
* @param string $selected Pre-selected third party
* @param string $htmlname Name of HTML form
* @param array $limitto Disable answers that are not id in this array list
* @param int $forceid This is to force another object id than object->id
* @return void
* @return int The selected third party ID
* TODO obsolete ?
* cette fonction doit utiliser du javascript quoi qu'il en soit !
* autant utiliser le système combobox sans rechargement de page non ?
@ -616,7 +616,7 @@ class FormCompany
/**
* Return a select list with types of contacts
*
* @param Object $object Object to use to find type of contact
* @param object $object Object to use to find type of contact
* @param string $selected Default selected value
* @param string $htmlname HTML select name
* @param string $source Source ('internal' or 'external')

View File

@ -3,6 +3,7 @@
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (c) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -59,12 +60,13 @@ class FormFile
* @param int $perm Value of permission to allow upload
* @param int $size Length of input file area
* @param Object $object Object to use (when attachment is done on an element)
* @param string $options Options
* @param string $options Add an option column
* @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param string $linkfiles 1=Also add form to link files, 0=Do not show form to link files
* @return int <0 if KO, >0 if OK
*/
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='')
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1)
{
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
@ -76,10 +78,11 @@ class FormFile
// TODO: Cheeck this works with 2 forms on same page
// TODO: Cheeck this works with GED module, otherwise, force useajax to 0
// TODO: This does not support option savingdocmask
// TODO: This break feature to upload links too
return $this->_formAjaxFileUpload($object);
}
else
{
{
$maxlength=$size;
$out = "\n\n<!-- Start form attach new file -->\n";
@ -154,13 +157,46 @@ class FormFile
$out .= '</form>';
if (empty($sectionid)) $out .= '<br>';
$out .= "\n<!-- End form attach new file -->\n\n";
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm);
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
$out .= "\n<!-- End form attach new file -->\n";
if ($linkfiles)
{
$out .= "\n<!-- Start form attach new link -->\n";
$langs->load('link');
$title = $langs->trans("LinkANewFile");
$out .= load_fiche_titre($title, null, null);
$out .= '<form name="formuserfile" action="'.$url.'" method="POST">';
$out .= '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
$out .= '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$out .= '<table width="100%" class="nobordernopadding">';
$out .= '<tr>';
$out .= '<td valign="middle" class="nowrap">';
$out .= $langs->trans("Link") . ': ';
$out .= '<input type="text" name="link" id="link">';
$out .= ' &nbsp; ' . $langs->trans("Label") . ': ';
$out .= '<input type="text" name="label" id="label">';
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
$out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"';
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
$out .= '>';
$out .= '</td></tr>';
$out .= '</table>';
$out .= '</form><br>';
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm);
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
$out .= "\n<!-- End form attach new file -->\n";
}
if (empty($res))
{
print $out;
}
print $hookmanager->resPrint;
return 1;
@ -994,6 +1030,134 @@ class FormFile
}
/**
* Show array with linked files
*
* @param Object $object Object
* @param int $permtodelete Deletion is allowed
* @param string $action Action
* @param string $selected ???
* @return int Number of links
*/
public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null)
{
global $user, $conf, $langs, $user;
global $bc;
global $sortfield, $sortorder;
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
$link = new Link($this->db);
$links = array();
if ($sortfield == "name") {
$sortfield = "label";
} elseif ($sortfield == "date") {
$sortfield = "datea";
} else {
$sortfield = null;
}
$res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder);
$param = (isset($object->id)?'&id=' . $object->id : '');
// Show list of associated links
print_titre($langs->trans("LinkedFiles"));
print '<table width="100%" class="liste">';
print '<tr class="liste_titre">';
print_liste_field_titre(
$langs->trans("Documents2"),
$_SERVER['PHP_SELF'],
"name",
"",
$param,
'align="left"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans("Size"),
"",
"",
"",
"",
'align="right"'
);
print_liste_field_titre(
$langs->trans("Date"),
$_SERVER['PHP_SELF'],
"date",
"",
$param,
'align="center"',
$sortfield,
$sortorder
);
print_liste_field_titre(
'',
$_SERVER['PHP_SELF'],
"",
"",
$param,
'align="center"'
);
print_liste_field_titre('','','');
print '</tr>';
$nboflinks = count($links);
if ($nboflinks > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
}
$var = true;
foreach ($links as $link) {
$var =! $var;
print '<tr ' . $bc[$var] . '>';
//edit mode
if ($action == 'update' && $selected === $link->id) {
print '<form action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '" method="post">';
print '<input type="hidden" name="linkid" value="' . $link->id . '">';
print '<input type="hidden" name="action" value="confirm_updateline">';
print '<td>';
print $langs->trans('Link') . ': <input type="text" name="link" value = "' . $link->url . '">';
print '</td>';
print '<td align="right">';
print $langs->trans('Label') . ': <input type="text" name="label" value = "' . $link->label . '">';
print '</td>';
print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
print '<td align="right"></td>';
print '<td align="right" colspan="2"><input type="submit" name="save" class="button" value="' . $langs->trans('Save') . '">';
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans('Cancel') . '"></td>';
print '</form>';
}
else {
print '<td>';
print '<a data-ajax="false" href="'. $link->url . '" target="_blank">';
print $link->label;
print '</a>';
print "</td>\n";
print '<td align="right"></td>';
print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
print '<td align="center"></td>';
print '<td align="right" colspan="2">';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id
. '&id=' . $object->id . '" class="editfilelink" >' . img_edit().'</a>';
if ($permtodelete) {
print '<a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id
. '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>';
} else {
print '&nbsp;';
}
print "</td>";
}
print "</tr>\n";
}
if ($nboflinks == 0) {
print '<tr ' . $bc[$var] . '><td colspan="4">';
print $langs->trans("NoLinkFound");
print '</td></tr>';
}
print "</table>";
return $nboflinks;
}
}
?>

View File

@ -48,7 +48,7 @@ class Interfaces
* This function call all qualified triggers.
*
* @param string $action Trigger event code
* @param Object $object Objet concern
* @param object $object Objet concern
* @param User $user Objet user
* @param Lang $langs Objet lang
* @param Conf $conf Objet conf

View File

@ -78,7 +78,8 @@ class Ldap
var $name;
var $firstname;
var $login;
var $phone;
var $phone;
var $skype;
var $fax;
var $mail;
var $mobile;
@ -127,6 +128,7 @@ class Ldap
$this->attr_firstname = $conf->global->LDAP_FIELD_FIRSTNAME;
$this->attr_mail = $conf->global->LDAP_FIELD_MAIL;
$this->attr_phone = $conf->global->LDAP_FIELD_PHONE;
$this->attr_skype = $conf->global->LDAP_FIELD_SKYPE;
$this->attr_fax = $conf->global->LDAP_FIELD_FAX;
$this->attr_mobile = $conf->global->LDAP_FIELD_MOBILE;
}
@ -1172,6 +1174,7 @@ class Ldap
$this->firstname = $this->convToOutputCharset($result[0][$this->attr_firstname][0],$this->ldapcharset);
$this->login = $this->convToOutputCharset($result[0][$this->attr_login][0],$this->ldapcharset);
$this->phone = $this->convToOutputCharset($result[0][$this->attr_phone][0],$this->ldapcharset);
$this->skype = $this->convToOutputCharset($result[0][$this->attr_skype][0],$this->ldapcharset);
$this->fax = $this->convToOutputCharset($result[0][$this->attr_fax][0],$this->ldapcharset);
$this->mail = $this->convToOutputCharset($result[0][$this->attr_mail][0],$this->ldapcharset);
$this->mobile = $this->convToOutputCharset($result[0][$this->attr_mobile][0],$this->ldapcharset);

View File

@ -214,7 +214,7 @@ function getTop(theitem){
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined")
offsetLeft += document.body.TopMargin;
offsetTop += document.body.TopMargin;
return offsetTop;
}

View File

@ -404,7 +404,7 @@ function agenda_prepare_head()
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function actions_prepare_head($object)

View File

@ -555,6 +555,11 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '<td>'.$langs->trans("PhoneMobile").'</td>';
print '<td>'.$langs->trans("Fax").'</td>';
print '<td>'.$langs->trans("EMail").'</td>';
if (! empty($conf->skype->enabled))
{
$colspan++;
print '<td>'.$langs->trans("Skype").'</td>';
}
print '<td>'.$langs->trans("Status").'</td>';
print "<td>&nbsp;</td>";
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
@ -570,7 +575,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print "</tr>";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.statut ";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut ";
$sql .= ", p.civilite, p.address, p.zip, p.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
@ -614,6 +619,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '<td>';
print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL');
print '</td>';
if (! empty($conf->skype->enabled))
{
print '<td>';
print dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE');
print '</td>';
}
if ($obj->statut==0) print '<td>'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0').'</td>';
elseif ($obj->statut==1) print '<td>'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').'</td>';

View File

@ -166,10 +166,10 @@ function getParentCompanyTimeZoneInt($refgmtdate='now')
/**
* Add a delay to a date
*
* @param timestamp $time Date timestamp (or string with format YYYY-MM-DD)
* @param int $time Date timestamp (or string with format YYYY-MM-DD)
* @param int $duration_value Value of delay to add
* @param int $duration_unit Unit of added delay (d, m, y, w)
* @return timestamp New timestamp
* @return int New timestamp
*/
function dol_time_plus_duree($time,$duration_value,$duration_unit)
{
@ -317,7 +317,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
* DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore)
* @param int $gm 1 =Input date is GM date,
* 0 =Input date is local date using PHP server timezone
* @return date Date
* @return int Date as a timestamp
* 19700101020000 -> 7200 with gm=1
*
* @see dol_print_date, dol_mktime, dol_getdate
@ -812,4 +812,4 @@ function monthArray($outputlangs)
return $montharray;
}
?>
?>

View File

@ -26,7 +26,7 @@
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head($object)
@ -66,7 +66,7 @@ function ecm_file_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head_fm($object)

View File

@ -398,16 +398,17 @@ function dol_dir_is_emtpy($folder)
if (is_dir($newfolder))
{
$handle = opendir($newfolder);
$folder_content = '';
while ((gettype($name = readdir($handle)) != "boolean"))
{
$name_array[] = $name;
}
foreach($name_array as $temp) $folder_content .= $temp;
closedir($handle);
if ($folder_content == "...") return true;
else return false;
closedir($handle);
}
else
return true; // Dir does not exists
@ -448,7 +449,7 @@ function dol_count_nb_of_line($file)
/**
* Return size of a file
*
* @param tring $pathoffile Path of file
* @param string $pathoffile Path of file
* @return string File size
*/
function dol_filesize($pathoffile)
@ -461,7 +462,7 @@ function dol_filesize($pathoffile)
* Return time of a file
*
* @param string $pathoffile Path of file
* @return timestamp Time of file
* @return int Time of file
*/
function dol_filemtime($pathoffile)
{
@ -830,7 +831,7 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0)
/**
* Delete all preview files linked to object instance
*
* @param Object $object Object to clean
* @param object $object Object to clean
* @return int 0 if error, 1 if OK
*/
function dol_delete_preview($object)
@ -995,9 +996,10 @@ function dol_init_file_process($pathtoscan='')
* @param int $donotupdatesession 1=Do no edit _SESSION variable
* @param string $varfiles _FILES var name
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param string $link Link to add
* @return void
*/
function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='')
function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null)
{
global $db,$user,$conf,$langs;
@ -1054,6 +1056,23 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
}
}
}
} elseif ($link) {
if (dol_mkdir($upload_dir) >= 0) {
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
$linkObject = new Link($db);
$linkObject->entity = $conf->entity;
$linkObject->url = $link;
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
$linkObject->objectid = GETPOST('objectid', 'int');
$linkObject->label = GETPOST('label', 'alpha');
$res = $linkObject->create($user);
$langs->load('link');
if ($res > 0) {
setEventMessage($langs->trans("LinkComplete"));
} else {
setEventMessage($langs->trans("ErrorFileNotLinked"), 'errors');
}
}
}
else
{

View File

@ -9,6 +9,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -44,7 +45,7 @@ if (! function_exists('json_encode'))
*
* @param string $class Class name
* @param string $member Name of property
* @return string Return value of static property.
* @return mixed Return value of static property
*/
function getStaticMember($class, $member)
{
@ -775,7 +776,7 @@ function dol_strftime($fmt, $ts=false, $is_gmt=false)
* Output date in a string format according to outputlangs (or langs if not defined).
* Return charset is always UTF-8, except if encodetoouput is defined. In this case charset is output charset
*
* @param timestamp $time GM Timestamps date
* @param int $time GM Timestamps date
* @param string $format Output date format
* "%d %b %Y",
* "%d/%m/%Y %H:%M",
@ -931,7 +932,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
* WARNING: This function always use PHP server timezone to return locale informations.
* Usage must be avoid.
*
* @param timestamp $timestamp Timestamp
* @param int $timestamp Timestamp
* @param boolean $fast Fast mode
* @return array Array of informations
* If no fast mode:
@ -988,7 +989,7 @@ function dol_getdate($timestamp,$fast=false)
* @param int $year Year
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
* @param int $check 0=No check on parameters (Can use day 32, etc...)
* @return timestamp Date as a timestamp, '' if error
* @return int Date as a timestamp, '' if error
* @see dol_print_date, dol_stringtotime, dol_getdate
*/
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
@ -1047,7 +1048,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
* 'tzserver' => we add the PHP server timezone
* 'tzref' => we add the company timezone
* 'tzuser' => we add the user timezone
* @return timestamp $date Timestamp
* @return int $date Timestamp
*/
function dol_now($mode='gmt')
{
@ -1185,6 +1186,48 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=
return $newemail;
}
/**
* Show Skype link
*
* @param string $skype Skype to show (only skype, without 'Name of recipient' before)
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param int $addlink 0=no link to create action
* @param int $max Max number of characters to show
* @return string HTML Link
*/
function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
{
global $conf,$user,$langs;
$newskype=$skype;
if (empty($skype)) return '&nbsp;';
if (! empty($addlink))
{
$newskype='<a href="skype:';
$newskype.=dol_trunc($skype,$max);
$newskype.='" alt="'.$langs->trans("Call").'&nbsp;'.$skype.'" title="'.$langs->trans("Call").'&nbsp;'.$skype.'">';
$newskype.='<img src="../theme/'.$conf->theme.'/img/object_skype.png" border="0">&nbsp;';
$newskype.=dol_trunc($skype,$max);
$newskype.='</a>';
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
$type='AC_SKYPE'; $link='';
if (! empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) $link='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;actioncode='.$type.'&amp;contactid='.$cid.'&amp;socid='.$socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
$newskype='<table class="nobordernopadding"><tr><td>'.$newskype.' </td><td>&nbsp;'.$link.'</td></tr></table>';
}
}
else
{
$langs->load("errors");
$newskype.=img_warning($langs->trans("ErrorBadSkype",$skype));
}
return $newskype;
}
/**
* Format phone numbers according to country
*
@ -2877,7 +2920,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
* Instead this function must be called when adding a line to get (array of localtax and type) and
* provide it to the function calcul_price_total.
*
* @param real $vatrate VAT Rate
* @param float $vatrate VAT Rate
* @param int $local Number of localtax (1 or 2, or 0 to return 1 & 2)
* @param int $thirdparty Company object
* @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...)

View File

@ -178,7 +178,7 @@ function dol_print_file($langs,$filename,$searchalt=0)
* Show informations on an object
* TODO Move this into html.formother
*
* @param Object $object Objet to show
* @param object $object Objet to show
* @return void
*/
function dol_print_object_info($object)
@ -205,13 +205,15 @@ function dol_print_object_info($object)
print $langs->trans("CreatedBy").': ';
if (is_object($object->user_creation))
{
print $object->user_creation->getNomUrl(1);
if ($object->user_creation->id) print $object->user_creation->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_creation);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}
@ -230,13 +232,15 @@ function dol_print_object_info($object)
print $langs->trans("ModifiedBy").': ';
if (is_object($object->user_modification))
{
print $object->user_modification->getNomUrl(1);
if ($object->user_modification->id) print $object->user_modification->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_modification);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}
@ -255,13 +259,15 @@ function dol_print_object_info($object)
print $langs->trans("ValidatedBy").': ';
if (is_object($object->user_validation))
{
print $object->user_validation->getNomUrl(1);
if ($object->user_validation->id) print $object->user_validation->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_validation);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}
@ -280,13 +286,15 @@ function dol_print_object_info($object)
print $langs->trans("ApprovedBy").': ';
if (is_object($object->user_approve))
{
print $object->user_approve->getNomUrl(1);
if ($object->user_approve->id) print $object->user_approve->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_approve);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}
@ -305,13 +313,15 @@ function dol_print_object_info($object)
print $langs->trans("ClosedBy").': ';
if (is_object($object->user_cloture))
{
print $object->user_cloture->getNomUrl(1);
if ($object->user_cloture->id) print $object->user_cloture->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_cloture);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}
@ -330,13 +340,15 @@ function dol_print_object_info($object)
print $langs->trans("ConciliatedBy").': ';
if (is_object($object->user_rappro))
{
print $object->user_rappro->getNomUrl(1);
if ($object->user_rappro->id) print $object->user_rappro->getNomUrl(1);
else print $langs->trans("Unknown");
}
else
{
$userstatic=new User($db);
$userstatic->fetch($object->user_rappro);
print $userstatic->getNomUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print $langs->trans("Unknown");
}
print '<br>';
}

View File

@ -1512,7 +1512,7 @@ function pdf_getTotalQty($object,$type,$outputlangs)
*
* @param object $object Object
* @param Translate $outputlangs Object lang for output
* @return void
* @return array Linked objects
*/
function pdf_getLinkedObjects($object,$outputlangs)
{

View File

@ -1,28 +1,28 @@
<?php
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
* Copyright (C) 2011 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/lib/project.lib.php
* \brief Functions used by project module
* \ingroup project
*/
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -473,19 +473,24 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
print '</td>';
// Planned Workload
print '<td align="center">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all');
print '<td align="right">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
else print '--:--';
print '</td>';
// Progress
// Progress declared %
print '<td align="right">';
print $lines[$i]->progress.' %';
print '</td>';
// Time spent
print '<td align="right">';
if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'all');
if ($lines[$i]->duration)
{
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
print convertSecondToTime($lines[$i]->duration,'allhourmin');
print '</a>';
}
else print '--:--';
print "</td>\n";

View File

@ -26,7 +26,7 @@
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function propal_prepare_head($object)
@ -147,4 +147,4 @@ function propal_admin_prepare_head($object)
}
?>
?>

View File

@ -69,21 +69,25 @@ function dol_decode($chain)
/**
* Returns a hash of a string
* Returns a hash of a string.
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (md5 by default)
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt
*
* @param string $chain String to hash
* @param int $type Type of hash (0:md5, 1:sha1, 2:sha1+md5)
* @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5)
* @return string Hash of string
*/
function dol_hash($chain,$type=0)
{
global $conf;
// Salt value
if (! empty($conf->global->MAIN_SECURITY_SALT)) $chain=$conf->global->MAIN_SECURITY_SALT.$chain;
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
else return md5($chain);
}

View File

@ -116,7 +116,7 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Tache 1 heure
SUMMARY:Tâche 1 heure
TRANSP:OPAQUE
END:VEVENT
@ -132,7 +132,7 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Tache 1 jour
SUMMARY:Tâche 1 jour
TRANSP:TRANSPARENT
END:VEVENT
*/

View File

@ -98,7 +98,7 @@
<tr>
<td>
<b>__Name__ :</b><br>
__DONATOR_NAME__<br>
__DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__<br>
<b>__Address__ :</b><br>
__DONATOR_ADDRESS__<br>
<b>__Zip__ :</b> __DONATOR_ZIP__<br>

View File

@ -143,7 +143,8 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form);
$form = str_replace('__DONATOR_NAME__',$don->nom,$form);
$form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form);
$form = str_replace('__DONATOR_LASTNAME__',$don->lastname,$form);
$form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
$form = str_replace('__DONATOR_ZIP__',$don->zip,$form);
$form = str_replace('__DONATOR_TOWN__',$don->town,$form);

View File

@ -125,28 +125,28 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 41; // id de la permission
$this->rights[$r][1] = "Lire les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Lire les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 42; // id de la permission
$this->rights[$r][1] = "Creer/modifier les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Creer/modifier les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 44; // id de la permission
$this->rights[$r][1] = "Supprimer les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Supprimer les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 141; // id de la permission
$this->rights[$r][1] = "Lire tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Lire tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';
@ -154,7 +154,7 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 142; // id de la permission
$this->rights[$r][1] = "Creer/modifier tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Creer/modifier tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';
@ -162,7 +162,7 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 144; // id de la permission
$this->rights[$r][1] = "Supprimer tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Supprimer tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';

View File

@ -0,0 +1,136 @@
<?php
/* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \defgroup Skype Module Skype
* \brief Add a skype button.
* \file htdocs/core/modules/modSkype.class.php
* \ingroup Skype
* \brief Description and activation file for module Skype
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* Class to describe a Cron module
*/
class modSkype extends DolibarrModules
{
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
global $langs,$conf;
$this->db = $db;
$this->numero = 3100;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "crm";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable Skype button into contact";
$this->version = 'experimental'; // 'experimental' or 'dolibarr' or version
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 2;
// Name of image file used for this module.
$this->picto='skype';
// Data directories to create when module is enabled
$this->dirs = array();
// Config pages
//-------------
$this->config_page_url = array();
// Dependancies
//-------------
$this->hidden = ! empty($conf->global->SKYPE_MODULE_DISABLED); // A condition to disable module
$this->depends = array('modSociete'); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array(); // List of modules id this module is in conflict with
$this->langfiles = array();
// Constantes
//-----------
// New pages on tabs
// -----------------
$this->tabs = array();
// Boxes
//------
$this->boxes = array();
// Permissions
//------------
$this->rights = array(); // Permission array used by this module
$this->rights_class = 'skype';
$r=0;
$this->rights[$r][0] = 3101;
$this->rights[$r][1] = 'View skype link';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'view';
$r++;
// Main menu entries
//------------------
$this->menu = array();
}
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
{
// Prevent pb of modules not correctly disabled
//$this->remove($options);
return $this->_init($sql,$options);
}
/**
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function remove($options='')
{
$sql = array();
return $this->_remove($sql,$options);
}
}
?>

View File

@ -147,7 +147,7 @@ abstract class ModeleNumRefPropales
* Create a document onto disk according to template module.
*
* @param DoliDB $db Database handler
* @param Object $object Object proposal
* @param object $object Object proposal
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines

View File

@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/*
* Confirm suppression
*/
if ($action == 'delete') {
$ret = $form->form_confirm(
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'),
$langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'),
'confirm_deletefile',
'',
0,
1
);
if ($ret == 'html') print '<br>';
}
$formfile=new FormFile($db);
// Show upload form
$formfile->form_attach_new_file(
$_SERVER["PHP_SELF"].'?id='.$object->id,
'',
0,
0,
$permission,
50,
$object
);
// List of document
$formfile->list_of_documents(
$filearray,
$object,
$modulepart,
$param,
0,
'',
$permission
);
print "<br>";
//List of links
$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'));
print "<br>";

View File

@ -0,0 +1,88 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
// Send file/link
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($object->id) {
dol_add_file_process($upload_dir, 0, 1, 'userfile');
}
} elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($object->id) {
$link = GETPOST('link', 'alpha');
if ($link) {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
$link = 'http://' . $link;
}
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link);
}
}
}
// Delete file/link
if ($action == 'confirm_deletefile' && $confirm == 'yes') {
if ($object->id) {
$urlfile = GETPOST('urlfile', 'alpha');
$linkid = GETPOST('linkid', 'int');
if ($urlfile) {
$file = $upload_dir . "/" . $urlfile; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessage($langs->trans("FileWasRemoved", $urlfile));
} else {
setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors');
}
} elseif ($linkid) {
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
$link = new Link($db);
$link->id = $linkid;
$link->fetch();
$res = $link->delete($user);
$langs->load('link');
if ($res) {
setEventMessage($langs->trans("LinkRemoved", $link->label));
} else {
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
}
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
exit;
}
} elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'alpha')) {
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
$langs->load('link');
$link = new Link($db);
$link->id = GETPOST('linkid', 'int');
$f = $link->fetch();
if ($f) {
$link->url = GETPOST('link', 'alpha');
if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://') {
$link->url = 'http://' . $link->url;
}
$link->label = GETPOST('label', 'alpha');
$res = $link->update($user);
if (!$res) {
setEventMessage($langs->trans("ErrorFailedToUpdateLink", $link->label));
}
} else {
//error fetching
}
}

View File

@ -120,7 +120,7 @@ if ($action=='add')
$object->unitfrequency=GETPOST('unitfrequency','int');
$object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int');
//Ajout de la tache cron
//Add cron task
$result = $object->create($user);
// test du Resultat de la requete
@ -154,7 +154,7 @@ if ($action=='update')
$object->unitfrequency=GETPOST('unitfrequency','int');
$object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int');
//Ajout de la tache cron
//Add cron task
$result = $object->update($user);
// test du Resultat de la requete
@ -172,7 +172,7 @@ if ($action=='activate')
{
$object->status=1;
//Ajout de la tache cron
//Add cron task
$result = $object->update($user);
// test du Resultat de la requete
@ -189,7 +189,7 @@ if ($action=='activate')
if ($action=='inactive')
{
$object->status=0;
//Ajout de la tache cron
//Add cron task
$result = $object->update($user);
// test du Resultat de la requete

View File

@ -79,7 +79,7 @@ if (!empty($search_label))
// Delete jobs
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){
//Delete de la tache cron
//Delete cron task
$object = new Cronjob($db);
$object->id=$id;
$result = $object->delete($user);

View File

@ -39,12 +39,20 @@ class EcmDirectory // extends CommonObject
var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated'
var $date_c;
var $date_m;
public $fk_user_m;
public $fk_user_c;
public $ref;
var $cats=array();
var $motherof=array();
var $forbiddenchars = array('<','>',':','/','\\','?','*','|','"');
public $full_arbo_loaded;
public $error;
public $errors;
/**
* Constructor
@ -490,7 +498,8 @@ class EcmDirectory // extends CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
while ($obj= $this->db->fetch_object($resql))
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->motherof[$obj->id_son]=$obj->id_parent;
}
@ -555,6 +564,7 @@ class EcmDirectory // extends CommonObject
{
$this->cats = array();
$i=0;
// This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql))
{
$this->cats[$obj->rowid]['id'] = $obj->rowid;
@ -642,8 +652,6 @@ class EcmDirectory // extends CommonObject
$this->build_path_from_id_categ($val,$protection);
}
}
return 1;
}
/**

View File

@ -406,7 +406,7 @@ print '</div>';
if ($action == 'delete' && empty($conf->use_javascript_ajax))
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
}
dol_htmloutput_mesg($mesg);
@ -456,7 +456,7 @@ print '</div>';
if ($action == 'delete_section')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
}
// End confirm
@ -775,7 +775,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section))
{
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0);
}
else print '&nbsp;';

View File

@ -569,7 +569,7 @@ class Expedition extends CommonObject
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
// afin de ne pas perdre les fichiers attaches
// in order not to lose the attached files
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($numref);
$dirsource = $conf->expedition->dir_output.'/sending/'.$oldref;

View File

@ -71,7 +71,7 @@ print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup');
$head=fichinter_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Ficheinter"), 0, 'fichinter');
dol_fiche_head($head, 'attributes', $langs->trans("Interventions"), 0, 'intervention');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";

View File

@ -607,9 +607,9 @@ class Fichinter extends CommonObject
}
/**
* Information sur l'objet fiche intervention
* Load information on object
*
* @param int $id Id de la fiche d'intervention
* @param int $id Id of object
* @return void
*/
function info($id)
@ -625,13 +625,12 @@ class Fichinter extends CommonObject
$sql.= " WHERE f.rowid = ".$id;
$sql.= " AND f.entity = ".$conf->entity;
$result = $this->db->query($sql);
if ($result)
$resql = $this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($result))
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($result);
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
@ -649,7 +648,7 @@ class Fichinter extends CommonObject
$this->user_validation = $vuser;
}
}
$this->db->free($result);
$this->db->free($resql);
}
else
{

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -71,29 +72,7 @@ $modulepart='fichinter';
* Actions
*/
if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_add_file_process($upload_dir,0,1,'userfile');
}
// Delete
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id > 0)
{
$langs->load("other");
$object->fetch_thirdparty();
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -141,23 +120,10 @@ if ($object->id)
print '</div>';
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id,'',0,0,$user->rights->ficheinter->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'ficheinter',$param);
$modulepart = 'ficheinter';
$permission = $user->rights->ficheinter->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else

View File

@ -1,29 +1,29 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/fichinter/fiche.php
* \brief Fichier fiche intervention
* \ingroup ficheinter
*/
* \brief Fichier fiche intervention
* \ingroup ficheinter
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
@ -79,16 +79,22 @@ $object = new Fichinter($db);
$extrafields = new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
if ($ret > 0) $ret=$object->fetch_thirdparty();
if ($ret < 0) dol_print_error('',$object->error);
}
/*
* Actions
*/
*/
if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->setValid($user);
if ($result >= 0)
{
@ -114,9 +120,6 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein
else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->setDraft($user);
if ($result >= 0)
{
@ -309,8 +312,6 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
else if ($action == 'update' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$object->socid = $socid;
$object->fk_project = GETPOST('projectid','int');
$object->fk_contrat = GETPOST('contratid','int');
@ -326,11 +327,9 @@ else if ($action == 'update' && $user->rights->ficheinter->creer)
/*
* Build doc
*/
*/
else if ($action == 'builddoc' && $user->rights->ficheinter->creer) // En get ou en post
{
$object->fetch($id);
$object->fetch_thirdparty();
$object->fetch_lines();
// Save last template used to generate document
@ -357,25 +356,21 @@ else if ($action == 'builddoc' && $user->rights->ficheinter->creer) // En get ou
// Remove file in doc form
else if ($action == 'remove_file')
{
if ($object->fetch($id))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$object->fetch_thirdparty();
$object->fetch_thirdparty();
$langs->load("other");
$upload_dir = $conf->ficheinter->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
$langs->load("other");
$upload_dir = $conf->ficheinter->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
// Set into a project
else if ($action == 'classin' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->setProject(GETPOST('projectid','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
@ -383,15 +378,12 @@ else if ($action == 'classin' && $user->rights->ficheinter->creer)
// Set into a contract
else if ($action == 'setcontrat' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result=$object->set_contrat($user,GETPOST('contratid','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->ficheinter->supprimer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result=$object->delete($user);
if ($result<0) {
setEventMessage($object->error,'errors');
@ -403,19 +395,16 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fich
else if ($action == 'setdescription' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->set_description($user,GETPOST('description'));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES), '_private');
if ($result < 0) dol_print_error($db,$object->error);
}
@ -433,13 +422,15 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Duration")).'</div>';
$error++;
}
if (GETPOST('durationhour','int') >= 24 && GETPOST('durationmin','int') > 0)
{
$mesg='<div class="error">'.$langs->trans("ErrorValueTooHigh").'</div>';
$error++;
}
if (! $error)
{
$db->begin();
$ret=$object->fetch($id);
$object->fetch_thirdparty();
$desc=GETPOST('np_desc');
$date_intervention = dol_mktime(GETPOST('dihour','int'), GETPOST('dimin','int'), 0, GETPOST('dimonth','int'), GETPOST('diday','int'), GETPOST('diyear','int'));
$duration = convertTime2Seconds(GETPOST('durationhour','int'), GETPOST('durationmin','int'));
@ -482,7 +473,6 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
// Classify Billed
else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->setBilled();
if ($result > 0)
{
@ -582,8 +572,6 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'up' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$object->line_up(GETPOST('line_id','int'));
// Define output language
@ -603,8 +591,6 @@ else if ($action == 'up' && $user->rights->ficheinter->creer)
else if ($action == 'down' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$object->line_down(GETPOST('line_id','int'));
// Define output language
@ -661,159 +647,148 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
{
$langs->load('mails');
if ($object->fetch($id) > 0)
if (GETPOST('sendto','alpha'))
{
$object->fetch_thirdparty();
if (GETPOST('sendto','alpha'))
// Le destinataire a ete fourni via le champ libre
$sendto = GETPOST('sendto','alpha');
$sendtoid = 0;
}
elseif (GETPOST('receiver','alpha') != '-1')
{
// Recipient was provided from combo list
if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party
{
// Le destinataire a ete fourni via le champ libre
$sendto = GETPOST('sendto','alpha');
$sendto = $object->client->email;
$sendtoid = 0;
}
elseif (GETPOST('receiver','alpha') != '-1')
else // Id du contact
{
// Recipient was provided from combo list
if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party
$sendto = $object->client->contact_get_property(GETPOST('receiver'),'email');
$sendtoid = GETPOST('receiver','alpha');
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
$from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>';
$replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>';
$message = GETPOST('message');
$sendtocc = GETPOST('sendtocc','alpha');
$deliveryreceipt = GETPOST('deliveryreceipt','alpha');
if ($action == 'send')
{
if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha');
else $subject = $langs->transnoentities('Intervention').' '.$object->ref;
$actiontypecode='AC_OTH_AUTO';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
$sendto = $object->client->email;
$sendtoid = 0;
}
else // Id du contact
{
$sendto = $object->client->contact_get_property(GETPOST('receiver'),'email');
$sendtoid = GETPOST('receiver','alpha');
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
}
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
}
if (dol_strlen($sendto))
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
// Envoi de la propal
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
if ($mailfile->error)
{
$langs->load("commercial");
$from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>';
$replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>';
$message = GETPOST('message');
$sendtocc = GETPOST('sendtocc','alpha');
$deliveryreceipt = GETPOST('deliveryreceipt','alpha');
if ($action == 'send')
$mesg='<div class="error">'.$mailfile->error.'</div>';
}
else
{
$result=$mailfile->sendfile();
if ($result)
{
if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha');
else $subject = $langs->transnoentities('Intervention').' '.$object->ref;
$actiontypecode='AC_OTH_AUTO';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessage($mesg);
$error=0;
// Initialisation donnees
$object->sendtoid = $sendtoid;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg;
$object->actionmsg2 = $actionmsg2;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('FICHINTER_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
}
// Fin appel triggers
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
// Envoi de la propal
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
if ($mailfile->error)
{
$mesg='<div class="error">'.$mailfile->error.'</div>';
if ($error)
{
dol_print_error($db);
}
else
{
// Redirect here
// This avoid sending mail twice if going out and then back to page
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
else
{
$result=$mailfile->sendfile();
if ($result)
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessage($mesg);
$error=0;
// Initialisation donnees
$object->sendtoid = $sendtoid;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg;
$object->actionmsg2 = $actionmsg2;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('FICHINTER_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
if ($error)
{
dol_print_error($db);
}
else
{
// Redirect here
// This avoid sending mail twice if going out and then back to page
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
else
{
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error;
}
else
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
}
}
}
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
dol_syslog('Recipient email is empty');
}
}
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Intervention")).'</div>';
dol_syslog('Impossible de lire les donnees de l\'intervention. Le fichier intervention n\'a peut-etre pas ete genere.');
}
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error;
}
else
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
}
}
}
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
dol_syslog('Recipient email is empty');
}
$action='presend';
}
else if ($action == 'update_extras')
{
$object->fetch($id);
// Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('interventiondao'));
$parameters=array('id'=>$object->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if ($ret < 0) $error++;
if (! $error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('interventiondao'));
$parameters=array('id'=>$object->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
$result=$object->insertExtraFields();
if ($result < 0)
@ -821,16 +796,16 @@ else if ($action == 'update_extras')
$error++;
}
}
else if ($reshook < 0) $error++;
}
else if ($reshook < 0) $error++;
if ($error) $action = 'edit_extras';
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheinter->creer)
{
if ($action == 'addcontact')
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int'));
@ -859,20 +834,12 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheint
// bascule du statut d'un contact
else if ($action == 'swapstatut')
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
else
{
dol_print_error($db);
}
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
// Efface un contact
else if ($action == 'deletecontact')
{
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int'));
if ($result >= 0)
@ -901,8 +868,8 @@ if ($action == 'create')
{
/*
* Mode creation
* Creation d'une nouvelle fiche d'intervention
*/
* Creation d'une nouvelle fiche d'intervention
*/
$soc=new Societe($db);
@ -1285,19 +1252,11 @@ else if ($id > 0 || ! empty($ref))
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
// Other attributes
// Other attributes (TODO Move this into an include)
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if ($action == 'edit_extras')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formfichinter">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
@ -1319,35 +1278,27 @@ else if ($id > 0 || ! empty($ref))
{
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
}
if ($action == 'edit_extras' && $user->rights->ficheinter->creer)
if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formfichinter">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print $extrafields->showOutputField($key,$value);
if ($object->statut == 0 && $user->rights->ficheinter->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
}
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->ficheinter->creer)
{
print '<tr><td></td><td colspan="3">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
if ($object->statut == 0 && $user->rights->ficheinter->creer)
{
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
}
}
}
}
print "</table><br>";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -31,32 +31,36 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$langs->load('companies');
$langs->load("interventions");
$fichinterid = GETPOST('id','int');
$id = GETPOST('id','int');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
$object = new Fichinter($db);
if ($id > 0)
{
$object->fetch($id);
}
/*
* View
*/
* View
*/
llxHeader();
$fichinter = new Fichinter($db);
$fichinter->fetch($fichinterid);
$societe = new Societe($db);
$societe->fetch($fichinter->socid);
$societe->fetch($object->socid);
$head = fichinter_prepare_head($fichinter);
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention');
$fichinter->info($fichinter->id);
$object->info($object->id);
print '<table width="100%"><tr><td>';
dol_print_object_info($fichinter);
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
@ -29,7 +29,7 @@
* \brief File that include conf.php file and commons lib like functions.lib.php
*/
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.0-alpha');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.0-beta');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@ -355,7 +355,7 @@ class CommandeFournisseur extends CommonOrder
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref)
// afin de ne pas perdre les fichiers attaches
// in order not to lose the attached files
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->fournisseur->dir_output.'/commande/'.$oldref;

View File

@ -897,7 +897,7 @@ class FactureFournisseur extends CommonInvoice
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
// afin de ne pas perdre les fichiers attaches
// in order not to lose the attached files
$facref = dol_sanitizeFileName($this->ref);
$snumfa = dol_sanitizeFileName($num);

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -22,7 +23,7 @@
/**
* \file htdocs/fourn/commande/document.php
* \ingroup supplier
* \brief Page de gestion des documents attachees a une commande fournisseur
* \brief Page de gestion des documents attaches a une commande fournisseur
*/
require '../../main.inc.php';
@ -77,26 +78,7 @@ $object->fetch_thirdparty();
* Actions
*/
// Envoi fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
dol_add_file_process($upload_dir,0,1,'userfile');
}
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id > 0)
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -176,23 +158,11 @@ if ($object->id > 0)
print "</div>\n";
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
}
$modulepart = 'commande_fournisseur';
$permission = $user->rights->fournisseur->commande->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id,'',0,0,$user->rights->fournisseur->commande->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'commande_fournisseur',$param);
}
else
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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
@ -21,7 +22,7 @@
/**
* \file htdocs/fourn/facture/document.php
* \ingroup facture, fournisseur
* \brief Page de gestion des documents attachees a une facture fournisseur
* \brief Page de gestion des documents attaches a une facture fournisseur
*/
require '../../main.inc.php';
@ -71,29 +72,7 @@ if ($object->fetch($id, $ref))
* Actions
*/
// Envoi fichier
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->id > 0)
{
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
}
}
// Delete
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id > 0)
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
@ -198,17 +177,10 @@ if ($object->id > 0)
print '</table>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?facid='.$object->id, '', 0, 0, $user->rights->fournisseur->facture->creer, 50, $object, '', 0, dol_sanitizeFileName($object->ref.'_'.$object->ref_supplier.'___file__'));
// List of document
$param='&facid='.$object->id;
$ref=dol_sanitizeFileName($object->ref);
$formfile->list_of_documents($filearray,$object,'facture_fournisseur',$param,0,get_exdir($object->id,2,0).$ref.'/');
$modulepart = 'facture_fournisseur';
$permission = $user->rights->fournisseur->facture->creer;
$param = '&facid=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
@ -218,4 +190,4 @@ else
llxFooter();
$db->close();
?>
?>

View File

@ -1688,18 +1688,15 @@ else
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum=1;
else $calculationrulenum=2;
$s=$langs->trans("ReCalculate").' ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s.=' / ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
}
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum=1;
else $calculationrulenum=2;
$s=$langs->trans("ReCalculate").' ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s.=' / ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
print '</td></tr>';
// Amount Local Taxes

View File

@ -99,8 +99,6 @@ if ($object->fetch($id))
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="50%" class="notopnoleft">';
print '<table width="100%" class="border">';
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
@ -263,7 +261,7 @@ if ($object->fetch($id))
}
else
{
print $langs->trans("UserNotLinkedToMember");
print $langs->trans("ThirdpartyNotLinkedToMember");
}
print '</td>';
print "</tr>\n";
@ -273,7 +271,6 @@ if ($object->fetch($id))
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%" class="notopnoleftnoright">';
$var=true;
@ -428,8 +425,6 @@ if ($object->fetch($id))
print '</div></div></div>';
print '<div style="clear:both"></div>';
//print '</td></tr>';
//print '</table>' . "\n";
dol_fiche_end();

View File

@ -71,7 +71,7 @@ $ftp_user=$conf->global->$s_ftp_user;
$ftp_password=$conf->global->$s_ftp_password;
$ftp_passive=$conf->global->$s_ftp_passive;
$conn_id=0; // FTP connection ID
$conn_id=null; // FTP connection ID

View File

@ -90,6 +90,17 @@ create table llx_categorie_contact
import_key varchar(14)
)ENGINE=innodb;
create table llx_links
(
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
entity INTEGER DEFAULT 1 NOT NULL, -- multi company id
datea DATETIME NOT NULL, -- date start
url VARCHAR(255) NOT NULL, -- link url
label VARCHAR(255) NOT NULL, -- link label
objecttype VARCHAR(255) NOT NULL, -- object type in Dolibarr
objectid INTEGER NOT NULL
)ENGINE=innodb;
ALTER TABLE llx_categorie_contact ADD PRIMARY KEY pk_categorie_contact (fk_categorie, fk_socpeople);
ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_categorie (fk_categorie);
@ -331,3 +342,9 @@ create table llx_actioncomm_resources
) ENGINE=innodb;
ALTER TABLE llx_actioncomm_resources ADD UNIQUE INDEX idx_actioncomm_resources_idx1 (fk_actioncomm, element_type, fk_element);
ALTER TABLE llx_actioncomm_resources ADD INDEX idx_actioncomm_resources_fk_element (fk_element);
-- Task 157
ALTER TABLE llx_user ADD skype VARCHAR(255) AFTER job;
ALTER TABLE llx_socpeople ADD skype VARCHAR(255) AFTER jabberid;
ALTER TABLE llx_societe ADD skype VARCHAR(255) AFTER email;
ALTER TABLE llx_adherent ADD skype VARCHAR(255) AFTER email;

View File

@ -45,6 +45,7 @@ create table llx_adherent
state_id integer,
country integer,
email varchar(255),
skype varchar(255),
phone varchar(30),
phone_perso varchar(30),
phone_mobile varchar(30),

View File

@ -1,5 +1,5 @@
-- ============================================================================
-- Copyright (C) 2013 Juanjo Menent <regis.houssin@capnetworks.com>
-- ========================================================================
-- Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
--
-- 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
@ -14,13 +14,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ===========================================================================
--
-- Actions commerciales
-- ========================================================================
create table llx_soc_localtaxes
create table llx_links
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer,
fk_tva integer,
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
)ENGINE=innodb;
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
entity INTEGER DEFAULT 1 NOT NULL, -- multi company id
datea DATETIME NOT NULL, -- date start
url VARCHAR(255) NOT NULL, -- link url
label VARCHAR(255) NOT NULL, -- link label
objecttype VARCHAR(255) NOT NULL, -- object type in Dolibarr
objectid INTEGER NOT NULL
)ENGINE=innodb;

View File

@ -17,17 +17,17 @@
CREATE TABLE llx_opensurvey_sondage (
id_sondage VARCHAR(16) PRIMARY KEY,
id_sondage_admin CHAR(24),
id_sondage_admin VARCHAR(24),
commentaires text,
mail_admin VARCHAR(128),
nom_admin VARCHAR(64),
titre text,
date_fin datetime,
titre TEXT,
date_fin DATETIME,
format VARCHAR(2),
mailsonde varchar(2) DEFAULT '0',
survey_link_visible integer DEFAULT 1,
canedit integer DEFAULT 0,
origin varchar(64),
tms timestamp,
origin VARCHAR(64),
tms TIMESTAMP,
sujet TEXT
) ENGINE=InnoDB;

View File

@ -1,22 +0,0 @@
-- ============================================================================
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ============================================================================
ALTER TABLE llx_soc_localtax ADD UNIQUE INDEX uk_soc_localtax_tax (fk_soc, fk_tax);
ALTER TABLE llx_propal ADD INDEX idx_soc_localtax_fk_soc (fk_soc);

View File

@ -49,6 +49,7 @@ create table llx_societe
fax varchar(20), -- fax number
url varchar(255), --
email varchar(128), --
skype varchar(255), --
fk_effectif integer DEFAULT 0, --
fk_typent integer DEFAULT 0, --
fk_forme_juridique integer DEFAULT 0, -- juridical status

View File

@ -42,6 +42,7 @@ create table llx_socpeople
fax varchar(30),
email varchar(255),
jabberid varchar(255),
skype varchar(255),
no_email smallint NOT NULL DEFAULT 0,
priv smallint NOT NULL DEFAULT 0,
fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement

View File

@ -41,6 +41,7 @@ create table llx_user
fk_state integer DEFAULT 0, --
fk_country integer DEFAULT 0, --
job varchar(128),
skype varchar(255),
office_phone varchar(20),
office_fax varchar(20),
user_mobile varchar(20),

View File

@ -487,6 +487,8 @@ Module2700Desc= Use online Gravatar service (www.gravatar.com) to show photo of
Module2800Desc=FTP Client
Module2900Name= GeoIPMaxmind
Module2900Desc= GeoIP Maxmind conversions capabilities
Module3100Name= Skype
Module3100Desc= Add a Skype button into card of adherents / third parties / contacts
Module5000Name=Multi-company
Module5000Desc=Allows you to manage multiple companies
Module6000Name=Workflow
@ -972,6 +974,8 @@ ExtraFieldsThirdParties=Complementary attributes (thirdparty)
ExtraFieldsContacts=Complementary attributes (contact/address)
ExtraFieldsMember=Complementary attributes (member)
ExtraFieldsMemberType=Complementary attributes (member type)
ExtraFieldsCustomerOrders=Complementary attributes (orders)
ExtraFieldsCustomerInvoices=Complementary attributes (invoices)
ExtraFieldsSupplierOrders=Complementary attributes (orders)
ExtraFieldsSupplierInvoices=Complementary attributes (invoices)
ExtraFieldsProject=Complementary attributes (projects)
@ -1003,6 +1007,7 @@ BrowserIsKO=You are using the web browser %s. This browser is known to be a bad
XDebugInstalled=XDebug est chargé.
XCacheInstalled=XCache is loaded.
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
FieldEdition=Edition of field %s
##### Module password generation
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.

View File

@ -66,6 +66,8 @@ Country=Country
CountryCode=Country code
CountryId=Country id
Phone=Phone
Skype=Skype
Call=Call
PhonePro=Prof. phone
PhonePerso=Pers. phone
PhoneMobile=Mobile

View File

@ -0,0 +1,8 @@
LinkANewFile=Link a new file/document
LinkedFiles=Linked files and documents
NoLinkFound=No registered links
LinkComplete=The file has been linked successfully
ErrorFileNotLinked=The file could not be linked
LinkRemoved=The link %s has been removed
ErrorFailedToDeleteLink= Failed to remove link '<b>%s</b>'
ErrorFailedToUpdateLink= Failed to update link '<b>%s</b>'

View File

@ -155,6 +155,7 @@ Valid=Valid
Approve=Approve
ReOpen=Re-Open
Upload=Send file
ToLink=Link
Select=Select
Choose=Choose
ChooseLangage=Please choose your language

View File

@ -8,6 +8,7 @@ Members=Members
MemberAccount=Member login
ShowMember=Show member card
UserNotLinkedToMember=User not linked to a member
ThirdpartyNotLinkedToMember=Third-party not linked to a member
MembersTickets=Members Tickets
FundationMembers=Foundation members
Attributs=Attributes
@ -118,7 +119,6 @@ LastMembers=Last %s members
LastMembersModified=Last %s modified members
LastSubscriptionsModified=Last %s modified subscriptions
AttributeName=Attribute name
FieldEdition=Edition of field %s
String=String
Text=Text
Int=Int

View File

@ -487,6 +487,8 @@ Module2700Desc= Utilise le service en ligne Gravatar (www.gravatar.com) pour aff
Module2800Desc=Client FTP
Module2900Name= GeoIPMaxmind
Module2900Desc= Capacités de conversion GeoIP Maxmind
Module3100Name= Skype
Module3100Desc= Ajouter un button Skype dans les fiches adhérents / tiers / contacts
Module5000Name=Multi-société
Module5000Desc=Permet de gérer plusieurs sociétés
Module6000Name=Workflow
@ -972,7 +974,10 @@ ExtraFieldsThirdParties=Attributs supplémentaires (tiers)
ExtraFieldsContacts=Attributs supplémentaires (contacts/adresses)
ExtraFieldsMember=Attributs supplémentaires (adhérents)
ExtraFieldsMemberType=Attributs supplémentaires (type d'adhérents)
ExtraFieldsCustomerOrders=Attributs supplémentaires (commandes)
ExtraFieldsCustomerInvoices=Attributs supplémentaires (factures)
ExtraFieldsSupplierOrders=Attributs supplémentaires (commandes)
ExtraFieldsCustomerInvoices=Attributs supplémentaires (factures clients)
ExtraFieldsSupplierInvoices=Attributs supplémentaires (factures)
ExtraFieldsProject=Attributs supplémentaires (projets)
ExtraFieldsProjectTask=Attributs supplémentaires (tâches)
@ -1015,6 +1020,7 @@ EncryptedPasswordInDatabase=Permettre le chiffrement des mots de passe dans la b
DisableForgetPasswordLinkOnLogonPage=Ne pas afficher le lien "Mot de passe oublié" sur la page de connexion
UsersSetup=Configuration du module utilisateurs
UserMailRequired=Email requis pour créer un nouvel utilisateur
FieldEdition=Édition du champ %s
##### Company setup #####
CompanySetup=Configuration du module Tiers
CompanyCodeChecker=Modèle de génération et contrôle des codes tiers (clients/fournisseurs)
@ -1467,8 +1473,8 @@ TestGeoIPResult=Test de conversion IP -> Pays
ProjectsNumberingModules=Modèles de numérotation des références projets
ProjectsSetup=Configuration du module Projets
ProjectsModelModule=Modèles de document de rapport projets
TasksNumberingModules=Modèles de numérotation des références taches
TaskModelModule=Modèles de document de rapport taches
TasksNumberingModules=Modèles de numérotation des références tâches
TaskModelModule=Modèles de document de rapport tâches
##### ECM (GED) #####
ECMSetup = Configuration du module GED
ECMAutoTree = L'arborescence automatique est disponible

View File

@ -66,6 +66,8 @@ Country=Pays
CountryCode=Code pays
CountryId=Identifiant pays
Phone=Téléphone
Skype=Skype
Call=Appeler
PhonePro=Tél pro.
PhonePerso=Tél perso.
PhoneMobile=Tél portable
@ -153,6 +155,12 @@ ProfId3DE=Id. prof. 3 (Handelsregister-Nr.)
ProfId4DE=-
ProfId5DE=-
ProfId6DE=-
ProfId1DZ=Id prof. 1 (RC)
ProfId2DZ=Id prof. 2 (NIF)
ProfId3DZ=Id prof. 3 (AI)
ProfId4DZ=Id prof. 4 (NIS)
ProfId5DZ=-
ProfId6DZ=-
ProfId1ES=Id. prof. 1 (CIF/NIF)
ProfId2ES=Id. prof. 2 (Num. sécurité social)
ProfId3ES=Id. prof. 3 (CNAE)
@ -183,6 +191,12 @@ ProfId3IN=Id. prof. 3 (SRVC TAX)
ProfId4IN=Id. prof. 4
ProfId5IN=Id. prof. 5
ProfId6IN=-
ProfId1LU=Id prof. 1 (SIREN)
ProfId2LU=-
ProfId3LU=Id prof. 3 (APE)
ProfId4LU=Id prof. 4 (RC/RM)
ProfId5LU=-
ProfId6LU=-
ProfId1MA=Id. prof. 1 (R.C.)
ProfId2MA=Id. prof. 2 (Patente)
ProfId3MA=Id. prof. 3 (I.F.)

View File

@ -164,7 +164,7 @@ ReCalculate=Recalculer
Mode1=Mode 1
Mode2=Mode 2
CalculationRuleDesc=Pour calculer le total de TVA, il existe 2 modes:<br>Le mode 1 consiste à arrondir la tva de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquant afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur.
CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquat afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur.
TurnoverPerProductInCommitmentAccountingNotRelevant=Le chiffre d'affaire par produit, dans une comptabilité en mode <b>comptabilité de caisse</b> n'est pas définissable. Ce rapport n'est disponible qu'en mode de comptabilité dit <b>comptabilité d'engagement</b> (voir la configuration du module de comptabilité).
CalculationMode=Mode de calcul
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients

Some files were not shown because too many files have changed in this diff Show More