diff --git a/ChangeLog b/ChangeLog
index ab1fe32aa8f..4618529b009 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@ For users:
- New: Script email_unpaid_invoices_to_representative accepts now a parameter test
and a delay.
- New: Can define a different clicktodial setup per user.
+- New: Add option INVOICE_CAN_NEVER_BE_REMOVED.
- First change to prepare feature click to print for PDF.
For translators:
diff --git a/build/debian/rules b/build/debian/rules
index 6b75c68b85d..5a1cfdc8ecb 100755
--- a/build/debian/rules
+++ b/build/debian/rules
@@ -104,7 +104,6 @@ clean:
rm -fr htdocs/includes/jquery/plugins/flot
rm -fr htdocs/includes/jquery/plugins/jstree
rm -fr htdocs/includes/jquery/plugins/lightbox
- rm -fr htdocs/includes/jquery/plugins/mobile
rm -fr htdocs/includes/jquery/plugins/multiselect
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
diff --git a/dev/resize_window.sh b/dev/resize_window.sh
new file mode 100755
index 00000000000..a26acd796de
--- /dev/null
+++ b/dev/resize_window.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#----------------------------------------------------
+# Script to resize browser window to 1280x1024 to
+# be able to make size fixed screenshots using
+# ALT+Print screen.
+#----------------------------------------------------
+
+# Syntax
+if [ "x$1" = "x" ]
+then
+ echo "resize_windows.sh (list|0x99999999)"
+fi
+
+# To list all windows
+if [ "x$1" = "xlist" ]
+then
+ wmctrl -l
+fi
+
+# To resize a specific window
+if [ "x$1" != "xlist" -a "x$1" != "x" ]
+then
+ wmctrl -i -r $1 -e 0,0,0,1280,1024
+ echo Size of windows $1 modified
+fi
+
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index d34da06987d..058894c5be9 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -64,6 +64,9 @@ if (! empty($conf->mailmanspip->enabled))
$object = new Adherent($db);
$extrafields = new ExtraFields($db);
+// fetch optionals attributes and labels
+$extralabels=$extrafields->fetch_name_optionals_label('member');
+
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($socid);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
@@ -282,14 +285,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$object->statut = $_POST["statut"];
$object->public = $_POST["public"];
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $object->array_options[$key]=$_POST[$key];
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Check if we need to also synchronize user information
$nosyncuser=0;
@@ -460,14 +457,8 @@ if ($action == 'add' && $user->rights->adherent->creer)
$object->fk_soc = $socid;
$object->public = $public;
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $object->array_options[$key]=$_POST[$key];
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Check parameters
if (empty($morphy) || $morphy == "-1") {
@@ -693,9 +684,6 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
$form = new Form($db);
$formcompany = new FormCompany($db);
-// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label('member');
-
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
llxHeader('',$langs->trans("Member"),$help_url);
@@ -894,15 +882,7 @@ else
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
- print '
'."\n";
- }
+ print $object->showOptionals($extrafields,'edit');
}
// Third party Dolibarr
@@ -1467,13 +1439,7 @@ else
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=$object->array_options["options_$key"];
- print "
';
@@ -356,23 +334,13 @@ if ($rowid > 0)
// Other attributes
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
-
- print '';
-
- //Extra field
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
- print '
';
}
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $actioncomm->array_options[$key]=GETPOST($key);
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$actioncomm);
if (! $error)
{
@@ -343,14 +340,8 @@ if ($action == 'update')
}
$actioncomm->userdone = $userdone;
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $actioncomm->array_options[$key]=GETPOST($key);
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$actioncomm);
if (! $error)
{
@@ -395,9 +386,6 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
$form = new Form($db);
$htmlactions = new FormActions($db);
-// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label('actioncomm');
-
if ($action == 'create')
{
$contact = new Contact($db);
@@ -603,22 +591,13 @@ if ($action == 'create')
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$actioncomm,$action); // Note that $action and $object may have been modified by hook
- print '';
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
- print '
'."\n";
- }
+ print $object->showOptionals($extrafields,'edit');
}
// Template to use by default
@@ -2091,15 +2083,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
- print '
'."\n";
- }
- }
+ print $object->showOptionals($extrafields,'edit');
}
// Modele PDF
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 3b38ccb3fd0..a24b21c51a8 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -2590,7 +2590,7 @@ class Facture extends CommonInvoice
/**
* Return if an invoice can be deleted
* Rule is:
- * If hidden option FACTURE_CAN_BE_REMOVED is on, we can
+ * If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can
* If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule
* If invoice is draft and ha a temporary ref -> yes
*
@@ -2600,7 +2600,8 @@ class Facture extends CommonInvoice
{
global $conf;
- if (! empty($conf->global->FACTURE_CAN_BE_REMOVED)) return 1;
+ if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1;
+ if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0;
// on verifie si la facture est en numerotation provisoire
$facref = substr($this->ref, 1, 4);
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ec2dc5997e2..aad8dbbc19f 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -258,7 +258,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
*/
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
- $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
+ $sql = "SELECT f.ref_supplier, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -287,7 +287,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$obj = $db->fetch_object($resql);
print '
';
- $facturesupplierstatic->ref=$obj->facnumber;
+ $facturesupplierstatic->ref=$obj->ref;
$facturesupplierstatic->id=$obj->rowid;
$facturesupplierstatic->type=$obj->type;
print $facturesupplierstatic->getNomUrl(1,'',16);
@@ -432,7 +432,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$langs->load("boxes");
$facstatic=new FactureFournisseur($db);
- $sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye";
+ $sql = "SELECT ff.rowid, ff.ref_supplier, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye";
$sql.= ", s.nom, s.rowid as socid";
$sql.= ", SUM(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
@@ -442,7 +442,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND ff.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
- $sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid";
+ $sql.= " GROUP BY ff.rowid, ff.ref_supplier, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid";
$sql.= " ORDER BY ff.tms DESC ";
$sql.= $db->plimit($max, 0);
@@ -467,7 +467,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$obj = $db->fetch_object($resql);
print '
'."\n";
+ for ($j=0; $j < $tabul; $j++)
+ {
+ $tabstring.=' ';
+ }
+ }
+
+ // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
+ $url=dol_buildpath($menu_array[$i]['url'],1);
+ $url=preg_replace('/__LOGIN__/',$user->login,$url);
+ $url=preg_replace('/__USERID__/',$user->id,$url);
+
+ if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
+ {
+ if (! preg_match('/\?/',$url)) $url.='?';
+ else $url.='&';
+ $url.='mainmenu='.$mainmenu;
+ }
+
+ print ''."\n";
+
+ // Menu niveau 0
+ if ($menu_array[$i]['level'] == 0)
+ {
+ if ($menu_array[$i]['enabled'])
+ {
+ print '
'."\n";
+ }
+ }
+
+ // If next is a new block or end
+ if (empty($menu_array[$i+1]['level']))
+ {
+ if ($showmenu)
+ print ''."\n";
+ print "\n";
}
}
-
- // Place tabulation
- $tabstring='';
- $tabul=($menu_array[$i]['level'] - 1);
- if ($tabul > 0)
- {
- for ($j=0; $j < $tabul; $j++)
- {
- $tabstring.=' ';
- }
- }
-
- // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
- $url=dol_buildpath($menu_array[$i]['url'],1);
- $url=preg_replace('/__LOGIN__/',$user->login,$url);
- $url=preg_replace('/__USERID__/',$user->id,$url);
-
- if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
- {
- if (! preg_match('/\?/',$url)) $url.='?';
- else $url.='&';
- $url.='mainmenu='.$mainmenu;
- }
-
- print ''."\n";
-
- // Menu niveau 0
- if ($menu_array[$i]['level'] == 0)
- {
- if ($menu_array[$i]['enabled'])
- {
- print '
';
print $invoicesupplierstatic->getNomUrl(1);
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index 4a745fc9ef9..2d9a7a151b3 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -319,12 +319,12 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->facture->lire)
{
// TODO move to DAO class
- $sql = 'SELECT f.rowid,f.libelle,f.facnumber,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
+ $sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
$sql.= ' WHERE f.fk_soc = '.$object->id;
- $sql.= ' GROUP BY f.rowid,f.libelle,f.facnumber,f.fk_statut,f.datef,f.total_ttc,f.paye';
+ $sql.= ' GROUP BY f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
$sql.= ' ORDER BY f.datef DESC';
$resql=$db->query($sql);
if ($resql)
@@ -349,7 +349,7 @@ if ($object->fetch($id))
print '
-
-
-
-
-
-
-
-
diff --git a/htdocs/theme/phones/smartphone/tpl/menu.tpl.php b/htdocs/theme/phones/smartphone/tpl/menu.tpl.php
deleted file mode 100644
index d286345eada..00000000000
--- a/htdocs/theme/phones/smartphone/tpl/menu.tpl.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- *
- * 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 .
- */
-
-// Load the smartphone menu manager
-$result=@include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
-if (! $result) // If failed to include, we try with standard
-{
- $conf->smart_menu='smartphone_menu.php';
- include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
-}
-$menusmart = new MenuSmart($db, $user->societe_id?1:0);
-
-
-top_httphead();
-?>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/theme/phones/smartphone/tpl/passwordforgotten.tpl.php b/htdocs/theme/phones/smartphone/tpl/passwordforgotten.tpl.php
deleted file mode 100644
index ecec5f676b0..00000000000
--- a/htdocs/theme/phones/smartphone/tpl/passwordforgotten.tpl.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- *
- * 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 .
- *
- */
-top_httphead();
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index a614416dcf8..779d0cf5423 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -187,14 +187,8 @@ if ($action == 'add' && $canadduser)
$object->note = GETPOST("note");
$object->ldap_sid = GETPOST("ldap_sid");
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $object->array_options[$key]=GETPOST($key);
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// If multicompany is off, admin users must all be on entity 0.
if (! empty($conf->multicompany->enabled))
@@ -329,14 +323,8 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->openid = GETPOST("openid");
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
- // Get extra fields
- foreach($_POST as $key => $value)
- {
- if (preg_match("/^options_/",$key))
- {
- $object->array_options[$key]=GETPOST($key);
- }
- }
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if (! empty($conf->multicompany->enabled))
{
@@ -927,15 +915,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
- print '
\n";
@@ -1304,15 +1284,7 @@ else
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
- print '
\n";
@@ -1921,15 +1893,7 @@ else
$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))
{
- foreach($extrafields->attribute_label as $key=>$label)
- {
- $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
- print '