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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } /* @@ -1137,15 +1117,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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - 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 "".$label.""; - print $extrafields->showOutputField($key,$value); - print "\n"; - } + print $object->showOptionals($extrafields); } // Third party Dolibarr diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f4a60f55cd9..72fc3cc2a37 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -56,6 +56,9 @@ $result=restrictedArea($user,'adherent',$rowid,'adherent_type'); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('adherent_type'); + if (GETPOST('button_removefilter')) { $search_lastname=""; @@ -84,14 +87,8 @@ if ($action == 'add' && $user->rights->adherent->configurer) $adht->mail_valid = trim($_POST["mail_valid"]); $adht->vote = trim($_POST["vote"]); - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $adht->array_options[$key]=GETPOST($key); - } - } + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels,$adht); if ($adht->libelle) { @@ -127,14 +124,8 @@ if ($action == 'update' && $user->rights->adherent->configurer) $adht->mail_valid = trim($_POST["mail_valid"]); $adht->vote = trim($_POST["vote"]); - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $adht->array_options[$key]=GETPOST($key); - } - } + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels,$adht); $adht->update($user->id); @@ -167,8 +158,6 @@ llxHeader('',$langs->trans("MembersTypeSetup"),'EN:Module_Foundations|FR:Module_ $form=new Form($db); -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('adherent_type'); // Liste of members type @@ -245,6 +234,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') if ($action == 'create') { $form = new Form($db); + $adht = new AdherentType($db); print_fiche_titre($langs->trans("NewMemberType")); @@ -278,23 +268,11 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook - - print "\n"; - if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print '

'; - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$act->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print ' width="30%">'.$label.''."\n"; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '


'; + print $adht->showOptionals($extrafields,'edit'); } + print "\n"; print '
'; 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 '

'; - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($adht->array_options['options_'.$key])?$adht->array_options['options_'.$key]:'')); - print '\n"; - } - print '
'.$label.''; - print $extrafields->showOutputField($key,$value); - print "


'; + // View extrafields + print $adht->showOptionals($extrafields); } + print ''; print ''; /* diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 07a6647f4bb..2851e55dfd9 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -63,6 +63,9 @@ $actioncomm = new ActionComm($db); $contact = new Contact($db); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('actioncomm'); + //var_dump($_POST); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array @@ -203,14 +206,8 @@ if ($action == 'add_action') $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'
'; } - // 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 '

'; - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($actioncomm->array_options["options_".$key])?$actioncomm->array_options["options_".$key]:'')); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print ' width="30%">'.$label.''."\n"; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '

'; + print $actioncomm->showOptionals($extrafields,'edit'); } + + print ''; print '

'; print ''; @@ -838,24 +817,13 @@ if ($id > 0) // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook - - print ''; - if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print '

'; - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$act->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print ' width="30%">'.$label.''."\n"; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '


'; + print $actioncomm->showOptionals($extrafields,'edit'); + } + print ''; print '

'; print '     '; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 564daaaaa74..954dad26cee 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -48,6 +48,9 @@ $result=$object->fetch($id); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('mailing'); + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('mailingcard')); @@ -631,8 +634,6 @@ if (! empty($_POST["cancel"])) * View */ -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('mailing'); $help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader('',$langs->trans("Mailing"),$help_url); @@ -661,15 +662,7 @@ if ($action == 'create') $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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } print ''; @@ -823,15 +816,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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } + print $object->showOptionals($extrafields); } print ''; @@ -1072,15 +1057,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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } + print $object->showOptionals($extrafields,'edit'); } print ''; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 66261dbe57b..25b8a1979f0 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1347,24 +1347,7 @@ if ($action == 'create') $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]); - - // Show separator only - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } - } + print $object->showOptionals($extrafields,'edit'); } print ""; @@ -1849,7 +1832,7 @@ else print ''; } - + // TODO : use showOptionals($extrafields) function foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); @@ -2279,4 +2262,4 @@ else // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 4bf473d3413..997ebd160b9 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1564,15 +1564,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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - 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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } // Total HT diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2ba0ce6e137..0cc27d366cf 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2097,23 +2097,7 @@ if ($action == 'create') $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]); - // Show separator only - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - 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 ''; - $facstatic->ref=$obj->facnumber; + $facstatic->ref=$obj->ref; $facstatic->id=$obj->rowid; print $facstatic->getNomUrl(1,''); print ''; @@ -930,7 +930,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $facstatic=new FactureFournisseur($db); - $sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; + $sql = "SELECT ff.rowid, ff.ref_supplier, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, 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"; @@ -942,7 +942,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $sql.= " AND ff.fk_statut = 1"; 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, s.nom, s.rowid"; + $sql.= " GROUP BY ff.rowid, ff.ref_supplier, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, s.nom, s.rowid"; $resql=$db->query($sql); if ($resql) @@ -967,7 +967,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $obj = $db->fetch_object($resql); print ''; - $facstatic->ref=$obj->facnumber; + $facstatic->ref=$obj->ref; $facstatic->id=$obj->rowid; print $facstatic->getNomUrl(1,''); print ''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 885711bb526..db0fe091cd9 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -50,6 +50,9 @@ if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('contact'); + // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($id); $objcanvas=null; @@ -155,14 +158,8 @@ if (empty($reshook)) $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); $object->birthday_alert = $_POST["birthday_alert"]; - // 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 (! $_POST["lastname"]) { @@ -252,14 +249,8 @@ if (empty($reshook)) $object->priv = $_POST["priv"]; $object->note = $_POST["note"]; - // 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); $result = $object->update($_POST["contactid"], $user); @@ -283,8 +274,6 @@ if (empty($reshook)) * View */ -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('contact'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ContactsAddresses"),$help_url); @@ -518,22 +507,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]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } - } + print $object->showOptionals($extrafields,'edit'); } print "
"; @@ -740,22 +714,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]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } - } + print $object->showOptionals($extrafields,'edit'); } $object->load_ref_elements(); @@ -959,20 +918,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]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print ''.$label.''; - print $extrafields->showOutputField($key,$value); - print "\n"; - } - } + print $object->showOptionals($extrafields); } $object->load_ref_elements(); diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 20462fa80d5..6c6a6d8d036 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -101,7 +101,7 @@ class box_actions extends ModeleBoxes 'logo' => ("action"), 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); - $this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"', + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => dol_trunc($label,32), 'text2'=> $late, 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 777491c08a6..5fbb2f62a87 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -64,7 +64,7 @@ class box_factures_fourn extends ModeleBoxes if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.nom, s.rowid as socid,"; - $sql.= " f.rowid as facid, f.facnumber, f.amount,"; + $sql.= " f.rowid as facid, f.ref_supplier, f.amount,"; $sql.= " f.paye, f.fk_statut,"; $sql.= ' f.datef as df,'; $sql.= ' f.datec as datec,'; @@ -102,7 +102,7 @@ class box_factures_fourn extends ModeleBoxes 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' => $objp->facnumber, + 'text' => $objp->ref_supplier, 'text2'=> $late, 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 1b37cf034af..7a5684eebf7 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -61,7 +61,7 @@ class box_factures_fourn_imp extends ModeleBoxes if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.nom, s.rowid as socid,"; - $sql.= " f.rowid as facid, f.facnumber, f.date_lim_reglement as datelimite,"; + $sql.= " f.rowid as facid, f.ref_supplier, f.date_lim_reglement as datelimite,"; $sql.= " f.amount, f.datef as df,"; $sql.= " f.paye, f.fk_statut, f.type"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -98,7 +98,7 @@ class box_factures_fourn_imp extends ModeleBoxes 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' => $objp->facnumber, + 'text' => $objp->ref_supplier, 'text2'=> $late, 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 160bae37c0e..048d25e0549 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2189,6 +2189,76 @@ abstract class CommonObject } else return 0; } + + /** + * Function to show lines of extrafields with output datas + * + * @param object $extrafields extrafield Object + * @param string $mode Show output (view) or input (edit) for extrafield + * + * return string + */ + function showOptionals($extrafields,$mode='view') + { + global $_POST; + + $out = ''; + + if(count($extrafields->attribute_label) > 0) + { + $out .= "\n"; + $out .= ' '; + $out .= "\n"; + + $e = 0; + foreach($extrafields->attribute_label as $key=>$label) + { + $colspan='3'; + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]); + if ($extrafields->attribute_type[$key] == 'separate') + { + $out .= $extrafields->showSeparator($key); + } + else + { + if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) + { + $out .= ''; + $colspan='0'; + } + else + { + $out .= ''; + } + // Convert date into timestamp format + if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) + { + $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"]):$this->array_options['options_'.$key]; + } + $out .= ''.$label.''; + $out .=''; + + switch($mode) { + case "view": + $out .= $extrafields->showOutputField($key,$value); + break; + case "edit": + $out .= $extrafields->showInputField($key,$value); + break; + } + + $out .= ''."\n"; + + if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= ''; + else $out .= ''; + $e++; + } + } + $out .= "\n"; + $out .= ' '; + } + return $out; + } /** diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f9398c21cb8..5491c727ad6 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -624,7 +624,7 @@ class ExtraFields $formstat = new Form($db); $showtime = in_array($type,array('datetime')) ? 1 : 0; - $out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 0, 0, 1); + $out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); //$out=''; } elseif (in_array($type,array('int','double'))) diff --git a/htdocs/core/getmenu_jmobile.php b/htdocs/core/getmenu_jmobile.php index 78c46c60fbb..988dec4339a 100644 --- a/htdocs/core/getmenu_jmobile.php +++ b/htdocs/core/getmenu_jmobile.php @@ -50,7 +50,7 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); * View */ -// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests +// URL http://mydolibarr/core/getmenu_jmobile?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests $arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js'); $arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css'); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 656841297ad..33b694f5ed5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1581,7 +1581,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', * MAIN_DISABLE_TRUNC=1 can disable all truncings * * @param string $string String to truncate - * @param int $size Max string size visible. 0 for no limit. finale string size can be 1 more (if size was max+1) or 3 more (if we added ...) + * @param int $size Max string size visible. 0 for no limit. Final string size can be 1 more (if size was max+1) or 3 more (if we added ...) * @param string $trunc Where to trunc: right, left, middle (size must be a 2 power), wrap * @param string $stringencoding Tell what is source string encoding * @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation. diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 1a40de3c713..43c270c188d 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -252,92 +252,92 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM // Show menu if (empty($noout)) { - $alt=0; - $num=count($menu_array); - for ($i = 0; $i < $num; $i++) - { - $showmenu=true; - if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; - - $alt++; - if (empty($menu_array[$i]['level']) && $showmenu) + $alt=0; + $num=count($menu_array); + for ($i = 0; $i < $num; $i++) { - if (($alt%2==0)) + $showmenu=true; + if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; + + $alt++; + if (empty($menu_array[$i]['level']) && $showmenu) { - print '
'."\n"; + if (($alt%2==0)) + { + print '
'."\n"; + } + else + { + print '
'."\n"; + } } - else + + // Place tabulation + $tabstring=''; + $tabul=($menu_array[$i]['level'] - 1); + if ($tabul > 0) { - 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 ''; + } + else if ($showmenu) + { + print ''."\n"; + } + if ($showmenu) + print ''."\n"; + } + // Menu niveau > 0 + if ($menu_array[$i]['level'] > 0) + { + if ($menu_array[$i]['enabled']) + { + print ''."\n"; + } + else if ($showmenu) + { + 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 ''; - } - else if ($showmenu) - { - print ''."\n"; - } - if ($showmenu) - print ''."\n"; - } - // Menu niveau > 0 - if ($menu_array[$i]['level'] > 0) - { - if ($menu_array[$i]['enabled']) - { - print ''."\n"; - } - else if ($showmenu) - { - print ''."\n"; - } - } - - // If next is a new block or end - if (empty($menu_array[$i+1]['level'])) - { - if ($showmenu) - print ''."\n"; - print "
\n"; - } - } } return count($menu_array); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 343edaf5201..bac7e57bc0d 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -160,7 +160,7 @@ class MenuManager */ function showmenu($mode) { - global $conf, $langs; + global $conf, $langs, $user; require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php'; @@ -175,8 +175,8 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; $this->menu=new Menu(); - if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); - if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu); + if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0); + if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0); if ($mode == 'jmobile') { $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); @@ -188,6 +188,8 @@ class MenuManager if ($val['enabled'] == 1) { $relurl=dol_buildpath($val['url'],1); + $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); + $relurl=preg_replace('/__USERID__/',$user->id,$relurl); print ''.$val['titre'].''."\n"; // Search submenu fot this entry @@ -198,12 +200,13 @@ class MenuManager $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); //var_dump($submenu->liste); $nexturl=dol_buildpath($submenu->liste[0]['url'],1); + $canonrelurl=preg_replace('/\?.*$/','',$relurl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl); //var_dump($canonrelurl); //var_dump($canonnexturl); print '
    '; - if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home') + if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools'))) { // We add sub entry print '
  • '.$langs->trans("MainArea").'-'.$val['titre'].'
  • '."\n"; @@ -211,9 +214,11 @@ class MenuManager foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' { $relurl2=dol_buildpath($val2['url'],1); + $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); + $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); - if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php'))) $relurl2=''; + if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; print ''; if ($relurl2) print ''; print $val2['titre']; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 34ac773b1d1..1e2bf1c7fa2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1242,7 +1242,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } else if ($showmenu) { - print ''."\n"; + print ''."\n"; } } diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 18d64839fdc..04be9e3563a 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -116,7 +116,7 @@ class MenuManager */ function showmenu($mode) { - global $conf, $langs; + global $conf, $langs, $user; require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; @@ -131,8 +131,8 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; $this->menu=new Menu(); - if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); - if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu); + if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0); + if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0); if ($mode == 'jmobile') { $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); @@ -144,6 +144,8 @@ class MenuManager if ($val['enabled'] == 1) { $relurl=dol_buildpath($val['url'],1); + $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); + $relurl=preg_replace('/__USERID__/',$user->id,$relurl); print ''.$val['titre'].''."\n"; // Search submenu fot this entry @@ -152,6 +154,7 @@ class MenuManager $submenu=new Menu(); $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); $nexturl=dol_buildpath($submenu->liste[0]['url'],1); + $canonrelurl=preg_replace('/\?.*$/','',$relurl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl); //var_dump($canonrelurl); @@ -165,6 +168,8 @@ class MenuManager foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' { $relurl2=dol_buildpath($val2['url'],1); + $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); + $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); //var_dump($val2); print ''.$val2['titre'].''."\n"; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 14093ce5995..240953afd57 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -60,8 +60,8 @@ class MenuManager /** * Show menu * - * @param string $mode 'top' or 'left' - * @return void + * @param string $mode 'top', 'left', 'jmobile' + * @return void */ function showmenu($mode) { @@ -72,23 +72,35 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; $this->menu=new Menu(); - if ($mode == 'top') + $res='ErrorBadParameterForMode'; + + $noout=0; + if ($mode == 'jmobile') $noout=1; + + if ($mode == 'top' || $mode == 'jmobile') { - print_start_menu_array_empty(); + if (empty($noout)) print_start_menu_array_empty(); // Home $showmode=1; $idsel='home'; $classname='class="tmenusel"'; - print_start_menu_entry_empty($idsel, $classname, $showmode); - print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget); - print_end_menu_entry_empty($showmode); + if (empty($noout)) print_start_menu_entry_empty($idsel, $classname, $showmode); + if (empty($noout)) print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget); + if (empty($noout)) print_end_menu_entry_empty($showmode); + $this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', ''); - print_end_menu_array_empty(); + if (empty($noout)) print_end_menu_array_empty(); + + if ($mode == 'jmobile') + { + $this->topmenu=dol_clone($this->menu); + unset($this->menu->liste); + } } - if ($mode == 'left') + if ($mode == 'left' || $mode == 'jmobile') { // Put here left menu entries // ***** START ***** @@ -113,65 +125,131 @@ class MenuManager // do not change code after this - $alt=0; - $num=count($this->menu->liste); - for ($i = 0; $i < $num; $i++) + if (empty($noout)) { - $alt++; - if (empty($this->menu->liste[$i]['level'])) + $alt=0; + $num=count($this->menu->liste); + for ($i = 0; $i < $num; $i++) { - if (($alt%2==0)) + $alt++; + if (empty($this->menu->liste[$i]['level'])) { - print '
    '."\n"; + if (($alt%2==0)) + { + print '
    '."\n"; + } + else + { + print '
    '."\n"; + } } - else + + // Place tabulation + $tabstring=''; + $tabul=($this->menu->liste[$i]['level'] - 1); + if ($tabul > 0) { - print '
    '."\n"; + for ($j=0; $j < $tabul; $j++) + { + $tabstring.='   '; + } } - } - // Place tabulation - $tabstring=''; - $tabul=($this->menu->liste[$i]['level'] - 1); - if ($tabul > 0) - { - for ($j=0; $j < $tabul; $j++) + if ($this->menu->liste[$i]['level'] == 0) { + if ($this->menu->liste[$i]['enabled']) + { + print ''."\n"; + } + else + { + print ''."\n"; + } + print ''."\n"; + } + + if ($this->menu->liste[$i]['level'] > 0) { + print ''."\n"; + } + + // If next is a new block or end + if (empty($this->menu->liste[$i+1]['level'])) { - $tabstring.='   '; + print ''."\n"; + print "
    \n"; } } - - if ($this->menu->liste[$i]['level'] == 0) { - if ($this->menu->liste[$i]['enabled']) - { - print ''."\n"; - } - else - { - print ''."\n"; - } - print ''."\n"; - } - - if ($this->menu->liste[$i]['level'] > 0) { - print ''."\n"; - } - - // If next is a new block or end - if (empty($this->menu->liste[$i+1]['level'])) - { - print ''."\n"; - print "
    \n"; - } } + + if ($mode == 'jmobile') + { + $this->leftmenu=dol_clone($this->menu); + unset($this->menu->liste); + } } + + if ($mode == 'jmobile') + { + foreach($this->topmenu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + print '
      '; + print '
    • '; + if ($val['enabled'] == 1) + { + $relurl=dol_buildpath($val['url'],1); + $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); + $relurl=preg_replace('/__USERID__/',$user->id,$relurl); + + print ''.$val['titre'].''."\n"; + // Search submenu fot this entry + $tmpmainmenu=$val['mainmenu']; + $tmpleftmenu='all'; + //$submenu=new Menu(); + //$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); + //$nexturl=dol_buildpath($submenu->liste[0]['url'],1); + $submenu=$this->leftmenu; + + $canonrelurl=preg_replace('/\?.*$/','',$relurl); + $canonnexturl=preg_replace('/\?.*$/','',$nexturl); + //var_dump($canonrelurl); + //var_dump($canonnexturl); + print '
        '; + if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools'))) + { + // We add sub entry + print '
      • '.$langs->trans("MainArea").'-'.$val['titre'].'
      • '."\n"; + } + foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + $relurl2=dol_buildpath($val2['url'],1); + $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); + $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); + //var_dump($val2); + print ''.$val2['titre'].''."\n"; + } + //var_dump($submenu); + print '
      '; + } + if ($val['enabled'] == 2) + { + print ''.$val['titre'].''; + } + print '
    • '; + print '
    '."\n"; + + break; // Only first menu entry (so home) + } + } + + unset($this->menu); + + return $res; } } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index efed9579d1f..a78b037d68b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -105,34 +105,31 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex /* * View */ -if (!empty($status)) { - $pagetitle=$langs->trans("CronListActive"); -}else { - $pagetitle=$langs->trans("CronListInactive"); -} -llxHeader('',$pagetitle); - - -// Form object for popup $form = new Form($db); -if ($action == 'delete') -{ - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - if ($ret == 'html') print '
    '; -} - -if ($action == 'execute'){ - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - if ($ret == 'html') print '
    '; -} +if (!empty($status)) $pagetitle=$langs->trans("CronListActive"); +else $pagetitle=$langs->trans("CronListInactive"); +llxHeader('',$pagetitle); print_fiche_titre($pagetitle,'','setup'); print $langs->trans('CronInfo'); + +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
    '; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
    '; +} + + // liste des jobs creer $object = new Cronjob($db); $result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter); @@ -141,13 +138,11 @@ if ($result < 0) { } -print "

    "; -print $langs->trans('CronWaitingJobs'); -print "

    "; +print "

    "; if (count($object->lines)>0) { - print ''; + print '
    '; print ''; $arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label; print_liste_field_titre($langs->trans("CronLabel"),$_SERVEUR['PHP_SELF'],"t.label","",$arg_url,'',$sortfield,$sortorder); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 5b26339c8c8..d879019a06c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -41,7 +41,7 @@ class FactureFournisseur extends CommonInvoice public $fk_element='fk_facture_fourn'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $ref; + var $ref; var $product_ref; var $ref_supplier; var $socid; @@ -134,7 +134,7 @@ class FactureFournisseur extends CommonInvoice $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn ("; $sql.= "ref"; - $sql.= ", facnumber"; + $sql.= ", ref_supplier"; $sql.= ", entity"; $sql.= ", libelle"; $sql.= ", fk_soc"; @@ -263,7 +263,7 @@ class FactureFournisseur extends CommonInvoice $sql = "SELECT"; $sql.= " t.rowid,"; $sql.= " t.ref,"; - $sql.= " t.facnumber,"; + $sql.= " t.ref_supplier,"; $sql.= " t.entity,"; $sql.= " t.type,"; $sql.= " t.fk_soc,"; @@ -298,7 +298,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ' s.nom as socnom, s.rowid as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t,'.MAIN_DB_PREFIX.'societe as s'; if ($id) $sql.= " WHERE t.rowid=".$id; - if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; // ref is id (facnumber is supplier ref) + if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; $sql.= ' AND t.fk_soc = s.rowid'; dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); @@ -310,10 +310,9 @@ class FactureFournisseur extends CommonInvoice $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - $this->ref = $obj->ref; + $this->ref = $obj->ref?$obj->ref:$obj->rowid; // We take rowid if ref is empty for backward compatibility - $this->ref_supplier = $obj->facnumber; - $this->facnumber = $obj->facnumber; + $this->ref_supplier = $obj->ref_supplier; $this->entity = $obj->entity; $this->type = empty($obj->type)?0:$obj->type; $this->fk_soc = $obj->fk_soc; @@ -501,7 +500,7 @@ class FactureFournisseur extends CommonInvoice // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET"; $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; - $sql.= " facnumber=".(isset($this->facnumber)?"'".$this->db->escape($this->facnumber)."'":"null").","; + $sql.= " ref_supplier=".(isset($this->ref_supplier)?"'".$this->db->escape($this->ref_supplier)."'":"null").","; $sql.= " entity=".(isset($this->entity)?$this->entity:"null").","; $sql.= " type=".(isset($this->type)?$this->type:"null").","; $sql.= " fk_soc=".(isset($this->fk_soc)?$this->fk_soc:"null").","; @@ -665,38 +664,6 @@ class FactureFournisseur extends CommonInvoice } } - /** - * Set supplier ref - * - * @param User $user User that make change - * @param string $ref_supplier Supplier ref - * @return int <0 if KO, >0 if OK - */ - function set_ref_supplier($user, $ref_supplier) - { - if ($user->rights->fournisseur->facture->creer) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn SET facnumber = '.(empty($ref_supplier) ? 'NULL' : '\''.$this->db->escape($ref_supplier).'\''); - $sql.= ' WHERE rowid = '.$this->id; - - dol_syslog("FactureFournisseur::set_ref_supplier sql=".$sql); - if ($this->db->query($sql)) - { - $this->ref_supplier = $ref_supplier; - return 1; - } - else - { - $this->error=$this->db->lasterror(); - dol_syslog('FactureFournisseur::set_ref_supplier '.$this->error.' - '.$sql, LOG_ERR); - return -2; - } - } - else - { - return -1; - } - } /** * Tag invoice as a payed invoice @@ -1349,8 +1316,11 @@ class FactureFournisseur extends CommonInvoice $label=$langs->trans("ShowInvoice").': '.$this->ref; if ($this->ref_supplier) $label.=' / '.$this->ref_supplier; + $ref=$this->ref; + if (empty($ref)) $ref=$this->id; + if ($withpicto) $result.=($lien.img_object($label,'bill').$lienfin.' '); - $result.=$lien.($max?dol_trunc($this->ref,$max):$this->ref).$lienfin; + $result.=$lien.($max?dol_trunc($ref,$max):$ref).$lienfin; return $result; } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 9f63805a288..470dec637d6 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -170,12 +170,13 @@ elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournis } // Set supplier ref -elseif ($action == 'setfacnumber' && $user->rights->fournisseur->facture->creer) +if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) { - $object->fetch($id); - $result=$object->set_ref_supplier($user, GETPOST('facnumber')); + $result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); + if ($result < 0) dol_print_error($db, $object->error); } + // Set label elseif ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) { @@ -253,7 +254,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) $_GET['socid']=$_POST['socid']; $error++; } - if (! GETPOST('facnumber')) + if (! GETPOST('ref_supplier')) { $mesg='
    '.$langs->trans('ErrorFieldRequired',$langs->transnoentities('RefSupplier')).'
    '; $action='create'; @@ -267,7 +268,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) // Creation facture $object->ref = $_POST['ref']; - $object->facnumber = $_POST['facnumber']; + $object->ref_supplier = $_POST['ref_supplier']; $object->socid = $_POST['socid']; $object->libelle = $_POST['libelle']; $object->date = $datefacture; @@ -1048,7 +1049,7 @@ if ($action == 'create') print ''; // Ref supplier - print ''; + print ''; print ''; print '\n"; // Ref supplier - print ''; // Third party diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 467d02e8726..e88350aad57 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -89,7 +89,7 @@ if (! $sortorder) $sortorder="ASC"; if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.rowid as socid, s.nom,"; - $sql.= " f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc,"; + $sql.= " f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc,"; $sql.= " f.datef as df, f.date_lim_reglement as datelimite, "; $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; $sql.= " ,sum(pf.amount) as am"; @@ -121,7 +121,7 @@ if ($user->rights->fournisseur->facture->lire) } if ($search_ref_supplier) { - $sql .= " AND f.facnumber LIKE '%".$search_ref_supplier."%'"; + $sql .= " AND f.ref_supplier LIKE '%".$search_ref_supplier."%'"; } if ($search_societe) @@ -141,14 +141,14 @@ if ($user->rights->fournisseur->facture->lire) if (dol_strlen(GETPOST('sf_re')) > 0) { - $sql .= " AND f.facnumber LIKE '%".GETPOST('sf_re')."%'"; + $sql .= " AND f.ref_supplier LIKE '%".GETPOST('sf_re')."%'"; } - $sql.= " GROUP BY f.facnumber, f.rowid, f.total_ht, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, s.rowid, s.nom"; + $sql.= " GROUP BY f.ref_supplier, f.rowid, f.total_ht, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, s.rowid, s.nom"; $sql.= " ORDER BY "; $listfield=explode(',',$sortfield); foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.","; - $sql.= " f.facnumber DESC"; + $sql.= " f.ref_supplier DESC"; $resql = $db->query($sql); if ($resql) @@ -191,7 +191,7 @@ if ($user->rights->fournisseur->facture->lire) print '
    '.$langs->trans('RefSupplier').'
    '.$langs->trans('RefSupplier').'
    '.$langs->trans('Type').''; @@ -1252,14 +1253,16 @@ else $productstatic = new Product($db); $object->fetch($id); - $object->fetch_thirdparty(); + $result=$object->fetch_thirdparty(); + if ($result < 0) dol_print_error($db); $societe = new Fournisseur($db); - $societe->fetch($object->socid); + $result=$societe->fetch($object->socid); + if ($result < 0) dol_print_error($db); /* * View card - */ + */ $head = facturefourn_prepare_head($object); $titre=$langs->trans('SupplierInvoice'); dol_fiche_head($head, 'card', $titre, 0, 'bill'); @@ -1352,8 +1355,8 @@ else print "
    '.$form->editfieldkey("RefSupplier",'facnumber',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; - print $form->editfieldval("RefSupplier",'facnumber',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)); + print '
    '.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).''; + print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)); print '
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.ref_supplier","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); @@ -242,7 +242,7 @@ if ($user->rights->fournisseur->facture->lire) print $facturestatic->getNomUrl(1); print "\n"; - print "\n"; + print "\n"; print "\n"; print "attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } print '
    ".dol_trunc($objp->facnumber,12)."".dol_trunc($objp->ref_supplier,12)."".dol_print_date($db->jdate($objp->df),'day')."".dol_print_date($db->jdate($objp->datelimite),'day'); diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index b5922f52b29..6a3415f02f0 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -103,7 +103,7 @@ $htmlother=new FormOther($db); llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); $sql = "SELECT s.rowid as socid, s.nom, "; -$sql.= " fac.rowid as facid, fac.ref, fac.facnumber, fac.datef, fac.date_lim_reglement as date_echeance,"; +$sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, fac.date_lim_reglement as date_echeance,"; $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac"; @@ -131,7 +131,7 @@ if (GETPOST("search_ref")) } if (GETPOST("search_ref_supplier")) { - $sql .= " AND fac.facnumber LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'"; + $sql .= " AND fac.ref_supplier LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'"; } if ($month > 0) { @@ -193,7 +193,7 @@ if ($resql) print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"facnumber","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder); @@ -249,10 +249,10 @@ if ($resql) print '\n"; - print '"; + print '"; print ''; print ''; print ''; - print ''; + print ''; if ($objp->df > 0 ) { print '\n"; // Lines for filters fields @@ -492,7 +492,7 @@ if (empty($action)) print ''; // Ref invoice - /*$invoicesupplierstatic->ref=$objp->facnumber; + /*$invoicesupplierstatic->ref=$objp->ref_supplier; $invoicesupplierstatic->id=$objp->facid; print ''; print ''; + print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.' '.dol_trunc($obj->libelle,14).''; print ''; print ''; print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } + print $object->showOptionals($extrafields); } print "
    '; $facturestatic->id=$obj->facid; $facturestatic->ref=$obj->ref; - $facturestatic->ref_supplier=$obj->facnumber; + $facturestatic->ref_supplier=$obj->ref_supplier; print $facturestatic->getNomUrl(1); print "'.dol_trunc($obj->facnumber,10)."'.dol_trunc($obj->ref_supplier,10)."'.dol_print_date($db->jdate($obj->datef),'day').''.dol_print_date($db->jdate($obj->date_echeance),'day'); if (($obj->paye == 0) && ($obj->fk_statut > 0) && $db->jdate($obj->date_echeance) < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 51b9972260e..9ee8f4d9a23 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -192,7 +192,7 @@ if ($action == 'create' || $action == 'add_paiement') $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture); $sql = 'SELECT s.nom, s.rowid as socid,'; - $sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total'; + $sql.= ' f.rowid, f.ref, f.ref_supplier, f.amount, f.total_ttc as total'; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f'; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -214,7 +214,7 @@ if ($action == 'create' || $action == 'add_paiement') print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -257,7 +257,7 @@ if ($action == 'create' || $action == 'add_paiement') /* * Autres factures impayees */ - $sql = 'SELECT f.rowid as facid, f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc, f.datef as df'; + $sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef as df'; $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 pf.fk_facturefourn = f.rowid'; @@ -265,7 +265,7 @@ if ($action == 'create' || $action == 'add_paiement') $sql.= ' AND f.fk_soc = '.$object->socid; $sql.= ' AND f.paye = 0'; $sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee - $sql.= ' GROUP BY f.rowid, f.facnumber, f.total_ht, f.total_ttc, f.datef'; + $sql.= ' GROUP BY f.rowid, f.ref_supplier, f.total_ht, f.total_ttc, f.datef'; $resql = $db->query($sql); if ($resql) { @@ -298,7 +298,7 @@ if ($action == 'create' || $action == 'add_paiement') print '
    '.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref; print ''.$objp->facnumber.''.$objp->ref_supplier.''; @@ -441,7 +441,7 @@ if (empty($action)) print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Amount'),'paiement.php','f.amount','',$paramlist,'align="right"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','',$paramlist,'',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans('Invoice'),'paiement.php','ref_supplier','',$paramlist,'',$sortfield,$sortorder); print "
    '.price($objp->pamount).''; 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 '
    '; print ''; - print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dol_trunc($obj->libelle,14).''.dol_print_date($db->jdate($obj->df),'day').''.price($obj->amount).''; diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 25f781ccf0d..70aacc894ad 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -163,7 +163,7 @@ if (! empty($conf->fournisseur->enabled)) // Draft invoices if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { - $sql = "SELECT ff.facnumber, ff.rowid, ff.total_ttc, ff.type"; + $sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type"; $sql.= ", s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; @@ -192,7 +192,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $obj = $db->fetch_object($resql); $var=!$var; print '
    '; - $facturestatic->ref=$obj->facnumber; + $facturestatic->ref=$obj->ref; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index b967a43984c..30afab7e935 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -234,7 +234,7 @@ if ($result > 0) * Liste des factures */ $allow_delete = 1 ; - $sql = 'SELECT f.rowid as ref, f.facnumber as ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid'; + $sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s'; $sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid'; $sql .= ' AND pf.fk_paiementfourn = '.$object->id; diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index ba10ab420c0..78cde75300f 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -90,7 +90,7 @@ if ($socid > 0) print ''; - $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,"; + $sql = "SELECT s.nom, s.rowid as socid, f.ref_supplier, f.amount, f.datef as df,"; $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; $sql.= " u.login, u.rowid as userid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/index.php b/htdocs/index.php index adb3c8e6f49..294443adff1 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -260,7 +260,7 @@ print ''; print ''; print ''; print ''; -if ($showweather) print ''; +if ($showweather) print ''; print ''; @@ -483,7 +483,7 @@ foreach($dashboardlines as $key => $board) print ''; if ($showweather) { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } + { + print $object->showOptionals($extrafields,'edit'); } // Note (private, no output on invoices, propales...) @@ -999,15 +979,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 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } // Note @@ -1230,14 +1202,8 @@ else $parameters=array('colspan' => ' colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'"'); $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); } // Note diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 0972d93f26a..17892d4631d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -974,40 +974,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)) { - $e=0; - foreach($extrafields->attribute_label as $key=>$label) - { - $colspan='3'; - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - if (($e % 2) == 0) - { - print ''; - $colspan='0'; - } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print ''; - - if (($e % 2) == 1) print ''."\n"; - $e++; - } - } + print $object->showOptionals($extrafields,'edit'); } // Ajout du logo @@ -1416,37 +1383,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)) { - $old_pos=0; - $e=0; - foreach($extrafields->attribute_label as $key=>$label) - { - $colspan = '3'; - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - if (($e % 2) == 0) - { - print ''."\n"; - $colspan = '0'; - } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - print '"."\n"; - - if (($e % 2) == 1 ) - { - print "\n"; - } - $e++; - } - } + print $object->showOptionals($extrafields,'edit'); } // Logo print ''; @@ -1761,31 +1698,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)) { - $e=0; - foreach($extrafields->attribute_label as $key=>$label) - { - $colspan='3'; - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - if (($e % 2) == 0) - { - print ''; - $colspan='0'; - } - print ''; - print '"; - - if (($e % 2) == 1) print ''; - $e++; - } - } + print $object->showOptionals($extrafields); } // Ban diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 206bf49e442..52bf676fca6 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -594,9 +594,10 @@ a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #D0D0D0; margin: 1px 1px 1px 5px; } a.vmenu:hover { color: #CCDDEE; } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 5px; } -font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; margin: 1px 1px 1px 5px; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; } +font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; } a.vsmenu:hover { color: #556677; } +font.vsmenudisabledmargin { margin: 1px 1px 1px 5px; } a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; } diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 45e2285d44a..9927b0d757a 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -645,7 +645,8 @@ a.vsmenu:link { font-size:11px; text-align:left; font-weight: normal; colo a.vsmenu:visited { font-size:11px; text-align:left; font-weight: normal; color: #202020; margin: 1px 1px 1px 4px; } a.vsmenu:active { font-size:11px; text-align:left; font-weight: normal; color: RGB(94,148,181); margin: 1px 1px 1px 4px; } a.vsmenu:hover { font-size:11px; text-align:left; font-weight: normal; color: #7F0A29; margin: 1px 1px 1px 4px; } -font.vsmenudisabled { font-size:11px; text-align:left; font-weight: normal; color: #202020; margin: 1px 1px 1px 4px; } +font.vsmenudisabled { font-size:11px; text-align:left; font-weight: normal; color: #202020; } +font.vsmenudisabledmargin { margin: 1px 1px 1px 4px; } a.help:link { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } a.help:visited { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index c546b606e94..876debfb9f2 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -657,7 +657,8 @@ a.vsmenu:link { font-size:11px; text-align:left; font-weight: normal; colo a.vsmenu:visited { font-size:11px; text-align:left; font-weight: normal; color: #202020; margin: 1px 1px 1px 4px; } a.vsmenu:active { font-size:11px; text-align:left; font-weight: normal; color: RGB(94,148,181); margin: 1px 1px 1px 4px; } a.vsmenu:hover { font-size:11px; text-align:left; font-weight: normal; color: #7F0A29; margin: 1px 1px 1px 4px; } -font.vsmenudisabled { font-size:11px; text-align:left; font-weight: normal; color: #202020; margin: 1px 1px 1px 4px; } +font.vsmenudisabled { font-size:11px; text-align:left; font-weight: normal; color: #202020; } +font.vsmenudisabledmargin { margin: 1px 1px 1px 4px; } a.help:link { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } a.help:visited { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index eb5d6b058f6..19398105406 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -356,7 +356,7 @@ td.showDragHandle { /* ============================================================================== */ div.fiche { - margin-: browser->phone) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'20':'24')); ?>px; + margin-: global->MAIN_MENU_USE_JQUERY_LAYOUT))?((empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu'))?'20':'4'):'24')); ?>px; margin-: browser->phone)?'12':'6')); ?>px; } @@ -839,9 +839,10 @@ a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #93a5aa; } a.vmenu:link, a.vmenu:visited { color: #; } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; padding: 1px 1px 1px 8px; } -font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; margin: 1px 1px 1px 8px; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } +font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; } a.vsmenu:link, a.vsmenu:visited { color: #; } +font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; } @@ -1593,6 +1594,7 @@ table.liste td { div.liste_titre, tr.liste_titre, tr.liste_titre_sel { height: 20px !important; + background: #7699A9; background-repeat: repeat-x; @@ -1602,7 +1604,6 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); - background: #7699A9; background-image: url(); color: #; @@ -2522,8 +2523,9 @@ div.dolEventError h1, div.dolEventError h2 { /* ============================================================================== */ .ui-body-c .ui-link { - color: #111 !important; + color: #FFF !important; } +/* .ui-li-divider { background: #eee !important; } @@ -2546,7 +2548,7 @@ div.dolEventError h1, div.dolEventError h2 { color: #444 !important; text-shadow: 0 1px 1px #fff !important; } - +*/ close(); diff --git a/htdocs/theme/phones/index.php b/htdocs/theme/phones/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/phones/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/phones/smartphone/AUTHOR b/htdocs/theme/phones/smartphone/AUTHOR deleted file mode 100644 index 03de906bb12..00000000000 --- a/htdocs/theme/phones/smartphone/AUTHOR +++ /dev/null @@ -1 +0,0 @@ -2009-2010 Regis Houssin diff --git a/htdocs/theme/phones/smartphone/index.php b/htdocs/theme/phones/smartphone/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/phones/smartphone/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/phones/smartphone/theme/default/default.css.php b/htdocs/theme/phones/smartphone/theme/default/default.css.php deleted file mode 100644 index d13d69e7c20..00000000000 --- a/htdocs/theme/phones/smartphone/theme/default/default.css.php +++ /dev/null @@ -1,531 +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 . - */ - -/** - * \file htdocs/theme/phones/smartphone/theme/default/default.css.php - * \brief Fichier de style CSS du theme Smartphone default - */ - -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); -if (! defined('NOLOGIN')) define('NOLOGIN',1); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); - -session_cache_limiter(FALSE); - -require_once '../../../../../main.inc.php'; - -// Define css type -header('Content-type: text/css'); -// Important: Avoid page request by browser and dynamic build at -// each Dolibarr page access. -if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate'); -else header('Cache-Control: no-cache'); - -// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. -if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); } - -if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL -if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL -$langs->load("main",0,1); -$right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); -$left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); - -?> -.ui-mobile-viewport { -/*width:600px; -height:600px; -min-height: 200px; -min-width: 600px; -overflow:scroll; */ -} - -.landscape, .landscape .ui-page { -} - -#dol-homeheader { height: 40px; font-size: 16px; } - -.ui-mobile-viewport { - margin: 0; -} - -.ui-header { height: 40px; font-size: 16px; } - -.ui-content { -padding-top: 1px; -padding-right: 0; -padding-bottom: 0px; -padding-left: 1px; -} - -.ui-content .ui-listview { - margin-top: 0px; /* Use here negative value of ui-content top padding */ - margin-right: 0px; - margin-bottom: 0px; - margin-left: 0px; - /* overflow: scroll; */ -} - -.ui-mobile #dol-homeheader { padding: 10px 5px 0; text-align: center } -.ui-mobile #dol-homeheader h1 { margin: 0 0 10px; } -.ui-mobile #dol-homeheader p { margin: 0; } - -.ui-li-icon { - left:5px; - top:0.3em; -} - -.ui-li .ui-btn-inner { - padding: 0.4em 5px 0.4em 5px; -} - -input.ui-input-text, textarea.ui-input-text { - padding: 0.2em; -} - -.ui-body-b { - background: #FFFFFF; -} - -.ui-body-c { - background: #FFFFFF; - text-shadow: none; -} - -.loginform { - margin-left: 10px; - margin-right: 10px; - padding: 5px; -} - - - - -/* ============================================================================== */ -/* Styles de positionnement des zones */ -/* ============================================================================== */ - -div.fiche { - margin-: browser->phone)?'10':'2'); ?>px; - margin-: browser->phone)?'6':''); ?>px; -} - -div.fichecenter { - width: 100%; - clear: both; /* This is to have div fichecenter that are true rectangles */ -} -div.fichethirdleft { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 35%;\n"; } ?> -} -div.fichetwothirdright { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 65%;\n"; } ?> -} -div.fichehalfleft { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 50%;\n"; } ?> -} -div.fichehalfright { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 50%;\n"; } ?> -} -div.ficheaddleft { - browser->phone)) { print "padding-left: 6px;\n"; } ?> -} - - -/* ============================================================================== */ -/* Boutons actions */ -/* ============================================================================== */ - -.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { - overflow: hidden; - padding: 0.6em 25px; - position: relative; - white-space: nowrap; - - font-family: ; - background: white; - border: 1px solid #8CACBB; - color: #436976; - padding: 0em 0.7em; - margin: 0em 0.5em; - text-decoration: none; - white-space: nowrap; -} - -.butAction:hover { - background: #dee7ec; -} - -.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { - border: 1px solid #997777; -} - -.butActionDelete:hover { - background: #FFe7ec; -} - -.butActionRefused { - font-family: !important; - font-weight: bold !important; - background: white !important; - border: 1px solid #AAAAAA !important; - color: #AAAAAA !important; - padding: 0em 0.7em !important; - margin: 0em 0.5em !important; - text-decoration: none !important; - white-space: nowrap !important; - cursor: not-allowed; -} - -span.butAction, span.butActionDelete { - cursor: pointer; -} - - -/* ============================================================================== */ -/* Tables */ -/* ============================================================================== */ - -/* -#undertopmenu { -background-image: url(""); -background-repeat: repeat-x; -} -*/ - - -.nocellnopadd { -list-style-type:none; -margin: 0px; -padding: 0px; -} - -.notopnoleft { -border-collapse: collapse; -border: 0px; -padding-top: 0px; -padding-: 0px; -padding-: 4px; -padding-bottom: 4px; -margin: 0px 0px; -} -.notopnoleftnoright { -border-collapse: collapse; -border: 0px; -padding-top: 0px; -padding-left: 0px; -padding-right: 0px; -padding-bottom: 4px; -margin: 0px 0px 0px 0px; -} - - -table.border { -border: 1px solid #9CACBB; -border-collapse: collapse; -} - -table.border td { -padding: 1px 2px; -border: 1px solid #9CACBB; -border-collapse: collapse; -} - -td.border { -border-top: 1px solid #000000; -border-right: 1px solid #000000; -border-bottom: 1px solid #000000; -border-left: 1px solid #000000; -} - - -/* Main boxes */ - -table.noborder { -border-collapse: collapse; -border-top-color: #FEFEFE; - -border-right-width: 1px; -border-right-color: #BBBBBB; -border-right-style: solid; - -border-left-width: 1px; -border-left-color: #BBBBBB; -border-left-style: solid; - -border-bottom-width: 1px; -border-bottom-color: #BBBBBB; -border-bottom-style: solid; - -margin: 0px 0px 2px 0px; -} - -table.noborder tr { -border-top-color: #FEFEFE; - -border-right-width: 1px; -border-right-color: #BBBBBB; -border-right-style: solid; - -border-left-width: 1px; -border-left-color: #BBBBBB; -border-left-style: solid; -height: 16px; -} - -table.noborder td { -padding: 1px 2px 0px 1px; /* t r b l */ -} - -table.nobordernopadding { -border-collapse: collapse; -border: 0px; -} -table.nobordernopadding tr { -border: 0px; -padding: 0px 0px; -} -table.nobordernopadding td { -border: 0px; -padding: 0px 0px; -} - - - -tr.liste_titre -{ - height: 24px; - background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0; - border: 1px solid #456F9A; - color: #FFFFFF; - font-family: ; - /* border-bottom: 1px solid #FDFFFF; */ - white-space: nowrap; -} -th.liste_titre, td.liste_titre -{ - background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0; - border: 1px solid #456F9A; - color: #FFFFFF; - font-family: ; - font-weight: normal; - /* border-bottom: 1px solid #FDFFFF; */ - white-space: nowrap; - text-align: ; -} -th.liste_titre_sel, td.liste_titre_sel -{ - background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0; - color: #FFFFFF; - font-family: ; - font-weight: normal; - /* text-decoration: underline; */ - /* border-bottom: 1px solid #FDFFFF; */ - white-space: nowrap; - text-align: ; -} -input.liste_titre { -background: transparent; -background-repeat: repeat-x; -border: 0px; -} - -tr.liste_total td { -border-top: 1px solid #DDDDDD; -background: #F0F0F0; -background-repeat: repeat-x; -color: #332266; -font-weight: normal; -white-space: nowrap; -} - - -.impair { -/* background: #d0d4d7; */ -background: #eaeaea; -font-family: ; -border: 0px; -} -/* -.impair:hover { -background: #c0c4c7; -border: 0px; -} -*/ - -.pair { -/* background: #e6ebed; */ -background: #f4f4f4; -font-family: ; -border: 0px; -} -/* -.pair:hover { -background: #c0c4c7; -border: 0px; -} -*/ - - - -div.titre { - padding-top: 10px; - font-family: ; - font-weight: normal; - color: #336666; - text-decoration: none; -} - - - -/* ============================================================================== */ -/* Onglets */ -/* ============================================================================== */ - -div.tabs { - top: 20px; - margin: 1px 0px 0px 0px; - padding: 0px 6px 0px 0px; - text-align: ; -} - -div.tabBar { - color: #234046; - padding-top: 10px; - padding-left: 8px; - padding-right: 8px; - padding-bottom: 8px; - margin: 0px 0px 10px 0px; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - -moz-border-radius-bottomleft:6px; - -moz-border-radius-bottomright:6px; - border-right: 1px solid #555555; - border-bottom: 1px solid #555555; - border-left: 1px solid #D0D0D0; - border-top: 1px solid #D8D8D8; - background: #dee7ec url() repeat-x; -} - -div.tabsAction { - margin: 20px 0em 1px 0em; - padding: 0em 0em; - text-align: right; -} - - -a.tabTitle { - display: none; -} - -a.tab:link { - background: #dee7ec; - color: #436976; - font-family: ; - padding: 0px 6px; - margin: 0em 0.2em; - text-decoration: none; - white-space: nowrap; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; -} -a.tab:visited { - background: #dee7ec; - color: #436976; - font-family: ; - padding: 0px 6px; - margin: 0em 0.2em; - text-decoration: none; - white-space: nowrap; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; -} -a.tab#active { - background: white; - border-bottom: #dee7ec 1px solid; - font-family: ; - color: #436976; - padding: 0px 6px; - margin: 0em 0.2em; - text-decoration: none; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; - border-bottom: 1px solid white; -} -a.tab:hover { - background: white; - color: #436976; - font-family: ; - padding: 0px 6px; - margin: 0em 0.2em; - text-decoration: none; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; -} - -a.tabimage { - color: #436976; - font-family: ; - text-decoration: none; - white-space: nowrap; -} - -td.tab { - background: #dee7ec; -} - -span.tabspan { - background: #dee7ec; - color: #436976; - font-family: ; - padding: 0px 6px; - margin: 0em 0.2em; - text-decoration: none; - white-space: nowrap; - -moz-border-radius-topleft:6px; - -moz-border-radius-topright:6px; - - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; -} - diff --git a/htdocs/theme/phones/smartphone/theme/default/img/accessibility.png b/htdocs/theme/phones/smartphone/theme/default/img/accessibility.png deleted file mode 100644 index 6478c8b9a25..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/accessibility.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/appstore.png b/htdocs/theme/phones/smartphone/theme/default/img/appstore.png deleted file mode 100755 index 4a1be06546d..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/appstore.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/basics.png b/htdocs/theme/phones/smartphone/theme/default/img/basics.png deleted file mode 100755 index 5305ea3352e..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/basics.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/calculator.png b/htdocs/theme/phones/smartphone/theme/default/img/calculator.png deleted file mode 100755 index 4d61678cb89..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/calculator.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/calendar.png b/htdocs/theme/phones/smartphone/theme/default/img/calendar.png deleted file mode 100755 index e6e5591f141..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/calendar.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/calendar2.png b/htdocs/theme/phones/smartphone/theme/default/img/calendar2.png deleted file mode 100755 index 9c554223503..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/calendar2.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/camera.png b/htdocs/theme/phones/smartphone/theme/default/img/camera.png deleted file mode 100755 index 9b808a58605..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/camera.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/clock.png b/htdocs/theme/phones/smartphone/theme/default/img/clock.png deleted file mode 100755 index 801c6cb9d83..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/clock.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/close.png b/htdocs/theme/phones/smartphone/theme/default/img/close.png deleted file mode 100644 index aacac9fc423..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/close.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/compass.png b/htdocs/theme/phones/smartphone/theme/default/img/compass.png deleted file mode 100644 index 66533d34144..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/compass.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/contacts.png b/htdocs/theme/phones/smartphone/theme/default/img/contacts.png deleted file mode 100755 index 76ae042032c..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/contacts.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/dolibarr.png b/htdocs/theme/phones/smartphone/theme/default/img/dolibarr.png deleted file mode 100644 index ad8a87ac0e1..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/dolibarr.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/favicon.ico b/htdocs/theme/phones/smartphone/theme/default/img/favicon.ico deleted file mode 100644 index 7d41c54d5bb..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/favicon.ico and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/help.png b/htdocs/theme/phones/smartphone/theme/default/img/help.png deleted file mode 100755 index 0f53e2788a0..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/help.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/homescreen.png b/htdocs/theme/phones/smartphone/theme/default/img/homescreen.png deleted file mode 100644 index 8fedbf05d5b..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/homescreen.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/ipod.png b/htdocs/theme/phones/smartphone/theme/default/img/ipod.png deleted file mode 100755 index f03c7b0de4c..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/ipod.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/itunes.png b/htdocs/theme/phones/smartphone/theme/default/img/itunes.png deleted file mode 100755 index ab77534ab3b..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/itunes.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/mail.png b/htdocs/theme/phones/smartphone/theme/default/img/mail.png deleted file mode 100755 index 42970057a78..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/mail.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/maps.png b/htdocs/theme/phones/smartphone/theme/default/img/maps.png deleted file mode 100755 index 9f517e3b13f..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/maps.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/messages.png b/htdocs/theme/phones/smartphone/theme/default/img/messages.png deleted file mode 100644 index 1a7879a2b5f..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/messages.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/music.png b/htdocs/theme/phones/smartphone/theme/default/img/music.png deleted file mode 100755 index 83a21315531..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/music.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/nike+.png b/htdocs/theme/phones/smartphone/theme/default/img/nike+.png deleted file mode 100644 index 673d59dc84e..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/nike+.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/notepad.png b/htdocs/theme/phones/smartphone/theme/default/img/notepad.png deleted file mode 100755 index 3f38062986a..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/notepad.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/other.png b/htdocs/theme/phones/smartphone/theme/default/img/other.png deleted file mode 100755 index b6849698f6f..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/other.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/otherapps.png b/htdocs/theme/phones/smartphone/theme/default/img/otherapps.png deleted file mode 100755 index a8fbb146f23..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/otherapps.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/photos.png b/htdocs/theme/phones/smartphone/theme/default/img/photos.png deleted file mode 100755 index 2c801e05df7..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/photos.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/plugin.png b/htdocs/theme/phones/smartphone/theme/default/img/plugin.png deleted file mode 100755 index dc7c2c271c2..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/plugin.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/safari.png b/htdocs/theme/phones/smartphone/theme/default/img/safari.png deleted file mode 100755 index e7ca494a7d6..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/safari.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/settings.png b/htdocs/theme/phones/smartphone/theme/default/img/settings.png deleted file mode 100755 index 4b94e87113b..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/settings.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/sketches.png b/htdocs/theme/phones/smartphone/theme/default/img/sketches.png deleted file mode 100755 index 8d7bd14e0df..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/sketches.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/sms.png b/htdocs/theme/phones/smartphone/theme/default/img/sms.png deleted file mode 100755 index 3c8af6cc23f..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/sms.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/start.png b/htdocs/theme/phones/smartphone/theme/default/img/start.png deleted file mode 100755 index b22e2450e62..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/start.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/stocks.png b/htdocs/theme/phones/smartphone/theme/default/img/stocks.png deleted file mode 100755 index 041648b09bb..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/stocks.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/support.png b/htdocs/theme/phones/smartphone/theme/default/img/support.png deleted file mode 100644 index 4622dc9ea3f..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/support.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/telephone.png b/htdocs/theme/phones/smartphone/theme/default/img/telephone.png deleted file mode 100755 index 4b8e07a27f1..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/telephone.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/tools.png b/htdocs/theme/phones/smartphone/theme/default/img/tools.png deleted file mode 100644 index acddd0ab44b..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/tools.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/video.png b/htdocs/theme/phones/smartphone/theme/default/img/video.png deleted file mode 100755 index 0aa924894b6..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/video.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/voice.png b/htdocs/theme/phones/smartphone/theme/default/img/voice.png deleted file mode 100644 index fd3a4493cc5..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/voice.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/weather.png b/htdocs/theme/phones/smartphone/theme/default/img/weather.png deleted file mode 100755 index d22550b1e74..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/weather.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/wordpress.png b/htdocs/theme/phones/smartphone/theme/default/img/wordpress.png deleted file mode 100755 index 28f0f7ed308..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/wordpress.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/img/youtube.png b/htdocs/theme/phones/smartphone/theme/default/img/youtube.png deleted file mode 100755 index 347880c239a..00000000000 Binary files a/htdocs/theme/phones/smartphone/theme/default/img/youtube.png and /dev/null differ diff --git a/htdocs/theme/phones/smartphone/theme/default/index.php b/htdocs/theme/phones/smartphone/theme/default/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/phones/smartphone/theme/default/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/phones/smartphone/tpl/header.tpl.php b/htdocs/theme/phones/smartphone/tpl/header.tpl.php deleted file mode 100644 index 23843681e08..00000000000 --- a/htdocs/theme/phones/smartphone/tpl/header.tpl.php +++ /dev/null @@ -1,28 +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 . - * - */ -?> - -<?php echo $title; ?> - - - - - - - - \ No newline at end of file diff --git a/htdocs/theme/phones/smartphone/tpl/index.php b/htdocs/theme/phones/smartphone/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/phones/smartphone/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/phones/smartphone/tpl/login.tpl.php b/htdocs/theme/phones/smartphone/tpl/login.tpl.php deleted file mode 100644 index 2033fad209c..00000000000 --- a/htdocs/theme/phones/smartphone/tpl/login.tpl.php +++ /dev/null @@ -1,104 +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(); -?> - - - - - - - -
    - -
    -
    - global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; - print $appli; - ?> -
    -
    - -
    - -
    - - - -
    - - - -
    - - - -
    - - - - - - -
    - -
    - - - - - -
    - - - - -
    - - - - - - - - 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(); -?> - - - - - - -
    - -
    -
    - global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; - print $appli; - ?> -
    -
    - -
    - - - showmenu(1); ?> - -
    - -
    - -
    - -
    - - - - 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(); -?> - - - - - - -
    - -
    -
    - trans('Identification'); ?> -
    -
    - -
    - -
    - - - -
    - - - - - - - - - - - -
    - -
    - - - - - -
    - -
    - trans('SendNewPasswordDesc'); - }else{ - echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); - } ?> -
    - -
    - - - - - - - - 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 '
    attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } + print $object->showOptionals($extrafields,'edit'); } print "
    '.$langs->trans("Number").''.$langs->trans("Late").'    
    '; + print ''; $text=''; if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",$totallate).')'; $options='height="64px"'; diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 5c2a86122ea..c47b7a9adcf 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -85,6 +85,7 @@ alter table llx_societe_rib CHANGE COLUMN adresse_proprio owner_address text; alter table llx_societe_address CHANGE COLUMN ville town text; alter table llx_societe_address CHANGE COLUMN cp zip varchar(10); alter table llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer; +alter table llx_facture_fourn CHANGE COLUMN facnumber ref_supplier varchar(30); ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description; @@ -208,5 +209,3 @@ ALTER TABLE llx_user ADD COLUMN town varchar(50); ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; - -ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3f3695c7d27..bae7f0de7f2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -647,9 +647,6 @@ if (! defined('NOLOGIN')) $conf->css = "/theme/".$conf->theme."/style.css.php"; } - // If theme support option like flip-hide left menu and we use a smartphone, we force it - if (! empty($conf->global->MAIN_SMARTPHONE_OPTIM) && $conf->browser->phone && $conf->theme == 'eldy') $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced'; - // Set javascript option if (! GETPOST('nojs')) // If javascript was not disabled on URL { @@ -949,6 +946,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print ''."\n"; } + // jQuery jMobile + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile')) + { + print ''."\n"; + } } print ''."\n"; @@ -969,7 +971,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs } $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity; if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; - //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; + if (GETPOST('dol_hide_topmenu')) $themeparam.='&dol_hide_topmenu=1'; + if (GETPOST('dol_hide_leftmenu')) $themeparam.='&dol_hide_leftmenu=1'; + //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; print ''."\n"; // CSS forced by modules (relative url starting with /) @@ -1005,11 +1009,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; - // Output standard javascript links - if (! $disablejs && ! empty($conf->use_javascript_ajax)) - { - $ext='.js'; + $ext='.js'; + // Output standard javascript links + if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax)) + { // JQuery. Must be before other includes print ''."\n"; if (constant('JS_JQUERY')) print ''."\n"; @@ -1101,6 +1105,21 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print ''."\n"; } + // jQuery Timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) + { + print ''."\n"; + print ''."\n"; + } + // jQuery jMobile + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile')) + { + print ''."\n"; + } + } + + if (! $disablejs && ! empty($conf->use_javascript_ajax)) + { // CKEditor if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor')) { @@ -1115,11 +1134,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } - // jQuery Timepicker - if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) - { - print ''."\n"; - } // Global js function print ''."\n"; @@ -1128,12 +1142,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // Add datepicker default options print ''."\n"; - // add timepicker default options - if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) - { - print ''."\n"; - } - // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) { @@ -1294,7 +1302,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '
    '."\n"; - if (empty($_SESSION['dol_hide_topmenu'])) + if (empty($_SESSION['dol_hide_topmenu']) && ! GETPOST('dol_hide_topmenu')) { print '
    '."\n"; @@ -1425,7 +1433,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('searchform','leftblock')); - if (empty($_SESSION['dol_hide_leftmenu'])) + if (empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu')) { if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'
    '."\n"; else print '
    '; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 1ccc7e2c8b3..e222476ac1e 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -56,6 +56,9 @@ if (! empty($user->societe_id)) $socid=$user->societe_id; $object = new Product($db); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('product'); + if ($id > 0 || ! empty($ref)) { $object = new Product($db); @@ -212,14 +215,8 @@ if (empty($reshook)) } } - // 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); $id = $object->create($user); @@ -272,14 +269,8 @@ if (empty($reshook)) $object->finished = GETPOST('finished'); $object->hidden = GETPOST('hidden')=='yes'?1:0; - // 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); if ($object->check()) { @@ -632,9 +623,6 @@ if (GETPOST("cancel") == $langs->trans("Cancel")) * View */ -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('product'); - $helpurl=''; if (GETPOST("type") == '0') $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; if (GETPOST("type") == '1') $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; @@ -791,16 +779,8 @@ else $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)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(GETPOST('options_'.$key)?GETPOST('options_'.$key):$object->array_options["options_".$key]); - print '
    '; - print $extrafields->showInputField($key,$value); - print '
    '; - print $extrafields->showInputField($key,$value); - print '
    '.$label.''; - print $extrafields->showOutputField($key,$value); - print '
    '; - - // Convert date into timestamp format - if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) - { - $value = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - - print $extrafields->showInputField($key,$value); - print '
    '; - print $extrafields->showInputField($key,$value); - print "
    '.$label.''; - print $extrafields->showOutputField($key,$value); - print "
    '; - print $extrafields->showInputField($key,$value); - 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 '
    '; - print $extrafields->showOutputField($key,$value); - 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 '
    '; - print $extrafields->showInputField($key,$value); - print '
    '; diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index f5523c791f2..7113d2a459a 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -61,8 +61,8 @@ $url=DOL_URL_ROOT."/index.php"; // By default go to login page if ($urlfrom) $url=DOL_URL_ROOT.$urlfrom; if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOUT_GOTO_URL; -if (! empty($_SESSION['dol_hide_topmenu'])) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1'; -if (! empty($_SESSION['dol_hide_leftmenu'])) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1'; +if (GETPOST('dol_hide_topmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1'; +if (GETPOST('dol_hide_leftmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1'; // Destroy session $prefix=dol_getprefix();